/* The Cleartext Courier — stylesheet
   Three families: IM Fell English (nameplate only), Source Serif 4 (headlines + text),
   IBM Plex Mono (labels only). One modular scale: 16px × 1.2. */

@font-face { font-family: "IM Fell English"; src: url("/fonts/IMFellEnglish.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/SourceSerif4.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/SourceSerif4-Italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* scale: 16 × 1.2^n */
  --s-2: 0.694rem;  /* 11.1 */
  --s-1: 0.833rem;  /* 13.3 */
  --s0: 1rem;       /* 16   */
  --s1: 1.2rem;     /* 19.2 */
  --s2: 1.44rem;    /* 23.0 */
  --s3: 1.728rem;   /* 27.6 */
  --s4: 2.074rem;   /* 33.2 */
  --s5: 2.488rem;   /* 39.8 */
  --s6: 2.986rem;   /* 47.8 */
  --s8: 4.3rem;     /* 68.8  nameplate */

  --paper: #f7f4ec; --ink: #16140f; --ink-2: #3d3a33; --muted: #6f6a5e;
  --rule: #1d1b16; --hair: #cfc8b8; --accent: #a3201b; --term: #1f6f43;

  --nameplate: "IM Fell English", Georgia, serif;
  --np-weight: 400; --np-case: none; --np-track: 0; --np-size: var(--s8);
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "DejaVu Sans Mono", monospace;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: var(--s0); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
a:hover .hl { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, svg { max-width: 100%; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Labels: mono, uppercase, tracked, two sizes only (--s-1, --s-2) */
.label, .kicker, .byline, .dateline-bar, .strip, .box h4, .meta, figcaption .credit, .prose .dateline {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Top strip ─────────────────────────────── */
.strip { font-size: var(--s-2); color: var(--muted); border-bottom: 1px solid var(--hair); }
.strip .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 7px; padding-bottom: 7px; }
.strip .term { color: var(--term); }

/* ── Nameplate ─────────────────────────────── */
.nameplate { font-family: var(--nameplate); font-weight: var(--np-weight); letter-spacing: var(--np-track); line-height: 1; margin: 0; }
.masthead { text-align: center; padding: 26px 0 12px; }
.masthead .nameplate { font-size: var(--np-size); }
.masthead .motto { font-family: var(--text); font-style: italic; font-size: var(--s0); color: var(--ink-2); margin: 10px 0 0; }
.masthead .motto::before, .masthead .motto::after { content: "—"; color: var(--hair); margin: 0 10px; }

.dateline-bar { border-bottom: 1px solid var(--hair); font-size: var(--s-2); color: var(--ink-2); }
.masthead-sm { padding: 18px 0 10px; }
.masthead-sm .nameplate { font-size: var(--s6); }
.dateline-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap; }

/* Sticky head: compact nameplate (phones) + section nav (all widths) */
.head { position: sticky; top: 0; z-index: 10; background: var(--paper); border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule); }
.head .compact { display: none; }
.sections ul { list-style: none; margin: 0; padding: 10px 0; display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; font-family: var(--text); font-weight: 600; font-size: var(--s-1); letter-spacing: 0.06em; text-transform: uppercase; }
.sections li a:hover { color: var(--accent); }
.sections .more { display: none; }

/* ── Front page grid ───────────────────────── */
.front { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr) minmax(0, 0.95fr); padding: 26px 0 10px; }
.front > * { padding: 0 22px; }
.front > *:first-child { padding-left: 0; }
.front > *:last-child { padding-right: 0; }
.front > * + * { border-left: 1px solid var(--hair); }

.kicker { font-size: var(--s-2); font-weight: 600; color: var(--accent); margin: 0 0 8px; }
.hl { font-family: var(--text); font-weight: 700; font-variation-settings: "opsz" 60; letter-spacing: -0.012em; line-height: 1.1; margin: 0; }
.lead .hl { font-size: var(--s5); line-height: 1.05; }
.dek { font-style: italic; font-size: var(--s1); color: var(--ink-2); margin: 12px 0 0; line-height: 1.4; }
.byline { font-size: var(--s-2); color: var(--muted); margin: 12px 0 0; }
.byline strong { color: var(--ink); font-weight: 600; }

figure { margin: 18px 0 0; }
.photo { background: #e6e0d2; border: 1px solid var(--hair); aspect-ratio: 16 / 9; display: grid; place-items: center; }
figcaption { font-size: var(--s-1); color: var(--muted); margin-top: 6px; }
figcaption .credit { font-size: var(--s-2); }
.lead p.body { margin: 16px 0 0; font-size: var(--s1); line-height: 1.5; }

.story { padding: 0 0 18px; margin: 0 0 18px; border-bottom: 1px solid var(--hair); }
.story:last-child { border-bottom: 0; margin-bottom: 0; }
.story .hl { font-size: var(--s2); }
.story.small .hl { font-size: var(--s1); }
.story p:not(.kicker):not(.byline) { margin: 8px 0 0; font-size: var(--s0); color: var(--ink-2); }

/* ── Rail ──────────────────────────────────── */
.box { border-top: 3px solid var(--rule); padding-top: 10px; margin-bottom: 26px; }
.box h4 { font-size: var(--s-2); font-weight: 600; margin: 0 0 10px; }
.threat .level { font-family: var(--text); font-weight: 800; font-size: var(--s4); color: var(--accent); line-height: 1.1; letter-spacing: 0.02em; }
.threat .note { color: var(--muted); font-style: italic; font-size: var(--s-1); margin-top: 4px; line-height: 1.45; }
ol.most { margin: 0; padding: 0; list-style: none; counter-reset: m; }
ol.most li { counter-increment: m; display: grid; grid-template-columns: 24px 1fr; gap: 6px; font-weight: 700; font-size: var(--s0); line-height: 1.3; padding: 8px 0; border-bottom: 1px solid var(--hair); }
ol.most li::before { content: counter(m); font-weight: 800; color: var(--accent); }
.ticker { font-size: var(--s-1); }
.ticker div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dotted var(--hair); }
.up { color: var(--term); } .down { color: var(--accent); }
.correction { font-size: var(--s0); font-style: italic; color: var(--ink-2); }

/* ── Lower band ────────────────────────────── */
.band { border-top: 3px double var(--rule); padding: 20px 0 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.band > * { padding: 0 18px; }
.band > *:first-child { padding-left: 0; } .band > *:last-child { padding-right: 0; }
.band > * + * { border-left: 1px solid var(--hair); }
.band .hl { font-size: var(--s1); }

/* ── Article page ──────────────────────────── */
.article { max-width: 700px; margin: 0 auto; padding: 34px 24px 10px; }
.article .hl { font-size: var(--s6); line-height: 1.05; }
.article .dek { font-size: var(--s2); }
.article .meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--hair); padding: 8px 0; margin-top: 18px; font-size: var(--s-2); color: var(--muted); }
.article .meta strong { color: var(--ink); }
.prose { font-size: var(--s1); line-height: 1.6; }
.prose p { margin: 0 0 1.05em; }
.prose .dateline { font-weight: 600; font-size: var(--s-1); }
.pull { font-style: italic; font-size: var(--s3); line-height: 1.3; border-top: 3px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 14px 0; margin: 26px 0; }
.related { max-width: 700px; margin: 0 auto; padding: 0 24px; }
.related h4 { border-top: 3px solid var(--rule); padding-top: 10px; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { font-weight: 700; font-size: var(--s1); line-height: 1.3; padding: 10px 0; border-bottom: 1px solid var(--hair); }

/* ── Footer ────────────────────────────────── */
footer { border-top: 3px double var(--rule); margin-top: 30px; padding: 22px 0 40px; font-size: var(--s-1); color: var(--ink-2); }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
footer .nameplate { font-size: var(--s3); }
footer .disclaimer { font-style: italic; margin: 8px 0 0; }
footer .meta { font-size: var(--s-2); text-align: right; color: var(--muted); }
footer .sections-index { font-family: var(--text); font-weight: 600; font-size: var(--s-1); letter-spacing: 0.06em; text-transform: uppercase; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ── Tablet ────────────────────────────────── */
@media (max-width: 980px) {
  .front { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .front .rail { grid-column: 1 / -1; border-left: 0; padding: 22px 0 0; border-top: 3px double var(--rule); margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  .band { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .band > *:nth-child(3) { border-left: 0; padding-left: 0; }
}

/* ── Phone: big masthead gives way to a compact sticky nameplate ── */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .strip { display: none; }
  .dateline-bar .hide-sm { display: none; }
  .masthead { display: none; }
  .head .compact { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 10px 16px 6px; border-bottom: 1px solid var(--hair); }
  .head .compact .nameplate { font-size: var(--s4); }
  .head { border-top: 0; }
  .sections ul { justify-content: center; flex-wrap: nowrap; gap: 22px; padding: 9px 16px; }
  .sections .sm-hide { display: none; }
  .sections .more { display: list-item; color: var(--accent); }
  .sections li { white-space: nowrap; }
  .dateline-bar { border-top: 0; }
  .dateline-bar .wrap { justify-content: center; }
  .front { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .front > * { padding: 0 !important; border-left: 0 !important; }
  .front > * + * { border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 18px !important; }
  .front .rail { grid-template-columns: minmax(0, 1fr); border-top: 3px double var(--rule); }
  .lead .hl { font-size: var(--s3); }
  .lead p.body, .prose { font-size: var(--s0); }
  .band { grid-template-columns: minmax(0, 1fr); }
  .band > * { padding: 0 !important; border-left: 0 !important; }
  .band > * + * { border-top: 1px solid var(--hair); padding-top: 14px !important; }
  footer .wrap { grid-template-columns: minmax(0, 1fr); }
  footer .meta { text-align: left; }
  .article { padding-top: 20px; }
  .article .hl { font-size: var(--s4); }
  .article .dek { font-size: var(--s1); }
  .pull { font-size: var(--s2); }
}

/* ── Section index + static pages (build) ──── */
.section-head { max-width: 760px; margin: 0 auto; padding: 30px 24px 6px; }
.section-head .hl { font-size: var(--s5); }
.section-head .dek { margin-top: 8px; }
.listing { max-width: 760px; margin: 0 auto; padding: 0 24px; list-style: none; }
.listing li { padding: 18px 0; border-bottom: 1px solid var(--hair); }
.listing .hl { font-size: var(--s2); }
.listing .dek { font-size: var(--s0); margin-top: 6px; }
.listing .empty { font-style: italic; color: var(--muted); }
.page .prose h2 { font-family: var(--text); font-weight: 700; font-variation-settings: "opsz" 60; font-size: var(--s2); margin: 1.6em 0 0.5em; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.05em; }
.lead .photo svg { width: 100%; height: auto; }
@media (max-width: 640px) {
  .section-head .hl { font-size: var(--s4); }
  .listing .hl { font-size: var(--s1); }
}
main > .correction { margin-top: 22px; }
.article .prose { margin-top: 22px; }
