/* article.css — the reading-first layout. Self-contained: no other
   stylesheet is loaded with it. Tokens keep the names the component
   stylesheets and chart-style.js already read, with new values. */

/* ---------- Type ---------- */

/* The faces are small and self-hosted, and the two the page always needs
   are preloaded by the layout, so block the fallback paint rather than
   swap: the text, and the title's letterpress, render once. */
@font-face {
  font-family: "ET Book";
  src: url("/css/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "ET Book";
  src: url("/css/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: block;
}

@font-face {
  font-family: "ET Book";
  src: url("/css/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "ET Book";
  src: url("/css/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;
  --bg: #fbfaf9; /* a notch off white, barely warm, no yellow cast */
  --text: #111111;
  --muted: #444444; /* kept for component stylesheets; article.css does not grey out text */
  --accent: #1f3a63; /* kept for chart and component stylesheets; unused in prose */
  --highlight: rgba(17, 17, 17, 0.08);
  --border: #cfcfcf;
  --rule: #111111;
  --title: var(--text);
  --code-bg: #f4f4f4;
  --code-inline-bg: #f0f0f0;

  --serif: "ET Book", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Type and column follow the ET Book specimen page
     (edwardtufte.github.io/et-book): 21px on 29.4px leading, a 690px
     column of about 73 characters, paragraphs 1.3em apart. A 300px rail
     beside it holds notes where a magazine would put advertisements. */
  --measure: 33rem; /* 693px at 21px, about 73 characters */
  --margin-col: 14.25rem; /* about 300px, the most the rail takes */
  --gap: 2rem;
  --wide-width: 980px; /* figure.wide, centered on the column */
  --wider-width: 1300px; /* figure.wider */
  --gutter: clamp(1rem, 4vw, 1.25rem);
  --break: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --text: #ececec;
    --muted: #bdbdbd;
    --accent: #a9bfdc;
    --highlight: rgba(169, 191, 220, 0.14);
    --border: #3a3a3a;
    --rule: #ececec;
    --code-bg: #1e1e1e;
    --code-inline-bg: #242424;
  }
}

:root[data-theme="dark"] {
  --bg: #121212;
  --text: #ececec;
  --muted: #bdbdbd;
  --accent: #a9bfdc;
  --highlight: rgba(169, 191, 220, 0.14);
  --border: #3a3a3a;
  --rule: #ececec;
  --code-bg: #1e1e1e;
  --code-inline-bg: #242424;
}

/* ---------- Base ---------- */

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

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

@media (max-width: 760px) {
  html {
    font-size: 19px;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.4;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  /* Grayscale smoothing, as on the ET Book specimen page: the same font
     file renders with noticeably lighter strokes than subpixel smoothing. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links are ink with a plain underline, as on the ET Book specimen page. */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
}

strong,
b {
  font-weight: 600;
}

em,
i,
cite {
  font-style: italic;
}

small {
  font-size: 0.85em;
}

/* ---------- Page frame ---------- */

/* No navigation bar. The page opens on the byline and the title; the
   site links live in a single quiet line at the foot. */
.site-foot,
.article {
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin-left: auto;
  margin-right: auto;
}

.article {
  margin-top: clamp(2.5em, 7vh, 5em);
}

.site-foot {
  margin-top: 5em;
  margin-bottom: 2.5em;
  font-size: 0.85em;
}

.site-foot a,
.site-foot-theme {
  color: inherit;
  text-decoration: none;
}

.site-foot-theme {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.site-foot a:hover,
.site-foot-theme:hover {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

/* The text column is centered at every width. The note rail lives in the
   right margin when there is room (see the rail rules below). */

/* ---------- Article header ---------- */

/* Opening: the date set as level four, the author's name as level three
   and the way home, then the title as level one, each on its own line. */
/* A short rule marks where the page begins, above the date. */
.article-header::before {
  content: "";
  display: block;
  width: 3em;
  margin: 0 0 1.4em;
  border-top: 1px solid var(--rule);
}

.article-date {
  margin: 0 0 0.2em;
  font-size: 0.85em;
  line-height: 1.4;
}

.article-date time {
  white-space: nowrap; /* a date never breaks across lines */
}

.article-author {
  margin: 0 0 2.2em; /* the title gets room to breathe, as on the ET Book page */
  font-size: 1em;
  font-weight: 600;
  line-height: 1.4;
}

.article-author a {
  text-decoration: none;
}

.article-author a:hover {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.article-title {
  margin: 0 0 0.55em;
  font-weight: 400; /* roman: ET Book's semi-bold reads heavy at display size */
  font-style: normal;
  font-size: 2.4em;
  line-height: 1.1;
  color: var(--title);
  overflow-wrap: anywhere;
  /* Letterpress, after the Line25 demo (color #222; text-shadow 0 2px 3px
     #555 on a grey sheet): the impression reads from a soft shadow on one
     side and light on the other. On near-white paper there is no lighter
     tone for the highlight, so the ink is lifted a shade and a soft dark
     shadow sits up and to the left, with a soft light down and to the
     right. */
  color: #1e1e1e;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.2),
    1px 1px 1px rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] .article-title {
  color: #e0e0e0;
  text-shadow:
    -1px -1px 1px rgba(255, 255, 255, 0.07),
    1px 1px 2px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .article-title {
    color: #e0e0e0;
    text-shadow:
      -1px -1px 1px rgba(255, 255, 255, 0.07),
      1px 1px 2px rgba(0, 0, 0, 0.6);
  }
}

.article-summary {
  margin: 0 0 2.4em;
  font-size: 1.08em;
  line-height: 1.5;
}

.article-hero {
  margin-top: 0;
  margin-bottom: 2.6em;
}

.article-header + .article-body {
  margin-top: 2.2em;
}

.article-hero + .article-body,
.article-header:has(.article-hero) + .article-body {
  margin-top: 0;
}

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

.article-body > * {
  position: relative;
}

p {
  margin: 0 0 1.3em;
}

/* Drop cap on the opening paragraph, two lines deep by the font's own
   metrics: cap top level with the first line's cap top, baseline on the
   second line's baseline. ET Book: cap height 0.653em, semi-bold ascent
   0.928em, descent 0.309em; body 1em on 1.4 leading. Cap height needed =
   1.4 + 0.653 = 2.053em of body, so the letter is 2.053 / 0.653 = 3.143em.
   With line-height 0.8 its baseline falls 0.71em below its box top; the
   second baseline is 0.994em (body) below the paragraph top; the
   difference, 0.052em of the letter, is the top margin. */
.article-body.drop-cap > p:first-of-type::first-letter {
  float: left;
  margin: 0.052em 0.08em 0 0;
  font-size: 3.143em;
  font-weight: 600;
  line-height: 0.8;
}

/* Heading ladder. Body = 1em. An even gradient from 2.4 down to body
   size: 2.4, 1.7, 1.3, 1.0. Levels one to three are roman weight, as on
   the ET Book specimen page: size carries the hierarchy, and the semi-bold
   cut reads heavy at display sizes. Level four is body-size, so it keeps
   the semi-bold to read as a heading at all, on its own line with a touch
   more space than a paragraph break. All upright; an italic heading is
   written with ##*. More space above than below so a heading attaches to
   what follows it. */

h1,
h2,
h3,
h4 {
  font-weight: 400;
  font-style: normal;
  line-height: 1.2;
  color: var(--title);
  overflow-wrap: anywhere;
}

.article-body h1 {
  margin: 1.8em 0 0.4em;
  font-size: 2.4em;
  line-height: 1.1;
}

h2 {
  margin: 1.9em 0 0.4em;
  font-size: 1.7em;
  line-height: 1.15;
}

h3 {
  margin: 1.8em 0 0.35em;
  font-size: 1.3em;
  line-height: 1.2;
}

h4 {
  margin: 1.7em 0 0.4em;
  font-size: 1em;
  font-weight: 600;
  line-height: 1.4;
}

h1 + p,
h2 + p,
h3 + p,
h4 + p {
  margin-top: 0;
}

/* Italic variant of any heading level, written as ##* in markdown. ET Book
   has one italic cut, so the variant is regular weight at the level's size. */
.heading-italic {
  font-style: italic;
  font-weight: 400;
}

hr {
  width: 30%;
  margin: 2.4em auto;
  border: 0;
  border-top: 1px solid var(--border);
}

/* ---------- Lists ---------- */

/* List rhythm: a whole item (with any children) is separated from the
   next item by the item gap; children sit close under their parent and
   closer to each other. A paragraph inside an item never adds the prose
   gap. */
ul,
ol {
  margin: 0 0 1.3em;
  padding-left: 1.5em;
}

li {
  margin: 0 0 0.85em;
}

li > p {
  margin: 0 0 0.5em;
}

li > p:last-child,
li > p:has(+ ul),
li > p:has(+ ol) {
  margin-bottom: 0;
}

li > ul,
li > ol {
  margin: 0.2em 0 0;
}

li li {
  margin-bottom: 0.15em;
}

li li:last-child {
  margin-bottom: 0;
}

dl {
  margin: 0 0 1.2em;
}

dt {
  font-weight: 600;
  margin-top: 0.6em;
}

dd {
  margin: 0.1em 0 0.5em 1.5em;
}

/* ---------- Quotations ---------- */

blockquote {
  margin: 1.4em 0;
  padding: 0 0 0 1.1em;
  border-left: 2px solid var(--border);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Attribution is marked by form, not by fading: a dash, upright type,
   one step smaller, with the work itself in italic via <cite>. */
blockquote footer {
  margin-top: 0.4em;
  font-size: 0.9em;
  font-style: normal;
}

blockquote footer::before {
  content: "— ";
}

blockquote blockquote {
  margin: 0.8em 0;
}

.epigraph {
  margin: 2em 0;
}

.epigraph blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  font-style: italic;
}

.epigraph blockquote p {
  margin: 0 0 0.4em;
}

.epigraph blockquote footer {
  margin-top: 0.5em;
  font-size: 0.95em;
  text-align: right;
}

figure > blockquote {
  margin: 0;
}

/* ---------- Statute text ---------- */

/* Statute text: set off by a rule and an indent, in the same ink as the
   prose. No background, nothing that imitates a page. */
law,
.law {
  display: block;
  margin: 1.6em 0;
  padding: 0.15em 0 0.15em 1.2em;
  border-left: 2px solid var(--rule);
  font-size: 0.95em;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

law::first-line,
.law::first-line {
  font-weight: 600;
}

/* ---------- Code ---------- */

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.85em;
}

code {
  padding: 0.05em 0.3em;
  background: var(--code-inline-bg);
  border-radius: 0.2em;
}

pre {
  margin: 1.4em 0;
  padding: 1em 1.2em;
  background: var(--code-bg);
  border-radius: 0.25em;
  line-height: 1.5;
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: none;
  font-size: 1em;
}

/* Syntax colors: code is the one place the page uses color. A restrained
   conventional palette, with a counterpart for dark mode. */
:root {
  --code-comment: #6a737d;
  --code-keyword: #d73a49;
  --code-string: #032f62;
  --code-number: #005cc5;
  --code-function: #6f42c1;
  --code-tag: #22863a;
  --code-attr: #005cc5;
}

:root[data-theme="dark"] {
  --code-comment: #8b949e;
  --code-keyword: #ff7b72;
  --code-string: #a5d6ff;
  --code-number: #79c0ff;
  --code-function: #d2a8ff;
  --code-tag: #7ee787;
  --code-attr: #79c0ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --code-comment: #8b949e;
    --code-keyword: #ff7b72;
    --code-string: #a5d6ff;
    --code-number: #79c0ff;
    --code-function: #d2a8ff;
    --code-tag: #7ee787;
    --code-attr: #79c0ff;
  }
}

.token.comment,
.token.prolog,
.token.cdata {
  color: var(--code-comment);
  font-style: italic;
}

.token.keyword,
.token.important,
.token.atrule,
.token.rule {
  color: var(--code-keyword);
}

.token.string,
.token.char,
.token.template-string,
.token.url {
  color: var(--code-string);
}

.token.number,
.token.boolean,
.token.constant,
.token.symbol {
  color: var(--code-number);
}

.token.function,
.token.class-name,
.token.selector {
  color: var(--code-function);
}

.token.tag,
.token.title,
.token.bold {
  color: var(--code-tag);
}

.token.attr-name,
.token.property,
.token.variable,
.token.key {
  color: var(--code-attr);
}

.token.punctuation,
.token.operator,
.token.attr-value {
  color: inherit;
}

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

table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.4;
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.35em 0.9em 0.35em 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
}

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

figure {
  margin: 1.8em 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* Captions sit centered under the image, never wider than the text column. */
figcaption {
  max-width: var(--measure);
  margin: 0.6em auto 0;
  font-size: 0.85em;
  line-height: 1.45;
  text-align: center;
}

.figure-credit,
.photo-essay-credit {
  display: inline-block;
  margin-left: 0.5em;
  font-style: italic;
}

/* Quiet figures keep their caption for readers who open the image and for
   assistive technology, but do not print it under the picture. The hero
   is always quiet; add class="quiet" to any other figure. */
.article-hero figcaption,
figure.quiet figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

figure img.is-zoomable {
  cursor: zoom-in;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1400px);
  text-align: center;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.lightbox-caption {
  max-width: var(--measure);
  margin: 0.8em auto 0;
  font-size: 0.9em;
  line-height: 1.45;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  appearance: none;
  background: none;
  border: 0;
  padding: 0.25rem 0.5rem;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  color: inherit;
  cursor: pointer;
}

/* Figure widths, all centered on the text column: the column itself,
   wide, wider, and the full viewport. Each is capped at the viewport less
   the gutters, so on a phone they all collapse to the column. The older
   class names from existing posts map onto the same four. */
.photo-essay-figure.is-narrow {
  width: 70%;
  margin-left: 15%;
}

.photo-essay-figure.is-portrait {
  width: 50%;
  margin-left: 25%;
}

figure.wide,
figure.wide-media,
figure.fullwidth,
figure.fullwidth-figure,
.photo-essay-figure.is-wide {
  --figure-width: min(var(--wide-width), calc(100vw - 2 * var(--gutter)));
  width: var(--figure-width);
  margin-left: calc((100% - var(--figure-width)) / 2);
}

figure.wider,
.photo-essay-figure.is-wider {
  --figure-width: min(var(--wider-width), calc(100vw - 2 * var(--gutter)));
  width: var(--figure-width);
  margin-left: calc((100% - var(--figure-width)) / 2);
}

figure.full,
.photo-essay-figure.is-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

figure.full figcaption,
.photo-essay-figure.is-full figcaption {
  padding: 0 var(--gutter);
}

/* ---------- Chart furniture ---------- */

.chart-wrap {
  width: 100%;
  min-width: 0;
  color: var(--text);
}

.chart-wrap svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.chart-wrap svg text,
.chart-wrap svg tspan {
  font-family: var(--mono);
}

.chart-wrap svg text:not([fill]),
.chart-wrap svg tspan:not([fill]) {
  fill: currentColor;
}

.chart-body-readout {
  font-size: 1em;
}

p.meta {
  font-size: 0.85em;
  font-style: italic;
}

.chart-data-readout {
  font-family: var(--mono);
  font-size: 0.8em;
  line-height: 1.5;
}

.chart-section-note {
  font-size: 0.85em;
}

/* A live number set in the chart face, at prose size, as it always was. */
.operational-flow-readout {
  margin: 0.2em 0 1em;
  font-family: var(--mono);
  font-size: 0.9em;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.tufte-chart-block {
  margin: 1.6em 0;
}

.tufte-chart-wrap {
  width: 100%;
}

/* ---------- Sections and asides ---------- */

.collapsible-section {
  margin: 1.6em 0;
  padding-left: 1em;
  border-left: 2px solid var(--border);
}

details {
  margin: 1.2em 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

aside {
  margin: 1.6em 0;
  padding: 0.9em 1.1em;
  border: 1px solid var(--border);
  border-radius: 0.25em;
  font-size: 0.92em;
}

aside > :last-child {
  margin-bottom: 0;
}

/* ---------- Cross references ---------- */

.glossary-ref,
.internal-ref {
  font-variant: small-caps;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.internal-ref-missing {
  border-bottom-style: dashed;
}

/* ---------- Notes ----------
   The reference in the text is only a superscript, and it never changes
   the line height. The note itself sits in the margin column on wide
   screens, positioned out of flow so it cannot stretch its paragraph;
   article-notes.js moves notes down when they would overlap. On narrow
   screens notes hide: a sidenote falls back to its footnote, a margin
   note gets one marker that reveals it in flow. */

/* Raise and size in rem so the sidenote's number, set the same way, lands
   level with the marker when the note sits beside its line. */
sup.footnote-ref {
  position: relative;
  top: -0.32rem;
  vertical-align: baseline;
  margin-left: 0.05em;
  font-size: 0.7rem;
  line-height: 0;
}

sup.footnote-ref a {
  text-decoration: none;
}

.sidenote-footnote-label,
input.margin-toggle,
.marginnote-ref {
  display: none;
}

.marginnote::before,
.marginnote::after,
.sidenote::before,
.sidenote::after {
  content: none;
}

.sidenote,
.marginnote {
  display: none;
}

/* Narrow: one marker for a margin note, and the note opens in flow. */
/* The marker sits where a footnote number would: superscript height,
   taking no line height. */
label.margin-toggle:not(.sidenote-footnote-label) {
  display: inline-block;
  position: relative;
  top: -0.55rem; /* rem: the label's own font-size is 0 to hide its glyph */
  width: 0.42rem;
  height: 0.42rem;
  margin-left: 0.1rem;
  vertical-align: baseline;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

label.margin-toggle:not(.sidenote-footnote-label):hover {
  background: currentColor;
}

/* An opened margin note appears after its paragraph (the script moves it
   there); the sibling rule is the no-script fallback. */
.marginnote.is-open,
input.margin-toggle:checked + .marginnote {
  display: block;
  margin: 0.6em 0 0.2em 1.25em;
  font-size: 0.85em;
  line-height: 1.4;
}

/* The rail: a separate element beside the body that the script moves notes
   into on wide screens, so a selection in the body never includes them. */
.article {
  position: relative;
}

.article-rail {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: inherit;
}

/* From 1280px the right margin beside a centered column is wide enough
   for notes: the rail takes up to --margin-col, or whatever the margin
   allows after the gap and gutter. */
@media (min-width: 1280px) {
  label.margin-toggle:not(.sidenote-footnote-label) {
    display: none;
  }

  .article-rail {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(100% + var(--gap));
    width: min(var(--margin-col), calc((100vw - var(--measure)) / 2 - var(--gap) - var(--gutter)));
    pointer-events: none;
  }

  .article-rail > * {
    pointer-events: auto;
  }

  .article-rail .sidenote,
  .article-rail .marginnote,
  .article-rail .marginnote.is-open {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    font-size: 0.85em;
    line-height: 1.4;
    font-style: normal;
    overflow-wrap: anywhere; /* long URLs in citations break inside the rail */
  }

  /* Before the script runs, or without it, notes stay hidden on wide
     screens rather than appearing mid-paragraph. */
  .article-body .sidenote,
  .article-body .marginnote {
    display: none;
  }

  /* Hanging number, set as the same superscript as the marker in the text:
     same size, same raise, so the two numbers sit level when the note is
     beside its line. */
  .sidenote {
    padding-left: 1.2rem;
    text-indent: -1.2rem;
  }

  /* Margin notes have no number; their text lines up with sidenote text. */
  .article-rail .marginnote {
    padding-left: 1.2rem;
  }

  .sidenote-footnote-index-link {
    display: inline-block;
    width: 1.2rem;
    position: relative;
    top: -0.32rem;
    text-indent: 0;
    vertical-align: baseline;
    font-size: 0.7rem;
    line-height: 0;
    text-decoration: none;
  }
}

/* ---------- Footnotes ---------- */

hr.footnotes-sep {
  display: none;
}

.footnotes {
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
  font-size: 0.9em;
  line-height: 1.5;
}

.footnotes ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footnote-item {
  position: relative;
  margin: 0 0 0.6em;
  padding-left: 1.8em;
}

.footnote-item p {
  display: inline;
  margin: 0;
}

.footnote-index-link {
  position: absolute;
  left: 0;
  text-decoration: none;
}

.footnote-backref {
  margin-left: 0.3em;
  text-decoration: none;
}

.footnote-item:target {
  background: var(--highlight);
}

/* ---------- Fonts the chart scripts label with ---------- */

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-400.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-500.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-600.ttf") format("truetype");
}

/* ---------- Chart rules carried over from the old stylesheet ---------- */

.chart-wrap svg text,
.chart-wrap svg tspan {
  fill: var(--text);
}

.chart-wrap svg .domain,
.chart-wrap svg .tick line {
  stroke: color-mix(in srgb, var(--text) 44%, transparent);
}

.chart-wrap svg [stroke="#ffffff"],
.chart-wrap svg [stroke="#fff"],
.chart-wrap svg [stroke="#f2f2f2"] {
  stroke: currentColor;
}

.chart-wrap svg [fill="#ffffff"],
.chart-wrap svg [fill="#fff"],
.chart-wrap svg [fill="#f2f2f2"] {
  fill: currentColor;
}

/* ---------- Home ---------- */

/* The home page is wider than an article: the name across the top, then
   two columns, a narrow one for the bio and a wider one for the threads and
   the writing feed. Below 860px the columns stack: about, threads, writing. */
.home-page {
  --home-width: 47rem;
  --home-aside: 13.5rem;
}

.home-page .article {
  width: min(100% - 2 * var(--gutter), var(--home-width));
}

.home-page .article-rail {
  display: none;
}

.home-head {
  margin: 0 0 2.6em;
}

.home-head .article-title {
  margin: 0.4em 0 0;
  font-size: 2em; /* smaller than an article title; the page has no body to balance it */
}

.home-grid {
  display: grid;
  grid-template-columns: var(--home-aside) minmax(0, 1fr);
  grid-template-areas:
    "about threads"
    "about writing";
  grid-template-rows: auto 1fr;
  align-content: start;
  column-gap: 3.5rem;
}

.home-about {
  grid-area: about;
}

.home-threads {
  grid-area: threads;
}

.home-writing {
  grid-area: writing;
  margin-top: 1.4em;
}

.home-label {
  margin: 0 0 1em;
  font-size: 1.1em;
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
}

.home-about p {
  line-height: 1.45;
}

.home-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-feed > li {
  margin: 0 0 1.7em;
}

.home-feed-date {
  display: block;
  margin: 0 0 0.2em;
  font-size: 0.8em;
  line-height: 1.4;
}

.home-feed-title {
  margin: 0;
  font-size: 1.2em;
  font-weight: 400;
  line-height: 1.25;
}

/* Titles are links by position, not by underline. On hover the title takes
   the letterpress of the page title: the ink lifts a shade and the
   impression shows. */
.home-feed-title a {
  text-decoration: none;
  transition: color 120ms ease, text-shadow 120ms ease;
}

.home-feed-title a:hover {
  text-decoration: none;
  color: #1e1e1e;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.2),
    1px 1px 1px rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] .home-feed-title a:hover {
  color: #e0e0e0;
  text-shadow:
    -1px -1px 1px rgba(255, 255, 255, 0.07),
    1px 1px 2px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home-feed-title a:hover {
    color: #e0e0e0;
    text-shadow:
      -1px -1px 1px rgba(255, 255, 255, 0.07),
      1px 1px 2px rgba(0, 0, 0, 0.6);
  }
}

.home-feed-excerpt {
  margin: 0.3em 0 0;
  font-size: 0.82em;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "about"
      "threads"
      "writing";
    grid-template-rows: auto;
  }

  .home-writing,
  .home-threads {
    margin-top: 1.6em;
  }

  .home-head {
    margin-bottom: 2.2em;
  }

  .home-head .article-title {
    margin-top: 0;
  }
}

/* ---------- Index pages: home, essays, tags, search, charts ---------- */

.index-page .article-body > h1:first-child {
  margin-top: 0;
}

.post-list,
.home-post-list,
.collection-post-list,
.home-case-study-list,
.tag-index-list,
.saved-index-list {
  list-style: none;
  margin: 0 0 2em;
  padding: 0;
}

.post-list > li,
.home-case-study-list > li,
.saved-index-list > li {
  margin: 0 0 1.5em;
}

.post-list > li > a,
.home-case-study-list > li > a {
  font-weight: 600;
  text-decoration: none;
}

.post-list > li > a:hover,
.home-case-study-list > li > a:hover {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.post-list .meta,
.post-list .post-excerpt,
.home-case-study-list p {
  margin: 0.1em 0 0;
}

.post-list .meta {
  font-size: 0.85em;
}

.meta-icon,
.nav-search-icon,
.search-field-icon {
  display: none;
}

.archive-year {
  margin-top: 1.6em;
}

.archive-month {
  margin-top: 1.2em;
}

.count-sup {
  font-size: 0.6em;
  margin-left: 0.3em;
}

.tag-index-item {
  display: inline-block;
  margin: 0 1em 0.4em 0;
}

.tag-index-count {
  font-size: 0.8em;
  margin-left: 0.2em;
}

.posts-search-input {
  width: 100%;
  margin: 0 0 1em;
  padding: 0.45em 0.6em;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.2em;
}

.posts-search-count,
.posts-search-empty {
  font-size: 0.9em;
}

/* ---------- Photo essays and case-study pages ---------- */

.article-eyebrow {
  margin: 0 0 0.3em;
  font-size: 0.85em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-meta-line {
  margin: -1.6em 0 2.2em;
  font-size: 0.9em;
}

.photo-essay-figure {
  margin: 1.8em 0;
}

.case-study-category-title {
  margin-top: 2.4em;
}

.case-study-context-blurb {
  font-size: 1.08em;
  line-height: 1.5;
}

.home-hero-figure,
.post-page-hero {
  margin: 0 0 2em;
}
