/* ============================================================
   GAZETTE ARTICLE PAGES (gazette/<slug>.html, built by
   tools/build-articles.py). The same newsprint as gazette.css:
   paper, black ink, hairline rules, Playfair heads, Source Serif text.
   Standalone: these pages load nothing else.
   ============================================================ */
:root {
  --paper: #F1EDE1;
  --paper-2: #E6E1D2;
  --ink: #14120C;
  --ink-soft: #4A463A;
  --ink-faint: #5F5A4B;
  --rule-thin: rgba(20, 18, 12, .22);
  --red: #C1121F;
  --blue: #17369E;
  --f-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-text: "Source Serif 4", Georgia, serif;
  --e-out: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1.125rem/1.7 var(--f-text);
}
body::before {
  /* newsprint grain, as on the front page */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .28; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.55'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
a { color: inherit; }
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, p, blockquote { margin: 0; }

/* Reading progress: a red rule along the top that fills as you read */
.ar-progress { position: fixed; inset: 0 0 auto; z-index: 30; height: 3px; pointer-events: none; }
.ar-progress span { display: block; height: 100%; background: var(--red); transform: scaleX(0); transform-origin: 0 50%; }

/* Top bar: the masthead in miniature, and the way back */
.ga-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  background: rgb(241 237 225 / .94); backdrop-filter: blur(8px);
  border-bottom: 3px double var(--ink);
}
.ga-mast { font: 900 clamp(1.15rem, 2.4vw, 1.6rem)/1 var(--f-head); letter-spacing: -.02em; text-decoration: none; }
.ga-back {
  font-size: .95rem; text-decoration: none; padding: .35rem .8rem; border: 1px solid var(--ink);
  transition: background-color 200ms, color 200ms, transform 200ms var(--e-out);
}
.ga-back::before { content: "← "; }
.ga-back:hover { background: var(--ink); color: var(--paper); }
.ga-back:active { transform: scale(.96); }

/* The article: one measured column */
.ga { width: min(100% - 2rem, 42rem); margin: clamp(2rem, 6vw, 4.5rem) auto 0; }
.ga article { animation: ga-in 700ms var(--e-out) both; }
@keyframes ga-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ga-flag { font-size: 1rem; font-weight: 600; color: var(--red); }
.ga h1 {
  margin-top: .5rem;
  font: 900 clamp(2.2rem, 6vw, 3.6rem)/1.04 var(--f-head); letter-spacing: -.025em;
  text-wrap: balance;
}
.ga-deck { margin-top: 1.1rem; font-style: italic; font-size: clamp(1.1rem, 2.2vw, 1.32rem); line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.ga-by { margin-top: 1.2rem; font-style: italic; font-size: .98rem; color: var(--ink-faint); }
.ga-by b { font-style: normal; font-weight: 600; color: var(--ink); }
.ga-rule { margin: 1.6rem 0 2rem; border: 0; border-top: 3px double var(--ink); }

.ga-body { color: var(--ink-soft); hyphens: auto; -webkit-hyphens: auto; }
.ga-body > * + * { margin-top: 1.1em; }
.ga-body strong { font-weight: 600; color: var(--ink); }
.ga-body sup, .ga-body sub { font-size: .72em; line-height: 0; }
/* Subheads */
.ga-body h2, .ga-body h3 {
  margin: 2.3rem 0 0; color: var(--ink); hyphens: manual;
  font: 700 clamp(1.35rem, 2.8vw, 1.65rem)/1.2 var(--f-head); letter-spacing: -.01em; text-wrap: balance;
}
.ga-body h3 { margin-top: 1.9rem; font-size: clamp(1.15rem, 2.3vw, 1.32rem); }
.ga-body :is(h2, h3) + * { margin-top: .6em; }
/* Lists */
.ga-body ul, .ga-body ol { margin-bottom: 0; padding-left: 1.3em; }
.ga-body li + li { margin-top: .45em; }
.ga-body li::marker { color: var(--red); }
/* Tables: scroll sideways on a narrow screen rather than squeeze */
.ga-table { margin-block: 1.8rem; overflow-x: auto; }
.ga-table table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.4; hyphens: manual; }
.ga-table th, .ga-table td { padding: .5rem .65rem; border-bottom: 1px solid var(--rule-thin); text-align: left; vertical-align: top; }
.ga-table thead th { border-bottom: 2px solid var(--ink); font-weight: 600; color: var(--ink); }
/* Charts, maps and tables as pictures, a little wider than the text when there is room */
.ga-fig { margin: 2.2rem 0; }
.ga-body > .ga-fig { margin-block: 2.2rem; }
.ga-fig img {
  display: block; max-width: 100%; height: auto; margin-inline: auto;
  background: #fff; border: 1px solid var(--rule-thin);
}
.ga-fig figcaption {
  margin-top: .65rem; font-size: .9rem; font-style: italic; line-height: 1.45; color: var(--ink-faint);
  hyphens: manual; text-wrap: pretty;
}
.ga-fig figcaption strong { font-weight: inherit; color: inherit; }
@media (min-width: 960px) { .ga-fig { margin-inline: -6rem; } .ga-fig figcaption { padding-inline: 6rem; } }
.ga-first::first-letter {
  float: left; font: 900 4.4em/.78 var(--f-head);
  padding: .05em .09em 0 0; color: var(--red);
}
.ga-body a { color: var(--blue); text-underline-offset: 3px; }
.ga-quote {
  margin: 2rem 0; padding: 1.4rem 0;
  border-block: 3px double var(--ink);
  font: italic 700 clamp(1.35rem, 3vw, 1.9rem)/1.24 var(--f-head); letter-spacing: -.01em;
  color: var(--ink); text-align: center; text-wrap: balance;
}
/* An article whose full text has not been added yet */
.ga-body--soon { padding: 1.1rem 1.3rem; background: var(--paper-2); border-left: 3px solid var(--red); font-size: 1.02rem; }

/* Share rows, under the byline and at the end */
.ga-share { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: 1.1rem; font-size: .92rem; }
.ga-share[hidden] { display: none; }
.ga-share > span:first-child { margin-right: .25rem; font-weight: 600; color: var(--red); }
.ga-share button, .ga-share a {
  padding: .3rem .7rem; border: 1px solid var(--rule-thin); background: transparent; color: var(--ink);
  font: inherit; line-height: 1.4; text-decoration: none; cursor: pointer;
  transition: background-color 200ms, color 200ms, border-color 200ms, transform 200ms var(--e-out);
}
.ga-share button:hover, .ga-share a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ga-share button:active, .ga-share a:active { transform: scale(.95); }
.ga-share button.is-done { background: var(--red); border-color: var(--red); color: var(--paper); }
.ga-share__note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ga-share--end { margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--rule-thin); }

/* Next article */
.ga-next { margin-top: clamp(3rem, 8vw, 5rem); border-top: 1px solid var(--ink); padding-top: 1rem; }
.ga-next span { font-size: .95rem; font-weight: 600; color: var(--red); }
.ga-next a { display: grid; gap: .35rem; margin-top: .5rem; padding: .9rem 0 1.1rem; text-decoration: none; border-bottom: 1px solid var(--rule-thin); }
.ga-next b {
  font: 900 clamp(1.4rem, 3.4vw, 2rem)/1.1 var(--f-head); letter-spacing: -.02em; text-wrap: balance;
  background: linear-gradient(var(--red), var(--red)) 0 100% / 0 2px no-repeat;
  transition: background-size 380ms var(--e-out);
}
.ga-next a:hover b, .ga-next a:focus-visible b { background-size: 100% 2px; }
.ga-next i { font-size: .98rem; color: var(--ink-faint); }

/* The archive: every article, newest first, with search and sections */
.ax { width: min(100% - 2rem, 52rem); }
.ax-head h1 { font: 900 clamp(2.6rem, 8vw, 4.6rem)/1 var(--f-head); letter-spacing: -.03em; }
.ax-head p { margin-top: .8rem; font-style: italic; color: var(--ink-faint); }
.ax-tools { display: grid; gap: 1rem; margin-top: 1.8rem; padding-block: 1.2rem; border-block: 3px double var(--ink); }
.ax-tools[hidden] { display: none; }
.ax-search span { display: block; font-size: .92rem; font-weight: 600; color: var(--red); }
.ax-search input {
  width: 100%; margin-top: .4rem; padding: .65rem .8rem; border: 1px solid var(--ink); border-radius: 0;
  background: rgb(255 255 255 / .45); color: var(--ink); font: inherit; font-size: 1rem;
}
.ax-search input::placeholder { color: var(--ink-faint); }
.ax-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.ax-chips button {
  min-height: 40px; padding: .35rem .8rem; border: 1px solid var(--rule-thin); background: transparent; color: var(--ink);
  font: inherit; font-size: .92rem; line-height: 1.3; cursor: pointer;
  transition: background-color 200ms, color 200ms, border-color 200ms, transform 200ms var(--e-out);
}
.ax-chips button:hover { border-color: var(--ink); }
.ax-chips button:active { transform: scale(.96); }
.ax-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ax-count { font-size: .92rem; font-style: italic; color: var(--ink-faint); }
.ax-year { margin-top: 2.8rem; }
.ax-year[hidden] { display: none; }
.ax-year h2 { margin: 0; padding-bottom: .5rem; border-bottom: 1px solid var(--ink); font: 900 clamp(1.8rem, 4vw, 2.4rem)/1 var(--f-head); letter-spacing: -.02em; }
.ax-list { margin: 0; padding: 0; list-style: none; }
.ax-list li { border-bottom: 1px solid var(--rule-thin); }
.ax-list a { display: grid; grid-template-columns: 10.5rem 1fr; gap: .3rem 1.4rem; padding: 1rem 0 1.05rem; text-decoration: none; }
.ax-flag { grid-row: span 2; padding-top: .3rem; font-size: .86rem; font-weight: 600; line-height: 1.3; color: var(--red); }
.ax-list b {
  justify-self: start; font: 700 clamp(1.15rem, 2.3vw, 1.36rem)/1.22 var(--f-head); letter-spacing: -.01em; text-wrap: balance;
  background: linear-gradient(var(--red), var(--red)) 0 100% / 0 2px no-repeat;
  transition: background-size 380ms var(--e-out);
}
.ax-list a:hover b, .ax-list a:focus-visible b { background-size: 100% 2px; }
.ax-list i { font-size: .93rem; color: var(--ink-faint); }
.ax-none { margin-top: 2rem; font-style: italic; color: var(--ink-faint); }
.ax-none[hidden] { display: none; }
@media (max-width: 640px) {
  .ax-list a { grid-template-columns: 1fr; }
  .ax-flag { grid-row: auto; padding-top: 0; }
}

.ga-foot { width: min(100% - 2rem, 42rem); margin: 3rem auto 0; padding: 1.4rem 0 2.6rem; border-top: 3px double var(--ink); font-size: .95rem; color: var(--ink-faint); }
.ga-foot a { color: var(--ink); text-underline-offset: 3px; }

@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .ga-back { font-size: .88rem; padding: .3rem .6rem; }
  .ga-first::first-letter { font-size: 3.7em; }
  .ga-share { font-size: .88rem; }
  .ga-share > span:first-child { flex-basis: 100%; }
  .ga-share button, .ga-share a { padding: .3rem .55rem; }
}
/* Between pages: the same short cross-fade as the rest of the site */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: ga-vt-out 220ms ease-in-out both; }
  ::view-transition-new(root) { animation: ga-vt-in 320ms var(--e-out) both; }
}
@keyframes ga-vt-out { to { opacity: 0; } }
@keyframes ga-vt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .ga article { animation: none; }
  .ga-back, .ga-next b, .ga-share button, .ga-share a, .ax-chips button, .ax-list b { transition: none; }
}
@media print {
  body::before, .ar-progress, .ga-top, .ga-next, .ga-share, .ax-tools { display: none; }
  .ga-fig { margin-inline: 0; break-inside: avoid; }
  body { background: #fff; }
}
