/* ==========================================================================
   blog.css — the /blog index and every article.

   Built on the site's own tokens (--paper, --text-2, --muted, --ink-2,
   --line-soft, --accent-ink …) so light, dark and dim all work without
   overrides. Long-form text keeps a ~70-character measure and generous line
   height: these pages are read, not skimmed past.
   ========================================================================== */

/* ---------- hero ---------- */
.blog-hero { padding-block: clamp(2.6rem, 6vw, 4.5rem) clamp(1.4rem, 3vw, 2.2rem); }
.blog-hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.3rem);
  max-width: 22ch;
  line-height: 1.08;
}
.blog-hero .lede { max-width: 62ch; margin-top: 1.1rem; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); }

.blog-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
  font-size: 0.86rem;
  color: var(--muted-2);
}
.blog-crumb a { color: var(--muted); text-decoration: none; }
.blog-crumb a:hover { color: var(--accent-ink); }
.blog-crumb span[aria-current] { color: var(--text-2); }

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.6rem;
  margin: 1.5rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9rem;
  color: var(--muted-2);
}
.blog-meta b { color: var(--text-2); font-weight: 600; }
.blog-meta a { color: var(--accent-ink); }

/* ---------- body grid: contents list + article ---------- */
.blog-main { padding-block: clamp(1.4rem, 3vw, 2.4rem) clamp(3rem, 6vw, 5rem); }
.blog-grid {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 960px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-toc {
  position: sticky;
  top: 6rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--ink-2);
}
@media (max-width: 960px) { .blog-toc { position: static; } }
.blog-toc > b {
  display: block;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-3);
  margin-bottom: 0.7rem;
}
.blog-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.12rem; }
.blog-toc a {
  display: block;
  padding: 0.34rem 0.5rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}
.blog-toc a:hover { background: rgba(var(--accent-rgb), 0.08); color: var(--accent-ink); }
@media (max-width: 767px) { .blog-toc a { display: flex; align-items: center; min-height: 44px; } }

/* ---------- prose ---------- */
.blog-body { min-width: 0; max-width: 46rem; }
.blog-body > * + * { margin-top: 1.1rem; }
.blog-body h2 {
  font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.8rem);
  line-height: 1.2;
  margin-top: 2.8rem;
  padding-top: 0.2rem;
  scroll-margin-top: 6.5rem;
}
.blog-body h3 {
  font-size: clamp(1.1rem, 1.02rem + 0.35vw, 1.28rem);
  margin-top: 1.9rem;
  scroll-margin-top: 6.5rem;
}
.blog-body p,
.blog-body li {
  font-size: 1.05rem;
  line-height: 1.78;
  color: var(--text-2);
}
.blog-body p { max-width: 70ch; }
.blog-body ul,
.blog-body ol { padding-left: 1.3rem; display: grid; gap: 0.45rem; max-width: 68ch; }
/* the site reset strips list markers; articles need them back */
.blog-body ul { list-style: disc; }
.blog-body ol { list-style: decimal; }
.blog-body ol[type="a"], .blog-body ol.opts { list-style: lower-alpha; }
.blog-body li { display: list-item; }
.blog-body li::marker { color: var(--accent-ink); }
.blog-body strong, .blog-body b { color: var(--paper); font-weight: 650; }
.blog-body a:not(.btn) {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.blog-body a[target="_blank"]::after {
  content: "\2197";
  display: inline-block;
  margin-left: 0.15em;
  font-size: 0.8em;
  text-decoration: none;
}
.blog-body hr { border: 0; border-top: 1px solid var(--line-soft); margin-block: 2.2rem; }

/* tables scroll sideways inside their box instead of widening the page */
.blog-table { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.blog-table table { width: 100%; border-collapse: collapse; min-width: 32rem; font-size: 0.96rem; }
.blog-table th,
.blog-table td { padding: 0.7rem 0.85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); line-height: 1.55; color: var(--text-2); }
.blog-table th { background: var(--ink-2); color: var(--paper); font-family: var(--font-display); font-size: 0.86rem; font-weight: 600; }
.blog-table tr:last-child td { border-bottom: 0; }

/* ---------- callouts ---------- */
.blog-answer,
.blog-key,
.blog-note {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}
.blog-answer {
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
}
.blog-answer > b,
.blog-key > b,
.blog-note > b {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.blog-answer p { margin: 0; font-size: 1.08rem; color: var(--paper); }
.blog-key { background: var(--ink-2); }
.blog-key ul { margin: 0; }
.blog-note { background: var(--ink-2); border-style: dashed; }
.blog-note p { margin: 0; }

/* practice questions */
.blog-q {
  padding: 1rem 1.15rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--ink-2);
}
.blog-q > p:first-child { margin-top: 0; color: var(--paper); }
.blog-q ol[type="a"], .blog-q ol.opts { list-style: lower-alpha; }
.blog-q details { margin-top: 0.6rem; }
.blog-q summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent-ink);
}
.blog-q details p { margin-top: 0.4rem; }

/* ---------- mid-article call to action ---------- */
.blog-cta {
  display: grid;
  gap: 0.6rem;
  margin-block: 2.4rem !important;
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(var(--accent-rgb), 0.14), transparent 60%),
    var(--ink-2);
}
.blog-cta strong { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.25; color: var(--paper); }
.blog-cta p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.blog-cta .blog-cta__row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.4rem; }

/* ---------- FAQ ---------- */
.blog-faq details {
  border-bottom: 1px solid var(--line-soft);
  padding-block: 0.25rem;
}
.blog-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 52px;
  padding-block: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--paper);
}
.blog-faq summary::-webkit-details-marker { display: none; }
.blog-faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--accent-ink);
  transition: transform 0.3s ease;
}
.blog-faq details[open] summary::after { transform: rotate(45deg); }
.blog-faq details p { margin: 0 0 1rem; }

/* ---------- related posts + index cards ---------- */
.blog-related { padding-block: 0 clamp(2rem, 5vw, 3.5rem); }
.blog-related h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem); margin-bottom: 1.2rem; }

.bcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}
.bcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.25rem 1.3rem 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--ink-2);
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.4s var(--ease);
}
.bcard:hover,
.bcard:focus-visible { border-color: rgba(var(--accent-rgb), 0.55); transform: translateY(-3px); }
.bcard__tag {
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-ink);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.bcard strong { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.3; color: var(--paper); }
.bcard p { margin: 0; font-size: 0.93rem; line-height: 1.6; color: var(--muted); }
.bcard__foot { margin-top: auto; padding-top: 0.4rem; font-size: 0.82rem; color: var(--muted-2); }
@media (prefers-reduced-motion: reduce) { .bcard:hover, .bcard:focus-visible { transform: none; } }

/* index page */
.blog-index-group { scroll-margin-top: 6rem; }
.blog-index-group + .blog-index-group { margin-top: clamp(2.4rem, 5vw, 3.6rem); }
.blog-index-group > h2 { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.8rem); margin-bottom: 0.4rem; }
.blog-index-group > p { color: var(--muted); margin: 0 0 1.2rem; max-width: 62ch; }
.blog-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.6rem; }
.blog-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-2);
  text-decoration: none;
}
.blog-jump a:hover { border-color: var(--accent); color: var(--accent-ink); }

/* Gujarati pages: the site's fonts have no Gujarati glyphs, so a Gujarati font
   comes AFTER them — English labels keep the site font, and the browser falls
   back to the Gujarati font only for Gujarati characters. */
:lang(gu) .blog-body,
:lang(gu) .blog-hero,
:lang(gu) .blog-related {
  font-family: var(--font-body), "Noto Sans Gujarati", "Nirmala UI", "Shruti", sans-serif;
}
:lang(gu) .blog-hero h1,
:lang(gu) .blog-body h2,
:lang(gu) .blog-body h3,
.bcard:lang(gu) strong {
  font-family: var(--font-display), "Noto Sans Gujarati", "Nirmala UI", "Shruti", sans-serif;
}
:lang(gu) .blog-hero h1,
:lang(gu) .blog-body h2,
:lang(gu) .blog-body h3 { letter-spacing: 0; line-height: 1.35; }
:lang(gu) .blog-body p,
:lang(gu) .blog-body li { line-height: 1.9; }
