/* Default theme — "quiet broadsheet" editorial design.
   Single stylesheet, zero JS. Every color, font and spacing value is a
   custom property on :root so a per-domain theme can override the tokens
   and inherit the rest. Budget: <= 25 KB raw. */

/* ---------------------------------------------------------------- tokens */
:root {
  --color-bg: #fcfbf9;
  --color-surface: #f4f1ec;
  --color-ink: #1d1c1a;
  --color-muted: #5d5952;
  --color-rule: #e4e0d8;
  --color-rule-strong: #1d1c1a;
  --color-accent: #a02128;

  --font-serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 40rem; /* ~68-74 characters of body serif */
  --wide: 66rem;

  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2.5rem;
  --s6: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #171614;
    --color-surface: #201e1b;
    --color-ink: #e9e6e0;
    --color-muted: #a5a099;
    --color-rule: #34312b;
    --color-rule-strong: #e9e6e0;
    --color-accent: #e0837f;
  }
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin: 1.4em 0 0.5em;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.625rem);
  line-height: 1.15;
  margin-top: 0;
}

h2 {
  font-size: 1.375rem;
}

h3 {
  font-size: 1.125rem;
}

p {
  margin: 0 0 var(--s3);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Editorial labels: kicker above headlines, standfirst below them. */
.kicker,
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin: 0 0 var(--s2);
}

.lede {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--color-muted);
  margin: 0 0 var(--s3);
}

.section-title {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  border-bottom: 2px solid var(--color-rule-strong);
  padding-bottom: var(--s2);
  margin: 0 0 var(--s2);
}

/* -------------------------------------------------------- skip + staging */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: var(--s2) var(--s3);
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

.staging-banner {
  background: var(--color-accent);
  color: var(--color-bg);
  text-align: center;
  padding: var(--s1) var(--s3);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* -------------------------------------------------------------- masthead */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
  padding: 0 var(--s3) var(--s1);
}

.site-header__inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) 0;
  border-bottom: 2px solid var(--color-rule-strong);
}

.site-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s3) var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-ink);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------------------------------------------------------------- layout */
main {
  display: block;
}

.content {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--s5) var(--s3) var(--s6);
}

.hero {
  border-bottom: 1px solid var(--color-rule);
  padding: var(--s5) var(--s3);
}

.hero__inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 var(--s2);
}

.hero .lede {
  margin: 0;
}

.page-header {
  margin-bottom: var(--s4);
}

/* ---------------------------------------------------------- signal river */
.signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.signal-item {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--color-rule);
}

.signal-item:last-child {
  border-bottom: 0;
}

.signal-item__meta {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin: 0 0 var(--s1);
}

.signal-item__meta .kicker {
  display: inline;
  margin: 0;
}

.signal-item__meta .kicker + time::before {
  content: " · ";
}

.signal-item__title {
  margin: 0 0 var(--s2);
  font-size: 1.25rem;
  line-height: 1.25;
}

.signal-item__title a {
  text-decoration: none;
}

.signal-item__title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
}

.signal-item__summary {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-muted);
}

/* Lead story: the newest signal on the home page runs bigger. */
.signal-list--lead .signal-item:first-child .signal-item__title {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 1.875rem);
  line-height: 1.2;
}

.signal-list--lead .signal-item:first-child .signal-item__summary {
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------------- topics */
.topics {
  margin-top: var(--s5);
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) 0;
}

.topic-list li {
  display: flex;
  align-items: center;
}

.topic-list li + li::before {
  content: "";
  width: 1px;
  height: 0.875em;
  background: var(--color-rule);
  margin: 0 var(--s3);
}

.topic-list a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.topic-list a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
}

/* --------------------------------------------------------------- article */
.article__header {
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: var(--s3);
  margin-bottom: var(--s4);
}

.article__header .lede {
  font-size: 1.1875rem;
}

.article__meta {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-rule);
  padding-top: var(--s2);
  margin: 0;
}

.article__meta span + span::before {
  content: " · ";
}

.callout {
  margin: var(--s4) 0;
  padding: var(--s3) var(--s4);
}

.callout h2 {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--s2);
}

.callout p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.callout--why {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
}

.callout--why h2 {
  color: var(--color-accent);
}

.callout--next {
  border: 1px solid var(--color-rule);
  border-top: 3px solid var(--color-rule-strong);
}

.prose h2 {
  font-size: 1.375rem;
}

.prose h3 {
  font-size: 1.125rem;
}

.prose ul,
.prose ol {
  margin: 0 0 var(--s3);
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: var(--s1);
}

.prose blockquote {
  margin: var(--s4) 0;
  padding-left: var(--s4);
  border-left: 2px solid var(--color-rule-strong);
  color: var(--color-muted);
  font-style: italic;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--color-rule);
  margin: var(--s5) 0;
}

.source-attribution {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-muted);
  border-top: 2px solid var(--color-rule-strong);
  padding-top: var(--s3);
  margin-top: var(--s5);
}

.related {
  margin-top: var(--s6);
}

.related .signal-item {
  padding: var(--s3) 0;
}

.related .signal-item__title {
  font-size: 1.125rem;
}

.backlink {
  margin-top: var(--s5);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------- network */
.network-grid {
  list-style: none;
  margin: var(--s4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.network-grid a {
  display: block;
  height: 100%;
  padding: var(--s4);
  border: 1px solid var(--color-rule);
  border-top: 2px solid var(--color-rule-strong);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  background: var(--color-bg);
}

.network-grid a:hover {
  border-top-color: var(--color-accent);
  color: var(--color-accent);
}

.network-note {
  margin-top: var(--s6);
  padding: var(--s4);
  background: var(--color-surface);
  border-top: 2px solid var(--color-rule-strong);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}

.network-note p {
  margin: 0 0 var(--s2);
}

.network-note p:last-child {
  margin: 0;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  margin-top: var(--s6);
  background: var(--color-surface);
  border-top: 2px solid var(--color-rule-strong);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.site-footer__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s5) var(--s3) var(--s4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4) var(--s6);
  justify-content: space-between;
}

.site-footer__about {
  max-width: 26rem;
}

.site-footer__brand {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 var(--s2);
}

.site-footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: var(--s2) var(--s4);
}

.site-footer a {
  color: var(--color-ink);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
}

.site-footer__legal {
  border-top: 1px solid var(--color-rule);
}

.site-footer__legal p {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s3);
  font-size: 0.8125rem;
}

/* ------------------------------------------------------------- error page */
.error-page {
  text-align: center;
  padding-top: var(--s6);
  padding-bottom: var(--s6);
}

/* -------------------------------------------------- ad slots (M8, reserved)
   Reserved-height placeholders so ad insertion causes no layout shift.
   Heights match config-examples/ad-slots.example.json. Until a slot is
   enabled these classes are unused; the label doubles as the required
   "Advertisement" marking once real code is dropped in. */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: var(--s5) auto;
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
}

.ad-slot::before {
  content: "Advertisement";
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.ad-slot--banner {
  min-height: 100px; /* 320x100 mobile / 728x90 desktop */
}

.ad-slot--box {
  min-height: 250px; /* 300x250 / 336x280 */
  max-width: 336px;
}

.ad-slot--rail {
  min-height: 600px; /* 300x600 right rail */
  max-width: 300px;
}

/* -------------------------------------------------------------- >= 768px */
@media (min-width: 768px) {
  html {
    font-size: 17px;
  }

  .site-header__inner {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  h2 {
    font-size: 1.5rem;
  }

  .lede {
    font-size: 1.25rem;
  }

  .article__header .lede {
    font-size: 1.3125rem;
  }

  .signal-item__title {
    font-size: 1.3125rem;
  }

  .related .signal-item__title {
    font-size: 1.1875rem;
  }
}
