/* =====================================================================================================
   Article template (E08 · PostPage.astro). Linked after pages.css only by post pages (and by the blog index once it
   lists posts). Phone first; the desktop layer is the one media block at the end (small file: no second request).
   The inner-page family's tokens throughout; the Newsreader accent stays where the site uses it (em.acc in section
   titles), never in body copy. No motion of its own: cards use the site's .reveal; links only change colour.
   ===================================================================================================== */

/* ---------- hero: headlines run longer than a landing page's, so one step smaller and a wider measure ---------- */
.phero--post { padding-bottom: var(--space-7); }
.phero--post h1 { max-width: 24ch; font-size: var(--text-h2); line-height: 1.08; text-wrap: balance; }
.phero--post .phero__lede { max-width: 40em; }
.post-byline { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.post-byline__photo { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bg-sunken);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line); }
.post-byline__mark { display: grid; place-items: center; background: var(--bg-raised); }
.post-byline__mark svg { width: 30px; height: 30px; }
.post-byline p { display: grid; gap: 2px; font-size: var(--text-sm); line-height: 1.35; color: var(--fg-muted); }
.post-byline b { color: var(--fg); font-weight: var(--w-strong); }

/* ---------- the article ---------- */
.post { padding-top: var(--space-6); }
.post__grid { display: grid; gap: var(--space-9); }
.post__main { min-width: 0; }
.post__hero { margin: 0 0 var(--space-8); overflow: hidden; border-radius: var(--r-lg); background: var(--bg-sunken); box-shadow: inset 0 0 0 1px var(--line); }
.post__hero img { display: block; width: 100%; height: auto; }

.post__body { max-width: 68ch; font-size: var(--text-body); line-height: var(--lh-body); color: var(--fg); }
.post__body > * + * { margin-top: var(--space-5); }
.post__body > :first-child { font-size: var(--text-lead); line-height: var(--lh-lead); }
.post__body h2 { margin-top: var(--space-9); font-size: var(--text-h3); line-height: var(--lh-snug); letter-spacing: var(--track-heading); text-wrap: balance; scroll-margin-top: calc(var(--topbar-h, 64px) + var(--space-4)); }
.post__body h3 { margin-top: var(--space-8); font-size: var(--text-h4); line-height: var(--lh-snug); scroll-margin-top: calc(var(--topbar-h, 64px) + var(--space-4)); }
.post__body h2 + *, .post__body h3 + * { margin-top: var(--space-3); }
.post__body a { color: var(--fg-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--d-ui, .2s); }
.post__body a:hover { color: var(--fg); }
.post__body strong { font-weight: var(--w-strong); }
.post__body ul, .post__body ol { display: grid; gap: var(--space-2); padding-left: 1.25em; }
.post__body ul { list-style: disc; }
.post__body ol { list-style: decimal; }
.post__body li::marker { color: var(--fg-accent); }
.post__body blockquote { padding: var(--space-1) 0 var(--space-1) var(--space-5); border-left: 3px solid var(--brand);
  font-size: var(--text-lead); line-height: var(--lh-lead); font-weight: var(--w-strong); }
.post__body code { padding: .1em .35em; border-radius: 6px; background: var(--bg-sunken); font: .9em / 1 var(--font-mono); }
/* fenced code (E10: a robots.txt sample): the Markdown highlighter inlines a dark theme on <pre>; the site's own surface
   and text colour win, in both themes, and the inline-code chip does not repeat on every line */
.post__body pre { padding: var(--space-4) var(--space-5); border-radius: var(--r-md); background: var(--bg-sunken) !important;
  color: var(--fg) !important; box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; font: .875rem / 1.65 var(--font-mono); }
.post__body pre code { padding: 0; border-radius: 0; background: none; font: inherit; }
.post__body pre span { color: inherit !important; }
.post__body img { display: block; max-width: 100%; height: auto; border-radius: var(--r-md); }
.post__body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: var(--text-sm); }
.post__body th, .post__body td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.post__body th { font-weight: var(--w-strong); color: var(--fg-muted); }
/* phones: text tables wrap inside the column instead of hiding the last column off-screen (E10: 3-column comparisons) */
@media (max-width: 639px) { .post__body th, .post__body td { min-width: 6.5em; padding: 10px; white-space: normal; vertical-align: top; } }
.post__body hr { border: 0; border-top: 1px solid var(--line); margin-block: var(--space-9); }

/* sources: the fact-check trail, quiet */
.post__sources { max-width: 68ch; margin-top: var(--space-9); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.post__sources h2 { font: var(--w-strong) var(--text-xs) / 1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.post__sources ol { display: grid; gap: var(--space-2); margin-top: var(--space-3); padding-left: 1.25em; list-style: decimal; font-size: var(--text-sm); color: var(--fg-muted); }
.post__sources a { color: var(--fg); text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: 3px; }
.post__sources span { white-space: nowrap; }

/* beside the article (desktop only): the outline + a quiet game plan card */
.post__aside { display: none; }
.post-toc__h { font: var(--w-strong) var(--text-xs) / 1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--fg-muted); }
.post-toc ol { display: grid; gap: 2px; margin-top: var(--space-3); }
.post-toc a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); font-size: var(--text-sm); line-height: 1.35; color: var(--fg-muted); transition: color var(--d-ui, .2s), border-color var(--d-ui, .2s); }
.post-toc a:hover { color: var(--fg); border-color: var(--brand); }
.post-cta { display: grid; justify-items: start; gap: var(--space-4); margin-top: var(--space-8); padding: var(--space-5); border-radius: var(--r-lg);
  background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); font-size: var(--text-sm); color: var(--fg-muted); }
.post-cta b { display: block; margin-bottom: 2px; color: var(--fg); font-weight: var(--w-strong); }

/* cards fed by posts (index + read next): the hero photo and the author's face */
.blog-card__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.blog-card__face { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.post-related { margin-bottom: var(--space-9); }

@media (min-width: 1024px) {
  .post__grid { grid-template-columns: minmax(0, 68ch) minmax(14rem, 17rem); justify-content: space-between; gap: var(--space-10); }
  .post__aside { display: block; position: sticky; top: calc(var(--topbar-h, 64px) + var(--space-9)); align-self: start; }
}
