/* ===========================================================================
   _blog.css — Blog index + long-form article styles.
   Tokens only (see _styles.css :root). No hardcoded hex.
   Loaded after _styles.css on /blog and /blog/* pages.
   =========================================================================== */

/* Scroll progress bar (always-on shell, per BUILD-GUIDELINES §7) */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--primary); z-index: 200;
  transition: width 120ms linear;
}

/* Reveal-on-scroll. Visible by default; JS removes the offset when in view.
   Honour reduced motion by skipping the transform entirely. */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 480ms cubic-bezier(0.4,0,0.2,1), transform 480ms cubic-bezier(0.4,0,0.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-visible { opacity: 1; transform: none; transition: none; }
  .scroll-progress { display: none; }
}

/* Narrow reading column for long-form */
.blog-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Blog hero (dark) ---- */
.blog-hero { background: var(--surface-dark); color: var(--on-dark); padding: 112px 0 72px; }
.blog-hero .t-caption-up { color: var(--on-dark-soft); margin-bottom: 16px; }
.blog-hero h1 { color: var(--on-dark); max-width: 16ch; }
.blog-hero .blog-lede { color: var(--on-dark-soft); font-size: 19px; line-height: 1.6; max-width: 56ch; margin: 20px 0 0; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; font-family: var(--sans); font-size: 14px; color: var(--on-dark-soft); }
.blog-meta .dot { width: 4px; height: 4px; border-radius: var(--r-pill); background: var(--on-dark-soft); opacity: .5; }

/* ---- Article body ---- */
.article-body { padding: 72px 0 40px; }
.article-body p,
.article-body ul,
.article-body ol { font-family: var(--sans); font-size: 18px; line-height: 1.7; color: var(--body); margin: 0 0 22px; }
.article-body h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -0.4px; color: var(--ink); margin: 48px 0 16px; }
.article-body h3 { font-family: var(--sans); font-weight: 600; font-size: 20px; line-height: 1.3; color: var(--ink); margin: 32px 0 12px; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin: 0 0 10px; }
.article-body li::marker { color: var(--primary); }
.article-body a { color: var(--primary-active); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: var(--primary); }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body blockquote {
  margin: 32px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--primary);
  font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.5; color: var(--body-strong, var(--ink));
}
.article-lead { font-size: 21px !important; line-height: 1.6 !important; color: var(--ink) !important; }

/* Inline article figure */
.article-figure { margin: 36px 0; }
.article-figure img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border: 1px solid var(--hairline); border-radius: var(--r-xl); background: var(--surface-soft);
}
.article-figure figcaption { margin-top: 10px; font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--muted); }

/* Key takeaway / callout box */
.callout {
  background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); padding: 24px 28px; margin: 32px 0;
}
.callout .t-caption-up { color: var(--primary); margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }

/* FAQ block on articles */
.article-faq { border-top: 1px solid var(--hairline); margin-top: 48px; padding-top: 8px; }
.article-faq details { border-bottom: 1px solid var(--hairline); padding: 18px 0; }
.article-faq summary { font-family: var(--sans); font-weight: 600; font-size: 17px; color: var(--ink); cursor: pointer; list-style: none; }
.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary::after { content: '+'; float: right; color: var(--muted); font-weight: 400; }
.article-faq details[open] summary::after { content: '–'; }
.article-faq p { margin: 12px 0 0; }

/* ---- Index grid ---- */
.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; padding: 64px 0; }
.blog-card {
  display: flex; flex-direction: column; background: var(--canvas);
  border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: 28px;
  text-decoration: none; color: inherit; transition: border-color 200ms, transform 200ms;
}
.blog-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.blog-card .tag { align-self: flex-start; margin-bottom: 16px; }
.blog-card h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; letter-spacing: -0.4px; color: var(--ink); margin: 0 0 12px; }
.blog-card p { font-family: var(--sans); font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 20px; }
.blog-card .read { margin-top: auto; font-family: var(--sans); font-weight: 500; font-size: 14px; color: var(--primary-active); }

/* ---- CTA + related ---- */
.blog-cta { background: var(--surface-soft); }
.blog-cta-panel { text-align: center; padding: 56px 0; }
.blog-cta-panel p { color: var(--muted); margin: 12px 0 28px; font-size: 17px; }
.blog-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 720px) {
  .blog-grid { grid-template-columns: 1fr; padding: 40px 0; }
  .blog-hero { padding: 88px 0 56px; }
  .article-body { padding: 48px 0 32px; }
  .article-body p, .article-body ul, .article-body ol { font-size: 17px; }
}
