/**
 * Article typography.
 *
 * The body arrives as plain semantic HTML (h2, p, ul, aside) with no classes,
 * because it is generated once at export and stored that way. Tailwind's
 * preflight resets heading sizes and margins to nothing, so without these rules
 * an article renders as one undifferentiated block of text. This file is what
 * gives the body its hierarchy.
 *
 * Values follow the editorial design: Fraunces for display, IBM Plex Sans for
 * furniture, a serif reading column at a comfortable measure.
 */

.article-body {
  font-family: var(--font-serif);
  color: var(--foreground);
  font-size: 1.1875rem;
  line-height: 1.72;
}

/* ── paragraphs ─────────────────────────────────────────────────────────── */

.article-body p {
  margin: 0 0 1.35em;
  max-width: 68ch;
  text-wrap: pretty;
}

/* The opening paragraph carries the reader in, so it is set a step larger. */
.article-body > p:first-of-type {
  font-size: 1.3125rem;
  line-height: 1.62;
}

.article-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--primary);
}
.article-body a:hover { color: var(--primary); }

.article-body em { font-style: italic; }
.article-body strong { font-weight: 600; }

/* ── headings ───────────────────────────────────────────────────────────── */

.article-body h2 {
  font-family: var(--font-display, var(--font-serif));
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 2.4em 0 0.7em;
  padding-top: 0.7em;
  border-top: 1px solid var(--rule);
  max-width: 34ch;
}

.article-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.article-body h3 {
  font-family: var(--font-display, var(--font-serif));
  font-weight: 600;
  font-size: clamp(1.2rem, 1.9vw, 1.4rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 1.9em 0 0.5em;
  max-width: 40ch;
}

/* ── lists ──────────────────────────────────────────────────────────────── */

.article-body ul,
.article-body ol {
  margin: 0 0 1.6em;
  max-width: 66ch;
}

.article-body ul {
  list-style: none;
  padding-left: 0;
}

.article-body ul > li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.75em;
}

/* A small open square rather than a dot: it reads as editorial furniture and
 * sits better against the serif than a bullet glyph does. */
.article-body ul > li::before {
  content: "";
  position: absolute;
  left: 0.1em;
  top: 0.62em;
  width: 0.42em;
  height: 0.42em;
  border: 1.5px solid var(--primary);
  background: transparent;
}

.article-body ol {
  list-style: none;
  counter-reset: nb-item;
  padding-left: 0;
}
.article-body ol > li {
  position: relative;
  counter-increment: nb-item;
  padding-left: 2.4em;
  margin-bottom: 0.75em;
}
.article-body ol > li::before {
  content: counter(nb-item, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15em;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

/* ── key takeaways ──────────────────────────────────────────────────────────
 *
 * Numbered rather than bulleted: these are the three to five things the reader
 * should leave with, and numbering says "this is a finite list" in a way a
 * bullet does not. */

.article-body .nb-takeaways ul,
.nb-takeaways ul {
  list-style: none;
  counter-reset: nb-takeaway;
  margin: 0;
  padding: 0;
}

.article-body .nb-takeaways ul > li,
.nb-takeaways li {
  position: relative;
  counter-increment: nb-takeaway;
  padding-left: 3rem;
  padding-bottom: 0.9em;
  margin-bottom: 0.9em;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 62ch;
}

.article-body .nb-takeaways ul > li:last-child,
.nb-takeaways li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.article-body .nb-takeaways ul > li::before,
.nb-takeaways li::before {
  content: counter(nb-takeaway, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  line-height: 1.2;
}

/* ── pull quote ─────────────────────────────────────────────────────────── */

.article-body .pullquote {
  margin: 2.2em 0;
  padding: 0;
  border-top: 3px solid var(--foreground);
  border-bottom: 1px solid var(--rule);
  padding-block: 1.2em;
  max-width: 60ch;
}
.article-body .pullquote blockquote {
  font-family: var(--font-display, var(--font-serif));
  font-weight: 500;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.24;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.article-body .pullquote figcaption {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-top: 0.9em;
}

/* ── callouts: why it matters, background, what happens next ────────────── */

.article-body .callout {
  margin: 2em 0;
  padding: 1.1em 0 1.1em 1.4em;
  border-left: 3px solid var(--primary);
  max-width: 64ch;
  background: color-mix(in oklab, var(--foreground) 2.5%, transparent);
}
.article-body .callout h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.55em;
}
.article-body .callout p { margin-bottom: 0.7em; font-size: 1.0625rem; }
.article-body .callout p:last-child { margin-bottom: 0; }

/* ── fact box: reads as a table, because that is what it is ────────────── */

.article-body .factbox {
  margin: 2.2em 0;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--foreground);
  max-width: 64ch;
}
.article-body .factbox h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0;
  padding: 0.9em 1.2em;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--foreground) 3%, transparent);
}
.article-body .factbox dl {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
  margin: 0;
}
/* Each label/value pair is a row, separated like table rows. */
.article-body .factbox dt,
.article-body .factbox dd {
  padding: 0.75em 1.2em;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.article-body .factbox dt {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  border-right: 1px solid var(--border);
}
.article-body .factbox dd { font-size: 1rem; }
.article-body .factbox dl > dt:nth-last-of-type(1),
.article-body .factbox dl > dd:nth-last-of-type(1) { border-bottom: 0; }

@media (max-width: 640px) {
  .article-body .factbox dl { grid-template-columns: minmax(0, 1fr); }
  .article-body .factbox dt {
    border-right: 0;
    border-bottom: 0;
    padding-bottom: 0.15em;
  }
}

/* ── timeline ───────────────────────────────────────────────────────────── */

.article-body .timeline {
  margin: 2.2em 0;
  padding-top: 1em;
  border-top: 1px solid var(--rule);
  max-width: 64ch;
}
.article-body .timeline h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 0.9em;
}
.article-body .timeline ol { list-style: none; padding: 0; }
.article-body .timeline li {
  display: grid;
  grid-template-columns: minmax(6rem, 8rem) minmax(0, 1fr);
  gap: 1.2em;
  padding: 0.55em 0;
  border-bottom: 1px solid var(--border);
}
.article-body .timeline li span {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--primary);
}

/* ── the standing pages use the same body class ─────────────────────────── */

.article-body dl:not(.factbox dl) { margin: 0 0 1.5em; }
.article-body dt { font-weight: 600; }
.article-body dd { margin: 0 0 0.8em; }

/* ── house image treatment: duotone ─────────────────────────────────────────
 *
 * Lead images come from many different publishers, so they arrive in wildly
 * different colour palettes and make the site look like a scrapbook. Every
 * image is therefore desaturated and multiplied over a single house tint, which
 * makes a page of mixed sources read as one publication.
 *
 * `multiply` over a light tint keeps blacks black and pushes the highlights
 * toward the tint, which is the classic newsprint duotone. Change --nb-tint to
 * restyle every image on the site at once.
 */

:root {
  --nb-tint: #f2c230;          /* house yellow */
  --nb-tint-strength: 1;        /* 0 = untouched photo, 1 = full duotone */
}

.nb-img {
  display: block;
  position: relative;
  background: var(--nb-tint);
  overflow: hidden;
}

.nb-img > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Contrast lift stops the mid-greys turning to mud once multiplied. */
  filter: grayscale(1) contrast(1.12) brightness(1.06);
  mix-blend-mode: multiply;
  opacity: var(--nb-tint-strength);
}

/* A faint warm wash over the top unifies the darker frames as well. */
.nb-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--nb-tint);
  mix-blend-mode: screen;
  opacity: 0.14;
  pointer-events: none;
}

/* Hovering a card lets a little of the real photograph back in, which keeps the
   treatment from feeling like a broken image. */
.nb-img:hover > img { filter: grayscale(0.55) contrast(1.05); }
.nb-img:hover::after { opacity: 0.06; }

@media (prefers-reduced-motion: no-preference) {
  .nb-img > img,
  .nb-img::after { transition: filter .35s ease, opacity .35s ease; }
}
