/* Long-form reading typography for /insight/<slug>/ article pages.
 *
 * A NEW file rather than an edit to _astro/advisory.BztH4tH_.css: that filename is
 * content-addressed, so editing it in place while keeping the hash would leave
 * cached clients on stale bytes.
 *
 * Uses only the existing design tokens, plus one addition:
 *
 *   --link-prose  #4fa89f  6.94:1 on --bg
 *
 * The brand accent --primary-bright #2a6b65 computes to 3.17:1 against --bg #0a0c0c,
 * which FAILS WCAG AA (4.5:1) for text. Using it for in-body links — the obvious
 * move — would be an accessibility failure on every article. It stays for decorative
 * use (list markers, blockquote rule) where the text-contrast rule does not apply.
 * --ink-dim is 7.30:1 and passes AAA, so the site's established voice carries into
 * long-form body copy unchanged.
 */

:root {
  --link-prose: #4fa89f;
  --measure: 68ch;
}

/* ---------- article header ---------- */

.post-header {
  padding: calc(var(--nav-h) + 2.5rem) var(--gutter) var(--space-lg);
  max-width: var(--maxw-narrow);
  margin-inline: auto;
}

.post-header .eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--primary-bright);
  margin-bottom: var(--space-sm);
}

.post-header h1 {
  font-family: var(--font-serif);
  font-weight: var(--weight-head);
  font-size: var(--fs-h1);
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: var(--space-md);
}

.post-header .deck {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 60ch;
  margin-bottom: var(--space-md);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  letter-spacing: .08em;
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: baseline;
}

.post-meta .sep { color: var(--ink-faint); }

.post-origin {
  margin-top: var(--space-sm);
  font-size: var(--fs-body-sm);
  color: var(--ink-mute);
}

.post-origin a { color: var(--link-prose); }

.post-asof {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-left: 2px solid var(--primary-bright);
  background: var(--primary-05);
  font-size: var(--fs-body-sm);
  color: var(--ink-dim);
}

/* ---------- prose body ---------- */

/* The container matches the header's width so the body aligns flush-left with the
   h1; the reading measure is applied to the text elements inside it rather than to
   the container, so figures can still use the full column. */
.insight-body {
  max-width: var(--maxw-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
  color: var(--ink-dim);
  font-family: var(--font-sans);
  font-weight: var(--weight-body);
  font-size: var(--fs-body);
  line-height: 1.75;
}

.insight-body > p,
.insight-body > ul,
.insight-body > ol,
.insight-body > blockquote,
.insight-body > h2,
.insight-body > h3 { max-width: var(--measure); }

.insight-body > * + * { margin-top: var(--space-md); }

.insight-body > p:first-of-type {
  font-size: var(--fs-lead);
  line-height: 1.7;
  color: var(--ink);
}

.insight-body h2 {
  font-family: var(--font-serif);
  font-weight: var(--weight-head);
  font-size: var(--fs-h3);
  line-height: 1.15;
  color: var(--ink);
  margin-top: var(--space-xl);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.insight-body h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--ink);
  margin-top: var(--space-lg);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.insight-body a {
  color: var(--link-prose);
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
  transition: color .25s ease;
}

.insight-body a:hover { color: var(--ink); }

.insight-body strong { color: var(--ink); font-weight: 500; }
.insight-body em { font-style: italic; }

.insight-body ul,
.insight-body ol { padding-left: 1.35em; }
.insight-body li + li { margin-top: var(--space-2xs); }
.insight-body li::marker { color: var(--primary-bright); }

.insight-body blockquote {
  border-left: 2px solid var(--primary-bright);
  padding-left: var(--space-md);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}

.insight-body hr {
  border: 0;
  border-top: 1px solid var(--ink-hairline);
  margin-block: var(--space-xl);
}

.insight-body code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--primary-05);
  padding: .1em .35em;
}

/* Figures use the full container width — wider than the 68ch text measure,
   because a data chart needs the room. */
.insight-figure {
  margin-block: var(--space-xl);
  max-width: 100%;
}

.insight-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--ink-hairline);
}

.insight-figure figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  line-height: 1.5;
  color: var(--ink-mute);
  margin-top: var(--space-xs);
}

/* ---------- tail: firm overview + disclaimer, outside <article> ---------- */

.post-tail {
  max-width: var(--maxw-narrow);
  margin: var(--space-2xl) auto 0;
  padding: var(--space-lg) var(--gutter) 0;
  border-top: 1px solid var(--ink-hairline);
}

.post-tail h2 {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 400;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--primary-bright);
  margin-bottom: var(--space-sm);
}

.post-tail p {
  font-size: var(--fs-body-sm);
  line-height: 1.7;
  color: var(--ink-mute);
}

.post-tail p + p { margin-top: var(--space-sm); }
.post-tail + .post-tail { margin-top: var(--space-lg); }

/* ---------- prev / next ---------- */

.post-pager {
  max-width: var(--maxw-narrow);
  margin: var(--space-2xl) auto 0;
  padding: var(--space-lg) var(--gutter);
  border-top: 1px solid var(--ink-hairline);
  display: grid;
  gap: var(--space-md);
}

.post-pager a {
  display: block;
  padding: var(--space-md) 0;
  text-decoration: none;
  transition: padding-left .4s var(--ease-out);
}

.post-pager a:hover { padding-left: 12px; }

.post-pager .dir {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: block;
  margin-bottom: 6px;
}

.post-pager .t {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--ink);
  line-height: 1.25;
}

.post-pager a:hover .t { color: var(--primary-bright); }

@media (min-width: 760px) {
  .post-pager { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
  .post-pager .next { text-align: right; }
  .post-pager .next a:hover { padding-left: 0; padding-right: 12px; }
}

/* ---------- index page deks ---------- */

.article-item .dek {
  display: block;                 /* it is a <span> inside .title — must break the line */
  font-family: var(--font-sans);
  font-weight: var(--weight-body);
  font-size: var(--fs-body-sm);
  line-height: 1.6;
  color: var(--ink-mute);
  margin-top: 6px;
  max-width: 60ch;
}

/* ---------- a11y + print ---------- */

.insight-body a:focus-visible,
.post-pager a:focus-visible {
  outline: 2px solid var(--link-prose);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .insight-body a,
  .post-pager a { transition: none; }
}

@media print {
  nav.main, .nav-overlay, .post-pager, .cursor, footer.main { display: none !important; }
  .insight-body, .post-header, .post-tail { max-width: none; color: #000; }
  .insight-body h2, .insight-body h3, .post-header h1 { color: #000; }
  .insight-body a { color: #000; text-decoration: underline; }
  .insight-body a::after { content: " (" attr(href) ")"; font-size: .8em; }
}
