/* Blog: /blog index and /blog/<slug> posts (generated by scripts/gen_blog.js).
   Builds on site.css tokens (--text, --accent, --rule, --wide, --gutter…),
   so both themes work without extra rules. */

/* ---------- post header ---------- */
.post-hero{ padding-bottom:clamp(1.5rem,3vw,2.5rem); }
.post-hero h1{
  max-width:22ch;
  font-size:clamp(2.1rem,5vw,4.2rem);
  line-height:1.02;
}
.post-crumbs{
  margin-bottom:1.25rem;
  font-family:var(--font-mono);
  font-size:.74rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--text-muted);
}
.post-crumbs a{ color:inherit; text-decoration:none; }
.post-crumbs a:hover{ color:var(--accent); }
.post-hero .post-lead{ max-width:62ch; margin:1.5rem 0 1.25rem; }
.post-hero .post-meta{
  display:flex; flex-wrap:wrap; gap:.25rem .5rem;
  max-width:none;
  margin:0;
  font-size:.92rem;
  line-height:1.5;
  color:var(--text-muted);
}

/* ---------- layout: sticky contents + reading column ---------- */
.post-layout{
  display:grid;
  grid-template-columns:minmax(0,15rem) minmax(0,46rem);
  gap:clamp(2rem,5vw,5rem);
  max-width:var(--wide);
  margin:0 auto;
  padding:0 var(--gutter) clamp(3rem,6vw,5rem);
}
.post-toc{
  position:sticky;
  top:calc(var(--header-offset) + 1rem);
  align-self:start;
  padding-top:.4rem;
  border-top:1px solid var(--rule);
}
.post-toc__label{
  margin:.9rem 0 .6rem;
  font-family:var(--font-mono);
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--text-muted);
}
.post-toc ol{ margin:0; padding:0; list-style:none; counter-reset:toc; }
.post-toc li{ counter-increment:toc; margin:0; }
.post-toc a{
  display:flex; gap:.6rem;
  padding:.35rem 0;
  font-size:.9rem;
  line-height:1.35;
  color:var(--text-muted);
  text-decoration:none;
}
.post-toc a::before{ content:counter(toc, decimal-leading-zero); font-family:var(--font-mono); font-size:.72rem; padding-top:.15rem; color:var(--accent); }
.post-toc a:hover{ color:var(--text); }

@media (max-width:900px){
  .post-layout{ grid-template-columns:minmax(0,1fr); }
  .post-toc{ position:static; }
}

/* ---------- article typography ---------- */
.post-body{ min-width:0; font-size:1.075rem; line-height:1.75; color:var(--text); }
.post-body > :first-child{ margin-top:0; }
.post-body p, .post-body ul, .post-body ol{ margin:0 0 1.25rem; }
.post-body ul, .post-body ol{ padding-left:1.35rem; }
.post-body li{ margin:.35rem 0; }
.post-body li::marker{ color:var(--accent); }
.post-body h2{
  margin:3rem 0 1rem;
  font-family:var(--font-heading);
  font-size:clamp(1.55rem,2.6vw,2.1rem);
  line-height:1.15;
  letter-spacing:-.03em;
  scroll-margin-top:calc(var(--header-offset) + 1rem);
}
.post-body h3{
  margin:2rem 0 .75rem;
  font-family:var(--font-heading);
  font-size:1.25rem;
  letter-spacing:-.02em;
  scroll-margin-top:calc(var(--header-offset) + 1rem);
}
.post-body a{ color:var(--accent); text-underline-offset:.2em; }
.post-body strong, .post-body .post-b{ color:var(--text); font-weight:700; }
.post-body code{
  padding:.1em .35em;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--bg-soft);
  font-family:var(--font-mono);
  font-size:.88em;
  overflow-wrap:anywhere;
}
.post-code{
  margin:0 0 1.5rem;
  padding:1.1rem 1.25rem;
  overflow-x:auto;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--bg-soft);
  font-size:.88rem;
  line-height:1.6;
}
.post-code code{ padding:0; border:0; background:none; font-size:inherit; overflow-wrap:normal; white-space:pre; }
.post-note{
  margin:0 0 1.5rem;
  padding:1rem 1.25rem;
  border-left:3px solid var(--accent);
  background:var(--accent-soft);
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;
}
.post-note p{ margin:0; }
.post-table{ margin:0 0 1.5rem; overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); }
.post-table table{ width:100%; min-width:34rem; border-collapse:collapse; font-size:.95rem; line-height:1.5; }
.post-table th, .post-table td{ padding:.7rem .9rem; text-align:left; vertical-align:top; border-bottom:1px solid var(--border); }
.post-table th{ background:var(--bg-soft); font-weight:600; }
.post-table tr:last-child td{ border-bottom:0; }

/* ---------- product box, FAQ, sources ---------- */
.post-product{
  margin:3rem 0;
  padding:clamp(1.25rem,3vw,2rem);
  border:1px solid var(--border-strong);
  border-radius:var(--radius-lg);
  background:var(--panel);
}
.post-product__label{
  margin:0 0 .5rem;
  font-family:var(--font-mono);
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--accent);
}
.post-product__text{ margin:0 0 1.25rem; }
/* Same as the site's buttons: dark text on orange in both themes (white failed contrast) */
.post-product .btn-primary{ text-decoration:none; color:#0a0a0c; }
.post-body .faq details > p, .post-body .faq details > ul, .post-body .faq details > ol{ margin:0 0 1.25rem; color:var(--text-muted); }
.post-sources__title{ font-size:1.25rem !important; }
.post-sources{ font-size:.92rem; color:var(--text-muted); }
.post-sources a{ overflow-wrap:anywhere; }

/* ---------- cards (index + keep reading) ---------- */
.post-related{ padding-bottom:clamp(3rem,6vw,5rem); }
.post-cards{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr));
  gap:1.25rem;
  margin:0;
  padding:0;
  list-style:none;
}
.post-cards--index{ padding-bottom:1rem; }
.post-card a{
  display:flex; flex-direction:column; gap:.6rem;
  height:100%;
  padding:1.5rem;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:var(--panel);
  color:var(--text);
  text-decoration:none;
  transition:border-color var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.post-card a:hover{ border-color:var(--accent); transform:translateY(-2px); }
.post-card a:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }
.post-card__cat{ font-family:var(--font-mono); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); }
.post-card__title{ font-family:var(--font-heading); font-size:1.3rem; font-weight:600; line-height:1.2; letter-spacing:-.02em; }
.post-card__desc{ color:var(--text-muted); font-size:.95rem; line-height:1.55; }
.post-card__meta{ margin-top:auto; padding-top:.5rem; font-size:.82rem; color:var(--text-muted); }
.post-feed{ margin:1.5rem 0 clamp(3rem,6vw,5rem); font-size:.9rem; }
.post-feed a{ color:var(--text-muted); }

@media (prefers-reduced-motion:reduce){
  .post-card a{ transition:none; }
  .post-card a:hover{ transform:none; }
}
