/* Long-form reading: one calm column, wide figures that break out of it. */

:root {
  --col: 680px;
  --wide: 1040px;
  --body: #34332f;
  --chart-a: #3e6fb0;   /* validated pair (light surface #f2f6ea): blue */
  --chart-b: #c4673f;   /* terracotta */
  --chart-ctx: #c9cbbf; /* context bars */
  --chart-grid: rgba(35, 34, 32, 0.09);
}

.post { padding: clamp(56px, 10vh, 120px) 24px clamp(64px, 10vh, 120px); }

.post__head,
.post__body > *,
.post__foot { max-width: var(--col); margin-left: auto; margin-right: auto; }

/* ---------- Head ---------- */

.post__kicker { margin: 0 0 22px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.post__kicker a { text-decoration: none; }
.post__kicker a:hover { color: var(--ink); }

.post__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 22px;
  text-wrap: balance;
}

.post__subtitle {
  font-size: clamp(19px, 2.2vw, 21px);
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 34px;
  text-wrap: pretty;
}

.post__meta {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 16px;
  margin: 0 0 56px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

.post__meta dt { color: var(--muted); }
.post__meta dd { margin: 0; color: var(--ink); }
.post__meta a { text-decoration: underline dotted; text-underline-offset: 3px; }
.post__meta a:hover { text-decoration-style: solid; }

/* ---------- Body ---------- */

.post__body {
  font-size: 18.5px;
  line-height: 1.72;
  color: var(--body);
  counter-reset: figure;
  font-feature-settings: "kern", "liga";
  hanging-punctuation: first;
}

.post__body p { margin-top: 0; margin-bottom: 1.3em; text-wrap: pretty; }

.post__body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 2.3em;
  margin-bottom: 0.6em;
  text-wrap: balance;
}

.post__body h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.35;
  color: var(--ink);
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.post__body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(35, 34, 32, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.post__body a:hover { text-decoration-color: var(--ink); }

.post__body strong { font-weight: 500; color: var(--ink); }
.post__body em { font-style: italic; }
.post__body h2 em, .post__body blockquote em { font-style: normal; }

.post__body ul,
.post__body ol { padding-left: 1.25em; margin-top: 0; margin-bottom: 1.3em; }
.post__body li { margin-bottom: 0.45em; padding-left: 0.2em; }
.post__body li::marker { color: var(--muted); }

.post__body blockquote {
  margin: 2em auto;
  padding: 0 0 0 22px;
  border-left: 2px solid var(--ink);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.post__body blockquote p { margin: 0; }

.post__body code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: rgba(35, 34, 32, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.post__body pre {
  background: #e9eee0;
  border-radius: 6px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.post__body pre code { background: none; padding: 0; font-size: inherit; }

.post__body hr {
  border: 0;
  margin: 3em auto;
  text-align: center;
  height: auto;
}

.post__body hr::after { content: "· · ·"; font-family: var(--mono); color: var(--muted); letter-spacing: 0.4em; }

/* ---------- Tables ---------- */

.post__body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin-top: 1.8em;
  margin-bottom: 2em;
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.post__body thead th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-align: left;
  padding: 0 18px 10px 0;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

.post__body td {
  padding: 11px 18px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.post__body td:first-child { color: var(--ink); }

/* ---------- Figures ---------- */

.post__body .figure,
.post .figure { margin: 2.6em auto 2.8em; }

.figure img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; }

.figure--wide { max-width: var(--wide) !important; }

.figure figcaption {
  max-width: var(--col);
  margin: 14px auto 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.post__body .figure figcaption::before {
  counter-increment: figure;
  content: "Figure " counter(figure) ". ";
  color: var(--ink);
}

.figure figcaption a { color: inherit; }

.post__hero { margin-top: 0 !important; margin-bottom: 56px !important; }

/* ---------- Charts (inline SVG, see _includes/charts/) ---------- */

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 11.5px; fill: var(--muted); }
.chart .t-ink { fill: var(--ink); }
.chart .t-title { font-family: var(--sans); font-size: 13.5px; fill: var(--ink); }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { stroke: var(--ink); stroke-width: 1; }
.chart .ref { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart .band { fill: rgba(35, 34, 32, 0.06); }
.chart .m-a { fill: var(--chart-a); }
.chart .m-b { fill: var(--chart-b); }
.chart .m-ctx { fill: var(--chart-ctx); }
.chart .l-a { fill: none; stroke: var(--chart-a); stroke-width: 2; stroke-linejoin: round; }
.chart .dot-a { fill: var(--chart-a); stroke: var(--bg); stroke-width: 2; }
.chart .mark { transition: opacity 0.15s; }
.chart:hover .mark { opacity: 0.45; }
.chart:hover .mark:hover { opacity: 1; }
.chart .hit { fill: transparent; }

/* ---------- Footnotes (kramdown) ---------- */

.post__body .footnotes {
  margin-top: 3.5em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
}

.post__body .footnotes ol { padding-left: 1.2em; }
.post__body sup a { text-decoration: none; font-family: var(--mono); font-size: 0.75em; padding: 0 0.1em; }
.post__body a.reversefootnote { text-decoration: none; }

/* ---------- Foot ---------- */

.post__foot { margin-top: 4em; padding-top: 28px; border-top: 1px solid var(--line); }

.post__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }

.post__pager-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
}

.post__pager-link span { font-family: var(--mono); font-size: 12px; letter-spacing: 0; color: var(--muted); }
.post__pager-link--next { grid-column: 2; text-align: right; }
.post__pager-link:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

@media (max-width: 680px) {
  .post { padding-left: 16px; padding-right: 16px; }
  .post__body { font-size: 17.5px; line-height: 1.68; }
  .post__meta { grid-template-columns: 90px 1fr; }
  .post__body blockquote { font-size: 21px; }
  .post__pager { grid-template-columns: 1fr; }
  .post__pager-link--next { grid-column: 1; text-align: left; }
  .figure--chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .figure--chart .chart { min-width: 540px; }
}
