/* =====================================================================
   Outside the Distribution — theme styling.
   Lifted from the owner's article.html (design tokens + rich rules) so
   every post inherits it and no post carries its own <style> block.
   Manrope is self-hosted (static/fonts/) — no Google Fonts, no tracker.
   ===================================================================== */

/* ---- Self-hosted Manrope (variable, weight 200–800) ----
   Note: Manrope has no true italic; browsers synthesise an oblique for <em>. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/Manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/Manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Design tokens (from article.html) ---- */
:root {
  --ink: #141414;
  --muted: #6a6a6a;
  --faint: #8c8c8c;
  --rule: #e6e6e6;
  --summary-bg: #f7f7f5;
  --link: #141414;
  --maxw: 700px;
  --sans: "Manrope", -apple-system, "Segoe UI", system-ui, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { font-size: 17px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.6;
  background: #fff;
}

/* ---- Layout wrappers ---- */
.site-header,
.content,
.site-footer { max-width: var(--maxw); margin: 0 auto; padding-left: 36px; padding-right: 36px; }
.content { padding-top: 40px; padding-bottom: 96px; min-height: 60vh; }

/* ---- Site header / nav ---- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 40px;
  padding-bottom: 18px;
}
.site-title { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.site-nav a { margin-left: 1.1rem; color: var(--faint); text-decoration: none; font-size: 0.9rem; }
.site-nav a:hover { color: var(--ink); }

/* ---- Headings ---- */
h1 {
  font-size: 2.0rem;
  font-weight: 600;
  line-height: 1.18;
  margin: 0 0 0.35em;
  letter-spacing: -0.02em;
}
.deck { font-size: 1.18rem; font-weight: 400; line-height: 1.45; color: var(--muted); margin: 0 0 2.6em; }
h2 {
  font-size: 1.28rem;
  font-weight: 600;
  margin: 2.8em 0 0.3em;
  padding-top: 1.3em;
  border-top: 1px solid var(--rule);
  letter-spacing: -0.015em;
}
h2 .num { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; margin-right: 0.55em; }
h3 { font-size: 1.0rem; font-weight: 600; margin: 1.6em 0 0.2em; letter-spacing: -0.005em; }

/* ---- Body copy ---- */
p { margin: 0.6em 0; }
em, i { font-style: italic; }
b, strong { font-weight: 600; }
a { color: var(--link); text-underline-offset: 2px; }
ul, ol { margin: 0.6em 0; padding-left: 1.3em; }
li { margin: 0.3em 0; }

/* ---- Executive-summary panel (summary shortcode) ---- */
.summary {
  background: var(--summary-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 22px 26px 26px;
  margin: 0 0 1.8em;
}
.summary h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 0.1em;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.summary > :last-child { margin-bottom: 0; }

/* ---- Figures (inline SVG) + source notes (figure-svg shortcode) ---- */
figure.fig { margin: 1.8em 0 1.6em; }
figure.fig svg { display: block; width: 100%; height: auto; }
.fig-note { font-size: 0.78rem; line-height: 1.5; color: var(--faint); margin: 0.7em 0 0; }
.fig-note sup { margin-right: 0.25em; }
sup.fnref { font-size: 0.7em; line-height: 0; font-weight: 600; }

/* ---- Data table (collapse) ---- */
table.collapse {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0 0.8em;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
table.collapse caption { caption-side: top; text-align: left; font-size: 0.82rem; color: var(--faint); margin-bottom: 0.7em; }
table.collapse th, table.collapse td { text-align: right; padding: 0.5em 0.7em; border-bottom: 1px solid var(--rule); }
table.collapse th:first-child, table.collapse td:first-child { text-align: left; }
table.collapse thead th { font-weight: 600; color: var(--muted); border-bottom: 1.5px solid #d0d0d0; }
table.collapse tbody tr:last-child td { border-bottom: none; }
table.collapse tr.highlight td {
  background: var(--summary-bg);
  font-weight: 600;
  color: var(--ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ---- Appendix ---- */
.appendix h2 { color: var(--muted); }

/* ---- Code ---- */
code { font-family: var(--mono); font-size: 0.88em; }
pre { font-family: var(--mono); background: var(--summary-bg); padding: 1em 1.2em; border-radius: 8px; overflow-x: auto; font-size: 0.85rem; }
pre code { font-size: inherit; }

/* ---- Landing / list ---- */
.intro .tagline { font-size: 1.18rem; color: var(--muted); margin: 0.5em 0 2.4em; }
.post-list { margin-top: 1em; }
.post-item { padding: 1.4em 0; border-top: 1px solid var(--rule); }
.post-item:first-child { border-top: none; }
.post-item h2 { border-top: none; padding-top: 0; margin: 0 0 0.2em; font-size: 1.28rem; }
.post-item h2 a { color: var(--ink); text-decoration: none; }
.post-item h2 a:hover { text-decoration: underline; }
.post-item time { color: var(--faint); font-size: 0.82rem; }
.post-excerpt { color: var(--muted); margin: 0.4em 0 0; }

/* ---- Post header ---- */
.post-header { margin-bottom: 1.6em; }
.post-header h1 { margin-bottom: 0.3em; }
.post-header time { color: var(--faint); font-size: 0.82rem; }

/* ---- Site footer ---- */
.site-footer {
  margin-top: 4em;
  padding-top: 1.3em;
  padding-bottom: 3em;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  color: var(--faint);
}
.site-footer a { color: var(--faint); }
.site-footer a:hover { color: var(--ink); }

/* ---- Print / PDF ---- */
@page { size: A4; margin: 20mm 18mm; }
@media print {
  html { font-size: 11.5pt; }
  body { background: #fff; }
  .site-header, .content, .site-footer { max-width: none; margin: 0; padding: 0; }
  .site-nav, .post-list { display: none; }
  h1, h2, h3 { break-after: avoid; }
  figure.fig, .summary, table.collapse { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .summary, table.collapse tr.highlight td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
