/* =====================================================================
   PINtPRESS long-form feature template
   ---------------------------------------------------------------------
   Fonts: put this in <head> BEFORE this stylesheet:

   <link rel="preconnect" href="https://fonts.googleapis.com" />
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400;1,8..60,600&display=swap" rel="stylesheet" />

   Brand rule: the wordmarks PINtPOINT and PINtPRESS must never be
   uppercased. Every brand element below sets text-transform: none.
   See TEMPLATE.md for the markup each component expects.
   ===================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  --paper: #f6f1e7;        /* page background */
  --paper-deep: #efe7d8;   /* rare tinted boxes */
  --ink: #1d1b18;          /* body text */
  --ink-soft: #3a352e;     /* standfirst, quotes */
  --muted: #6f665a;        /* captions, metadata, footer */
  --rule: #d9cfbd;         /* hairlines */
  --amber: #f5a623;        /* PINtPOINT amber: accents only (rules, bars, marks) */
  --amber-ink: #8a5a00;    /* dark amber for amber TEXT on paper: 5.27:1 on --paper (AA). Was #b8740a (3.37:1, failed for small text) */
  --link: #7a4a00;         /* inline link text */

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --measure: 68ch;         /* text column width */
  --page: 1100px;          /* masthead / footer width */
  --fig-w: 270px;          /* desktop floated figure width */
  --fig-hang: 135px;       /* how far a figure hangs past the measure */
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--serif); font-size: 19px; line-height: 1.62;
  background: var(--paper); color: var(--ink);
  font-optical-sizing: auto; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga", "onum";
}

/* ---------- 3. Masthead / nav ---------- */
nav {
  font-family: var(--sans); display: flex; justify-content: space-between; align-items: baseline;
  max-width: var(--page); margin: 0 auto; padding: 22px 32px 18px;
  border-bottom: 1px solid var(--ink); position: relative;
}
nav::after { content: ""; position: absolute; left: 32px; right: 32px; bottom: -4px; border-bottom: 1px solid var(--rule); }
nav > div { display: flex; gap: 20px; align-items: center; }
nav a { color: var(--muted); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; }
nav a:hover { color: var(--ink); }
/* Wordmark: PINt<span>POINT</span> - never uppercased */
nav a.logo { font-size: 1.15rem; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--ink); }
nav a.logo span { color: var(--amber-ink); }

/* ---------- 4. Article column ---------- */
.content { max-width: calc(var(--measure) + 64px); margin: 0 auto; padding: 64px 32px 64px; }

/* ---------- 5. Imprint line: PINtPRESS | ESSAY | meta ---------- */
.meta {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 500; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 22px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.meta .imprint {
  position: relative; padding: 10px 12px 0 0; border-right: 1px solid var(--rule);
  font-weight: 800; font-size: 0.82rem; letter-spacing: 0; text-transform: none; color: var(--amber-ink);
}
.meta .imprint::before { content: ""; position: absolute; left: 0; top: 0; width: 28px; height: 3px; background: var(--amber); }
.meta .category { color: var(--ink); font-weight: 700; letter-spacing: 0.14em; padding-right: 12px; border-right: 1px solid var(--rule); }

/* ---------- 6. Headline ---------- */
h1 {
  font-family: var(--serif); font-size: 3rem; font-weight: 600; line-height: 1.08; letter-spacing: -0.018em;
  color: var(--ink); margin-bottom: 20px; text-wrap: balance;
}
h1 em { font-style: italic; font-weight: 600; color: inherit; }

/* ---------- 7. Standfirst ---------- */
.standfirst {
  font-size: 1.32rem; line-height: 1.45; font-style: italic; color: var(--ink-soft);
  margin-bottom: 34px; padding-bottom: 30px; border-bottom: 1px solid var(--rule); text-wrap: balance;
}

/* ---------- 8. Body + drop cap ---------- */
p { margin-bottom: 1.05em; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }
p.lede { font-size: 1.06em; }
p.lede::first-letter {
  float: left; font-weight: 600; font-size: 4.1em; line-height: 0.82;
  margin: 0.07em 0.09em -0.05em 0; color: var(--amber-ink);
}

/* ---------- 9. Inline links ---------- */
a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(245,166,35,0.75);
    text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-color: var(--amber); }

/* ---------- 10. Section heading (standard) ---------- */
h2 {
  font-size: 1.55rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em;
  margin: 2.4em 0 0.75em; padding-top: 18px; position: relative; clear: both;
}
h2::before { content: ""; position: absolute; left: 0; top: 0; width: 36px; height: 2px; background: var(--amber); }

/* ---------- 11. Section turn (use ONCE, at the narrative turning point) ---------- */
h2.section-turn {
  margin-top: 3.4em; padding-top: 1.5em; font-size: 1.8rem;
  border-top: 1px solid var(--rule);
}
h2.section-turn::before {   /* small amber diamond centred on the full-measure rule */
  left: 50%; top: -6px; width: 9px; height: 9px;
  transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 0 7px var(--paper);
}

/* ---------- 12. Figures: float on desktop, full width on mobile ---------- */
figure { margin: 2em 0; }
figure img { display: block; width: 100%; height: auto; outline: 1px solid rgba(29,27,24,0.08); outline-offset: -1px; }
figcaption {
  font-family: var(--sans); font-size: 0.74rem; line-height: 1.5; color: var(--muted);
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule);
}
@media (min-width: 1000px) {
  figure { float: right; width: var(--fig-w); margin: 0.4em calc(-1 * var(--fig-hang)) 1.4em 36px; }
}

/* ---------- 13. Blockquote ---------- */
blockquote {
  margin: 1.6em 0; padding: 2px 0 2px 22px; border-left: 2px solid var(--amber);
  font-style: italic; font-size: 1.06em; line-height: 1.55; color: var(--ink-soft);
}
blockquote cite { display: block; margin-top: 8px; font-family: var(--sans); font-style: normal; font-size: 0.72rem; color: var(--muted); }

/* ---------- 14. End mark (after the article's final paragraph or quote) ---------- */
.content > p:last-child::after,
.content > blockquote:last-child::after {
  content: ""; display: inline-block; width: 0.5em; height: 0.5em; background: var(--amber);
  margin-left: 0.4em; vertical-align: 0.05em;
}

/* ---------- 15. Next story handover (below the article, above the footer) ---------- */
.next-story {
  max-width: calc(var(--measure) + 64px); margin: 0 auto; padding: 8px 32px 80px;
}
.next-story__inner { border-top: 1px solid var(--rule); padding-top: 18px; }
.next-story__label {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; color: var(--muted);
  margin-bottom: 12px;
}
.next-story__label .brand { font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--amber-ink); }
.next-story__label .label { text-transform: uppercase; }
.next-story__title { font-size: 1.6rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 10px; text-wrap: balance; }
.next-story__standfirst { font-style: italic; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.5; margin-bottom: 12px; }
.next-story__link { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--amber-ink); }
span.next-story__link { color: var(--muted); }   /* unlinked until the target is live */

/* ---------- 16. Footer ---------- */
footer {
  font-family: var(--sans); max-width: var(--page); margin: 0 auto; text-align: center; padding: 30px 24px 48px;
  border-top: 1px solid var(--ink); font-size: 0.74rem; letter-spacing: 0.02em; color: var(--muted); clear: both;
}
footer .imprint-note { font-family: var(--serif); font-style: italic; font-size: 0.9rem; letter-spacing: 0; text-transform: none; margin-bottom: 16px; color: var(--ink-soft); }
footer .links { display: flex; gap: 24px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; text-transform: uppercase; letter-spacing: 0.08em; }
footer a:hover { color: var(--ink); }

/* ---------- 17. Wider screens ---------- */
@media (min-width: 1000px) {
  h1 { font-size: 3.3rem; margin-right: -120px; }
  .standfirst { font-size: 1.4rem; }
}

/* ---------- 18. Phones ---------- */
@media (max-width: 600px) {
  body { font-size: 17.5px; line-height: 1.6; }
  nav { padding: 16px 20px 14px; flex-wrap: wrap; gap: 10px; }
  nav::after { left: 20px; right: 20px; }
  nav > div { gap: 14px; flex-wrap: wrap; }
  nav a { font-size: 0.66rem; }
  .content { padding: 36px 20px 52px; }
  .meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .meta .imprint, .meta .category { border-right: 0; padding-right: 0; }
  h1 { font-size: 2.05rem; line-height: 1.12; }
  .standfirst { font-size: 1.15rem; margin-bottom: 28px; padding-bottom: 24px; }
  h2 { font-size: 1.32rem; }
  h2.section-turn { font-size: 1.5rem; }
  .next-story { padding: 4px 20px 60px; }
  .next-story__title { font-size: 1.35rem; }
  footer .links { gap: 10px 16px; }
  footer a { font-size: 0.66rem; letter-spacing: 0.06em; }
}

/* =====================================================================
   19-27. Archive components (added for the rollout of older posts)
   ---------------------------------------------------------------------
   Everything below is additive. It defines new variables and styles only
   classes and elements that the template pages above do not use, so a
   page built to sections 1-18 renders exactly as before.
   Order on a page: fonts link, this file, then the page's own <style>.
   Rules here are one class or two elements, so a page rule wins at equal
   specificity without !important.
   ===================================================================== */

/* ---------- 19. More variables (new names only) ---------- */
:root {
  --rule-soft: #e6dfd1;    /* dotted list rules, table cell lines */
  --plate: #171309;        /* dark demo surface, framed as a plate */
  --plate-card: #221c12;
  --plate-text: #f5efe4;
  --plate-muted: #a79d8c;
  --amber-lit: #e8a033;    /* amber on --plate only (8.39:1) */
  /* Old names some page rules and scripts still use; they resolve to print values. */
  --bg: var(--paper); --text: var(--ink); --border: var(--rule); --card: transparent;
  --teal: var(--amber-ink); --accent: var(--amber-ink);
}

/* ---------- 20. Masthead: class name some pages give the link row ---------- */
nav .nav-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
/* Masthead and footer links are set in capitals. A link whose text is a
   wordmark (PINtPOINT, PINtPRESS, PINtDEXTER, TUNeDEXTER) takes class="brand"
   so it keeps its spelling. */
nav a.brand, footer a.brand { text-transform: none; letter-spacing: 0; }

/* ---------- 21. Text: lists, h3, code, highlights, quotes ---------- */
.content ul, .content ol { margin: 0 0 1.05em 1.3em; }
.content li { margin-bottom: 0.4em; }
.content li > ul, .content li > ol { margin-top: 0.4em; margin-bottom: 0; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; margin: 1.8em 0 0.5em; }
code { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.85em; background: var(--paper-deep); padding: 1px 5px; }
.highlight { font-weight: 600; color: inherit; background: none; box-shadow: none; }
blockquote p { margin-bottom: 0.6em; }
blockquote p:last-child { margin-bottom: 0; }
.pullquote {
  margin: 1.6em 0; padding: 2px 0 2px 22px; border-left: 2px solid var(--amber);
  font-style: italic; font-size: 1.06em; line-height: 1.55; color: var(--ink-soft); background: none; text-align: left;
}
/* One short line a piece may stand apart. The 22ch cap is the guard: it only
   works on a handful of words, so it cannot be put on a long quoted passage. */
.pullquote.standout {
  border-left: 0; padding: 0; margin: 2.2em auto; max-width: 22ch;
  text-align: center; font-style: normal; font-size: 1.7em; line-height: 1.2; color: var(--ink);
}
/* The one centred display quote a piece may have, near the end. */
.quote {
  font-size: 1.3rem; font-style: italic; line-height: 1.45; color: var(--ink); text-align: center;
  margin: 2em 0; padding: 28px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: none;
}
/* Older posts open with <div class="lede">: first paragraph as the standfirst, the rest as body text. */
div.lede { margin-bottom: 34px; }
div.lede > p:first-child { font-size: 1.32rem; line-height: 1.45; font-style: italic; color: var(--ink-soft); }
div.lede > p.short { font-weight: 600; }
/* Opt-out for the automatic drop cap on p.lede (section 8): add class="no-drop". */
p.lede.no-drop::first-letter { float: none; font-size: inherit; line-height: inherit; margin: 0; color: inherit; font-weight: inherit; }

/* ---------- 22. Figures: wide (not floated) variants ---------- */
/* Section 12 floats every figure on wide screens. Heroes, charts, demos and
   other wide figures opt out with class="wide" (or are .hero / .plate). */
.hero { margin: 0 0 32px; }
.hero img { display: block; width: 100%; height: auto; }
@media (min-width: 1000px) {
  figure.wide, figure.hero, figure.plate { float: none; width: auto; margin: 2em 0; }
  /* A tall photo near the end of a section would float into an empty gap
     before the next heading; class="inset" keeps it in the column, 360px wide. */
  figure.inset { float: none; width: 360px; max-width: 100%; margin: 2em 0; }
}
/* Dark figures (charts, demos) sit in a paper frame with a hairline, like a plate in print. */
.plate { margin: 2.4em -28px; padding: 10px; background: var(--paper); border: 1px solid var(--rule); }
.plate > figcaption { margin: 12px 4px 0; }

/* ---------- 23. Tables ---------- */
.content table { width: 100%; border-collapse: collapse; margin: 1.2em 0 0.6em; font-family: var(--sans); font-size: 0.82rem; clear: both; }
.content th, .content td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.content th { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--rule); }

/* ---------- 24. FAQ ---------- */
.faq { margin-top: 2.6em; clear: both; }
.faq-item { border-bottom: 1px solid var(--rule); padding: 18px 0; }
.faq-item summary {
  font-size: 1.06rem; font-weight: 600; line-height: 1.4; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--sans); font-weight: 400; font-size: 1.2rem; color: var(--muted); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 10px 0 0; font-size: 1rem; }

/* ---------- 25. End matter: hairline lists, no panels ---------- */
.sources, .series-links, .companion, .disclosure, .revision-note {
  margin-top: 2.4em; padding: 14px 0 0; border: 0; border-top: 1px solid var(--rule); background: none;
  font-family: var(--sans); font-size: 0.8rem; line-height: 1.6; color: var(--muted); clear: both;
}
.faq + .sources { border-top: 0; }
.sources > strong, .sources h2, .sources h3, .series-links .series-label,
.companion > b:first-child, .companion > strong:first-child, .revision-note > strong:first-child {
  display: block; font-family: var(--sans); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px; padding: 0;
}
.sources h2::before { content: none; }
.sources ul, .series-links ul { list-style: none; margin: 0; padding: 0; }
.sources li, .series-links li { padding: 7px 0; margin: 0; border-bottom: 1px dotted var(--rule); }
.sources p, .companion p, .disclosure p, .revision-note p { font-size: inherit; line-height: inherit; color: inherit; margin-bottom: 8px; }
.series-links li strong, .companion strong, .companion b, .revision-note strong { color: var(--ink); }
.series-links .you-are-here { font-weight: 600; color: var(--amber-ink); }
.series-links .series-guide { margin: 12px 0 0; }
/* A revision note sits above the article text. */
.revision-note { margin: 0 0 34px; color: var(--ink-soft); }

/* ---------- 26. Closing, call to action, end mark opt-in/opt-out ---------- */
.closing { margin-top: 2.6em; padding-top: 28px; border-top: 1px solid var(--rule); clear: both; }
.closing p.kicker { font-weight: 600; }
a.cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 11px 20px;
  background: transparent; color: var(--ink); border: 1px solid var(--ink); border-radius: 0; box-shadow: none;
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; text-decoration: none;
}
a.cta:hover { background: var(--ink); color: var(--paper); }
a.cta svg { fill: currentColor; }
/* Section 14 marks the last paragraph of .content automatically. Where the
   article ends before end matter (sources, FAQ, closing), put class="end"
   on the final paragraph (or closing quote) of the piece instead; class="no-end" switches off
   the automatic mark on a last element that is a note, not the ending. */
.content p.end::after, .content blockquote.end::after {
  content: ""; display: inline-block; width: 0.5em; height: 0.5em; background: var(--amber);
  margin-left: 0.4em; vertical-align: 0.05em;
}
.content > p.no-end:last-child::after, .content > blockquote.no-end:last-child::after { content: none; }

/* ---------- 27. Footer extras and phones (kept last) ---------- */
footer .legal { font-size: 0.68rem; margin-top: 10px; }
@media (max-width: 700px) {
  .plate { margin-left: 0; margin-right: 0; padding: 6px; }
}
@media (max-width: 600px) {
  nav .nav-links { gap: 14px; }
  div.lede > p:first-child, .quote { font-size: 1.15rem; }
  .content table { display: block; overflow-x: auto; }
  .faq-item summary { font-size: 1rem; }
}

/* ---------- 28. Print (kept last) ----------
   Printing a feature, or saving it as a PDF, used a full page width for every
   photograph, which pushed the text after it onto a new sheet and left the
   previous one half empty. Figures print at a readable size instead, and a
   heading stays with the paragraph it introduces. */
@media print {
  figure, figure.inset, figure.wide, figure.hero, figure.plate {
    float: none; width: 50%; max-width: 50%; margin: 1.3em auto;
    break-inside: avoid; page-break-inside: avoid;
  }
  figure img { width: 100%; height: auto; }
  figcaption { break-before: avoid; page-break-before: avoid; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  blockquote, .pullquote, .quote { break-inside: avoid; page-break-inside: avoid; }
}
