/* ==========================================================================
   AquaSense - Blog & Insights Stylesheet (blog.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO SECTION
   -------------------------------------------------------------------------- */
.blog-hero {
  position: relative;
  background: linear-gradient(135deg, #09263f 0%, #0d3b5e 50%, #1072bb 100%);
  padding: clamp(4rem, 8vw, 6.5rem) 1rem clamp(3rem, 6vw, 5rem);
  text-align: center;
  color: #ffffff;
  overflow: hidden;
}

.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(58, 168, 224, 0.22), transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(16, 114, 187, 0.25), transparent 60%);
  pointer-events: none;
}

.blog-hero-container {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  z-index: 2;
}

.blog-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  color: #7dd3fc;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.blog-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 1.1rem;
  letter-spacing: -0.02em;
}

.blog-hero h1 span {
  background: linear-gradient(120deg, #7dd3fc 0%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-hero p {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: #e2edf8;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   2. CATEGORY FILTER TABS
   -------------------------------------------------------------------------- */
.blog-tabs-section {
  background: #f8fafc;
  padding: 2.2rem 1rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.blog-tabs-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.blog-tab-btn {
  background: #ffffff;
  border: 1px solid #dbe5ec;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 9px 20px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.blog-tab-btn:hover {
  color: #1072bb;
  border-color: #1072bb;
  transform: translateY(-1px);
}

.blog-tab-btn.active {
  background: #1072bb;
  color: #ffffff;
  border-color: #1072bb;
  box-shadow: 0 6px 16px rgba(16, 114, 187, 0.28);
}

/* --------------------------------------------------------------------------
   3. ARTICLES GRID & CARDS
   -------------------------------------------------------------------------- */
.blog-main-section {
  background: #f8fafc;
  padding: 3rem 1rem 5rem;
}

.blog-container {
  max-width: 1240px;
  margin: 0 auto;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}

.article-card {
  background: #ffffff;
  border: 1px solid #e2edfd;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(11, 46, 69, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 42px rgba(16, 114, 187, 0.14);
  border-color: #bcd9fa;
}

/* Card Cover Image */
.article-thumb-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d3b5e;
}

.article-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-thumb-box img {
  transform: scale(1.04);
}

.article-pill-category {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(13, 59, 94, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 20px;
  z-index: 2;
}

/* Card Body */
.article-body {
  padding: 1.75rem 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.85rem;
  font-weight: 500;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 750;
  color: #0a2540;
  line-height: 1.35;
  margin-bottom: 0.9rem;
  transition: color 0.2s ease;
}

.article-card:hover .article-title {
  color: #1072bb;
}

.article-excerpt {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* Key Metrics Chips */
.article-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.article-badge-item {
  background: #f0f7ff;
  border: 1px solid #cfe2f7;
  color: #0d3b5e;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.article-badge-item i {
  color: #1072bb;
  font-size: 0.7rem;
}

/* Card Footer CTA */
.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  border-top: 1px solid #edf2f7;
  margin-top: auto;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 9px;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1072bb, #3aa8e0);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.author-info {
  line-height: 1.2;
}

.author-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0d3b5e;
  display: block;
}

.author-role {
  font-size: 0.7rem;
  color: #64748b;
}

.read-article-btn {
  background: #f0f7ff;
  border: 1px solid #cfe2f7;
  color: #1072bb;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.read-article-btn:hover {
  background: #1072bb;
  color: #ffffff;
  border-color: #1072bb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 114, 187, 0.25);
}

/* --------------------------------------------------------------------------
   4. FULL ARTICLE READER MODAL
   -------------------------------------------------------------------------- */
.blog-modal .modal-dialog {
  max-width: 920px;
  max-height: calc(100vh - 3rem);
  margin: 1.5rem auto;
  display: flex;
}

.blog-modal .modal-content {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(11, 46, 69, 0.28);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 3rem);
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.blog-modal-header {
  position: relative;
  background: #0d3b5e;
  color: #ffffff;
  padding: 2.2rem 2.2rem 1.8rem;
  flex-shrink: 0;
}

.blog-modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0d3b5e;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  outline: none !important;
}

.blog-modal-close-btn:hover {
  background: #ffffff;
  color: #ef4444;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.blog-modal-header .btn-close {
  display: none;
}

.modal-category-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #7dd3fc;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.blog-modal-title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.blog-modal-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.blog-modal-body {
  flex: 1 1 auto;
  overflow-y: auto !important;
  max-height: calc(100vh - 210px);
  padding: 2.4rem;
  font-size: 1.02rem;
  line-height: 1.75;
  color: #334155;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Custom Sleek Scrollbar for Article Modal */
.blog-modal-body::-webkit-scrollbar {
  width: 8px;
}

.blog-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}

.blog-modal-body::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 8px;
}

.blog-modal-body::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

.blog-modal-body h3 {
  font-size: 1.35rem;
  font-weight: 750;
  color: #0a2540;
  margin: 2rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #eef3f7;
}

.blog-modal-body p {
  margin-bottom: 1.25rem;
}

.blog-modal-body ul {
  margin: 0.5rem 0 1.5rem 1.2rem;
  padding: 0;
}

.blog-modal-body li {
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

.blog-modal-body li strong {
  color: #0a2540;
}

/* Callout Box inside article */
.blog-callout {
  background: #f0f7ff;
  border-left: 4px solid #1072bb;
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.blog-callout h5 {
  font-size: 1rem;
  font-weight: 750;
  color: #0d3b5e;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-callout p {
  font-size: 0.92rem;
  color: #334155;
  margin: 0;
}

/* Infographic stat box */
.blog-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.blog-stat-card {
  background: #ffffff;
  border: 1px solid #dbe5ec;
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(11, 46, 69, 0.04);
}

.blog-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: #1072bb;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.blog-stat-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: #475569;
}

/* Diagram Flow box */
.blog-flow-diagram {
  background: #0a2540;
  color: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  margin: 2rem 0;
  text-align: center;
}

.flow-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.25rem;
}

.flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.flow-node {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
}

.flow-arrow {
  color: #7dd3fc;
  font-size: 0.9rem;
}

/* Modal Bottom CTA */
.blog-modal-cta {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0effe 100%);
  border: 1px solid #bcd9fa;
  border-radius: 16px;
  padding: 1.6rem;
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.blog-modal-cta h4 {
  font-size: 1.1rem;
  font-weight: 750;
  color: #0d3b5e;
  margin-bottom: 0.3rem;
}

.blog-modal-cta p {
  font-size: 0.88rem;
  color: #475569;
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. NEWSLETTER / BOTTOM CTA SECTION
   -------------------------------------------------------------------------- */
.blog-newsletter-section {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: clamp(3rem, 5vw, 4.5rem) 1rem;
}

.blog-newsletter-card {
  max-width: 900px;
  margin: 0 auto;
  background: linear-gradient(135deg, #09263f 0%, #0d3b5e 100%);
  border-radius: 24px;
  padding: clamp(2rem, 4vw, 3.5rem);
  color: #ffffff;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(11, 46, 69, 0.16);
}

.blog-newsletter-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58, 168, 224, 0.25), transparent 70%);
  pointer-events: none;
}

.blog-newsletter-card h3 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.blog-newsletter-card p {
  font-size: 0.98rem;
  color: #cbd5e1;
  max-width: 600px;
  margin: 0 auto 1.75rem;
  line-height: 1.55;
}

.newsletter-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.newsletter-btn-primary {
  background: #1072bb;
  color: #ffffff;
  border: 1px solid #1072bb;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.newsletter-btn-primary:hover {
  background: #0c5a95;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 114, 187, 0.4);
}

.newsletter-btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.newsletter-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   6. RESPONSIVENESS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .blog-modal-body {
    padding: 1.5rem;
  }

  .blog-modal-header {
    padding: 1.5rem;
  }

  .blog-modal-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
