/* ═══════════════════════════════════════════════════════════════════
   THE AI POST — design system

   The model is the modern broadsheet website: pure white, black type,
   thin neutral rules, serif headlines over grey sans summaries. No
   texture, no tint, no decoration. Hierarchy comes from type size and
   weight alone; structure comes from hairlines. Everything else is
   removed.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #ffffff;
  --ink:       #121212;
  --ink-2:     #363636;   /* summaries */
  --ink-3:     #727272;   /* labels, timestamps, credits */
  --rule:      #e2e2e2;   /* hairlines */
  --rule-mid:  #c7c7c7;
  --rule-hard: #121212;   /* the few heavy rules */
  --link:      #121212;

  --serif: "Newsreader", "Georgia", "Times New Roman", serif;
  --sans:  "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter:  20px;
  --measure: 1200px;
}

/* The masthead face. Self-hosted so it renders identically everywhere and
   needs no network round trip before the page has a nameplate. */
@font-face {
  font-family: "Old London";
  src: url("assets/fonts/oldlondon.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;   /* never flash a fallback nameplate */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

/* ── masthead ───────────────────────────────────────────────────── */

.masthead { text-align: center; padding: 42px 0 30px; border-bottom: 1px solid var(--rule-hard); }

.masthead__name {
  display: block;
  font-family: "Old London", var(--serif);
  font-weight: 400;
  /* Blackletter carries its weight in the strokes, so it can run large
     without shouting. Scales from phone to desktop. */
  font-size: clamp(58px, 11.5vw, 155px);
  line-height: .92;
  letter-spacing: .015em;
  color: var(--ink);
  /* Blackletter descenders run long; leave them room to clear the rule. */
  padding-bottom: .1em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── navigation ─────────────────────────────────────────────────── */

.nav {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: clamp(14px, 1.8vw, 28px); padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.nav a { color: var(--ink); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--rule-mid); }
.nav a[aria-current] { border-bottom-color: var(--ink); }

.topics {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 18px;
  padding: 9px 0 11px; border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 12px; color: var(--ink-3);
}
.topics a:hover { color: var(--ink); }

/* ── front page grid ────────────────────────────────────────────── */

.frontpage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 0 24px; padding: 28px 0 0;
}
/* Fewer stories, fewer columns. A single-column front page centres on a
   readable measure rather than stranding the copy in a third of the page. */
.frontpage--2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.frontpage--1 { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 auto; }
.frontpage--1 .story--lead .hed { font-size: clamp(32px, 4.4vw, 50px); }
.col + .col { border-left: 1px solid var(--rule); padding-left: 24px; }

/* ── story blocks ───────────────────────────────────────────────── */

.story { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
.story:last-child { border-bottom: 0; margin-bottom: 0; }

.kicker {
  display: block; font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 6px;
}

.hed {
  font-family: var(--serif); font-weight: 700; line-height: 1.12;
  letter-spacing: -.01em; margin: 0 0 8px; text-wrap: balance;
  font-variation-settings: "opsz" 28;
}
.hed a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.story--lead   .hed { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -.015em; font-variation-settings: "opsz" 48; }
.story--second .hed { font-size: 23px; }
.story--column .hed { font-size: 19px; }
.story--brief  .hed { font-size: 16.5px; line-height: 1.2; }
.story--inside .hed { font-size: 19px; }

/* Summaries in grey sans: the convention that most separates a modern
   newspaper site from a blog. */
.standfirst {
  font-family: var(--sans); font-size: 14.5px; line-height: 1.5;
  color: var(--ink-2); margin: 0 0 10px; text-wrap: pretty;
}
.story--lead .standfirst { font-size: 16px; }
.story--brief .standfirst { font-size: 13.5px; }

.body p { margin: 0 0 12px; text-wrap: pretty; }
.story--lead .body { font-size: 16.5px; line-height: 1.55; }

.jump { margin-top: 2px; }
.jump a {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--rule-mid); padding-bottom: 1px;
}
.jump a:hover { border-bottom-color: var(--ink); }

/* ── latest rail ────────────────────────────────────────────────── */

.rail__head {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--rule-hard);
}
.latest { list-style: none; margin: 0; padding: 0; }
.latest li { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.latest li:last-child { border-bottom: 0; }
.latest time { display: block; font-family: var(--sans); font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.latest .t { font-size: 15.5px; line-height: 1.28; font-weight: 600; }
.latest .t:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── figures ────────────────────────────────────────────────────── */

figure { margin: 0 0 12px; }
figure img { width: 100%; height: auto; display: block; background: var(--rule); }
figcaption { font-family: var(--sans); font-size: 12.5px; line-height: 1.45; color: var(--ink-3); padding-top: 6px; }
.credit { font-size: 11px; }

/* ── sourcing ───────────────────────────────────────────────────── */

.sourcing { margin-top: 8px; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); }
.sourcing strong { font-weight: 600; color: var(--ink-2); }
.sourcing a:hover { text-decoration: underline; }

/* ── sources block ──────────────────────────────────────────────── */

.sources { max-width: 660px; margin: 30px auto 0; border-top: 1px solid var(--rule-hard); padding-top: 14px; padding-bottom: 56px; }

.sources__head {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.sources__count { font-weight: 400; color: var(--ink-3); letter-spacing: 0; text-transform: none; }

.sources__list { list-style: none; margin: 0; padding: 0; }
.src { border-bottom: 1px solid var(--rule); }
.src:last-child { border-bottom: 0; }
.src a {
  display: grid; grid-template-columns: 92px 1fr auto; align-items: baseline;
  gap: 12px; padding: 11px 0;
}
.src a:hover .src__who { text-decoration: underline; text-underline-offset: 3px; }

.src__role {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
}
/* A company speaking about itself is marked, because the reader should
   weigh it differently from a reporter. */
.src--primary .src__role { color: var(--ink); }

.src__main { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; min-width: 0; }
.src__who { font-size: 16px; font-weight: 600; }
.src__kind, .src__at {
  font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
}

@media (max-width: 560px) {
  .src a { grid-template-columns: 1fr; gap: 3px; }
}

/* ── inside bands ───────────────────────────────────────────────── */

.band { border-top: 1px solid var(--rule-hard); margin-top: 32px; padding-top: 16px; padding-bottom: 40px; }
.band__head { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0 24px; }
.grid-3 > *, .grid-4 > * { border-left: 1px solid var(--rule); padding-left: 24px; }
.grid-3 > *:first-child, .grid-4 > *:first-child { border-left: 0; padding-left: 0; }

/* ── article page ───────────────────────────────────────────────── */

.article { max-width: 660px; margin: 36px auto 0; }
.article .hed { font-size: clamp(30px, 3.8vw, 42px); font-variation-settings: "opsz" 48; }
.article .standfirst { font-size: 17px; }
.article .body { font-size: 18px; line-height: 1.65; }
.article .body p { margin-bottom: 18px; }
.backlink { font-family: var(--sans); font-size: 12px; color: var(--ink-3); display: inline-block; margin-bottom: 18px; }
.backlink:hover { color: var(--ink); }

/* ── responsive ─────────────────────────────────────────────────── */

@media (max-width: 1040px) {
  .frontpage { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .col--briefs { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-hard); margin-top: 20px; padding-top: 16px; }
  .col--briefs .latest { columns: 2; column-gap: 24px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .frontpage { display: flex; flex-direction: column; }
  .frontpage .col:nth-child(2) { order: 1; }
  .frontpage .col:nth-child(1) { order: 2; }
  .frontpage .col--briefs { order: 3; }
  .col + .col { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 18px; }
  .col--briefs .latest { columns: 1; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-3 > *, .grid-4 > * { border-left: 0; padding-left: 0; }
  .topics { display: none; }
  .nav { gap: 16px; font-size: 12.5px; }
}
@media print { .nav, .topics, .backlink { display: none; } }
