/* ============================================================================
   css/blog.css — HealthGyanHub Blog
   ----------------------------------------------------------------------------
   This file ONLY adds blog-specific components. It intentionally does NOT
   redefine tokens, .site-header, .site-footer, .hero, .reveal, .btn-primary,
   .btn-secondary, or .about-disclaimer — those already exist in
   css/Homepage.css (loaded before this file on every blog page) and blog
   pages reuse them as-is so the site stays visually and behaviorally
   consistent. If you ever change a brand color or the header/footer in
   Homepage.css, blog pages update automatically — nothing here needs to
   change in step.
   ============================================================================ */

/* ─── Small additive header state (blog pages only) ─────────────── */
.nav-link.is-active { color: var(--text); background: var(--surface2); }

/* ─── Blog hero search ────────────────────────────────────────────── */
.blog-search {
  position: relative;
  max-width: 560px;
  margin: 2.25rem auto 0;
  animation: fadeSlideUp 0.9s 0.25s var(--ease) both;
}
.blog-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  padding: 15px 20px 15px 48px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.blog-search input::placeholder { color: var(--faint); }
.blog-search input:focus {
  outline: none;
  border-color: var(--border-lit);
  background: var(--surface2);
  box-shadow: 0 0 0 4px rgba(0, 200, 150, 0.12);
}
.blog-search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.blog-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; font-size: 0.8rem;
  align-items: center; justify-content: center;
}
.blog-search-clear[hidden] { display: none; }
.blog-search-clear:not([hidden]) { display: flex; }
.blog-search-clear:hover { color: var(--text); border-color: var(--border-lit); }

/* ─── Category filter pills ──────────────────────────────────────── */
.filter-bar-wrap {
  position: sticky; top: 68px; z-index: 150;
  background: rgba(6, 9, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.filter-bar {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 18px 2rem; scrollbar-width: none;
  max-width: 1200px; margin: 0 auto;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  flex: 0 0 auto;
  font-family: 'Manrope', sans-serif;
  font-size: 0.83rem; font-weight: 600;
  color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 9px 18px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: all 0.25s var(--ease);
  display: inline-flex; align-items: center; gap: 7px;
}
.filter-btn i { font-size: 0.78rem; }
.filter-btn:hover { color: var(--text); border-color: var(--border-lit); }
.filter-btn--active {
  color: #06090f; background: var(--grad); border-color: transparent;
  box-shadow: 0 4px 20px rgba(0, 200, 150, 0.35);
}

/* ─── Section head w/ inline results count ───────────────────────── */
.blog-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.blog-results-info { font-size: 0.8rem; color: var(--faint); }

/* ─── Featured article ────────────────────────────────────────────── */
.blog-featured {
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(135deg, rgba(0,200,150,0.09), rgba(0,114,255,0.07));
  border: 1px solid rgba(0,200,150,0.22);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 3.5rem;
  transition: border-color 0.3s var(--ease);
  text-decoration: none; color: var(--text);
}
.blog-featured:hover { border-color: rgba(0,200,150,0.4); }
.blog-featured-media { position: relative; min-height: 280px; background: var(--bg2); }
.blog-featured-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.blog-featured-body { padding: 2.5rem 2.75rem; display: flex; flex-direction: column; gap: 0.9rem; justify-content: center; }
.blog-featured-body h3 { font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.2; margin: 0.3rem 0; }
.blog-featured-body p { color: var(--muted); font-size: 0.98rem; line-height: 1.6; }

/* ─── Blog grid + cards ───────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.blog-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--text);
  transition: all 0.35s var(--ease);
  animation: fadeSlideUp 0.6s var(--ease) both;
}
.blog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0,200,150,0.3);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}
.blog-card-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg2); }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.blog-card:hover .blog-card-media img { transform: scale(1.06); }
.blog-card-category {
  position: absolute; top: 12px; left: 12px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(6,9,15,0.7); backdrop-filter: blur(6px);
  border: 1px solid rgba(0,200,150,0.35);
  color: var(--g1);
  display: inline-flex; align-items: center; gap: 5px;
}
.blog-card-body { padding: 1.35rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.blog-card-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.05rem; line-height: 1.35; margin: 0; }
.blog-card-excerpt { font-size: 0.86rem; color: var(--muted); line-height: 1.6; margin: 0; flex: 1; }
.blog-card-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.76rem; color: var(--faint); margin-top: 2px;
}
.blog-card-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.blog-card-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; color: var(--g1);
  margin-top: 4px;
}
.blog-card-link svg { width: 13px; height: 13px; transition: transform 0.25s var(--ease); }
.blog-card:hover .blog-card-link svg { transform: translateX(3px); }

/* ─── Empty state + load more ────────────────────────────────────── */
.blog-empty { text-align: center; padding: 4.5rem 1rem; color: var(--muted); }
.blog-empty h3 { font-family: 'Syne', sans-serif; color: var(--text); margin-bottom: 0.5rem; }
.blog-empty[hidden] { display: none; }

.load-more-wrap { text-align: center; margin: 2.5rem 0 1rem; }
.load-more-wrap[hidden] { display: none; }
.load-more-info { font-size: 0.8rem; color: var(--faint); margin-top: 0.75rem; }
.btn-secondary.btn--loading { opacity: 0.6; pointer-events: none; }

/* ─── Article page: breadcrumb ───────────────────────────────────── */
.blog-breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--faint); margin-bottom: 1.5rem;
}
.blog-breadcrumb a { color: var(--muted); }
.blog-breadcrumb a:hover { color: var(--g1); }
.blog-breadcrumb span[aria-current] { color: var(--g1); }

/* ─── Article page: header block ─────────────────────────────────── */
.article-hero { padding: 3rem 0 0; }
.article-hero h1 {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15;
  letter-spacing: -0.02em; max-width: 880px; margin: 1rem 0 1.1rem;
}
.article-excerpt { font-size: 1.08rem; color: var(--muted); max-width: 720px; margin-bottom: 1.4rem; }
.article-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--faint); padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.article-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.author-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.author-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad); color: #06090f;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 0.7rem;
  display: inline-flex; align-items: center; justify-content: center;
}

.article-cover { margin: 2rem 0 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 21/9; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Reading progress bar */
.reading-progress-track { position: sticky; top: 68px; z-index: 150; height: 3px; background: var(--faint); opacity: 0.3; }
.reading-progress-bar { height: 100%; width: 0%; background: var(--grad); transition: width 0.08s linear; }

/* ─── Article layout: body + sidebar ─────────────────────────────── */
.article-layout { display: grid; grid-template-columns: 1fr 230px; gap: 3.5rem; padding: 3rem 0 1rem; align-items: start; }
.article-body { font-size: 1.05rem; max-width: 720px; color: var(--text); }
.article-body h2 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.6rem; margin: 1.7em 0 0.6em; scroll-margin-top: 90px; }
.article-body h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.22rem; margin: 1.5em 0 0.5em; color: var(--g1); }
.article-body p { color: #c7d0dd; line-height: 1.8; margin-bottom: 1.2em; }
.article-body ul { margin: 0 0 1.2em 1.3em; }
.article-body li { color: #c7d0dd; line-height: 1.7; margin-bottom: 0.5em; }
.article-body li::marker { color: var(--g1); }
.article-body strong { color: var(--text); }
.article-body a { color: var(--g1); text-decoration: underline; text-decoration-color: rgba(0,200,150,0.4); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--g1); }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 2.2rem 0 0.5rem; }
.article-tag {
  font-size: 0.78rem; color: var(--muted);
  border: 1px solid var(--border); padding: 6px 13px; border-radius: 999px;
  transition: all 0.2s var(--ease);
}
.article-tag:hover { border-color: var(--border-lit); color: var(--g1); }

.back-to-blog {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  margin-top: 2rem;
}
.back-to-blog:hover { color: var(--g1); }
.back-to-blog svg { width: 14px; height: 14px; transform: rotate(180deg); }

/* Sidebar */
.article-sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1.4rem; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem; }
.sidebar-card h4 { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.9rem; font-weight: 700; }
.sidebar-author { display: flex; align-items: center; gap: 10px; }
.sidebar-author strong { display: block; font-size: 0.88rem; color: var(--text); }
.sidebar-author span { font-size: 0.76rem; color: var(--faint); }
.share-row { display: flex; gap: 8px; }
.share-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 10px; border-radius: var(--r-sm);
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all 0.2s var(--ease);
}
.share-btn:hover { color: var(--g1); border-color: var(--border-lit); }
.share-btn svg { width: 15px; height: 15px; }
.share-btn.is-copied { color: var(--g1); border-color: var(--border-lit); }

/* Pulse divider between article and related section */
.section-divider { width: 100%; height: 24px; margin: 1rem 0 2.5rem; opacity: 0.55; }

/* ─── Related articles ────────────────────────────────────────────── */
.related-section { padding: 0.5rem 0 2rem; border-top: 1px solid var(--border); margin-top: 1rem; }

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured-media { min-height: 220px; }
  .blog-featured-body { padding: 1.75rem; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar-card { flex: 1 1 220px; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .blog-featured-body { padding: 1.5rem; }
  .article-body { font-size: 1rem; }
  .article-sidebar { flex-direction: column; }
  .filter-bar { padding: 14px 1.25rem; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card { animation: none; }
}
