/* One typeface from the reader's own machine, ink on paper, one colour for links.
   Rules and tables, no boxes. */

:root {
  --paper: #fcfcfa;
  --ink: #1b1b1b;
  --muted: #5c5c58;
  --rule: #d8d6cf;
  --link: #123f8c;
  --bad: #9a1b1b;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.wrap {
  max-width: 70rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}
.wrap.narrow { max-width: 46rem; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1 {
  font-size: 2.5rem;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  max-width: 20em;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 3.25rem 0 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--ink);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.25rem;
}

p, ul, ol { margin: 0 0 0.9rem; }
section > p, header > p, .plain, .log, .claims, .scale { max-width: 44rem; }

.counter { font-size: 1.3rem; line-height: 1.35; margin-bottom: 0.6rem; }
.dateline, .note, .by, .did, .shown, .flabel { color: var(--muted); font-size: 0.9rem; }
.lede { font-size: 1.2rem; line-height: 1.4; }
.back { margin-bottom: 2rem; font-size: 0.9rem; }
.banner { font-weight: 600; }

nav { margin-top: 1.25rem; font-size: 0.95rem; }
nav a { margin-right: 1.1rem; white-space: nowrap; display: inline-block; }

abbr { text-decoration: none; cursor: help; }

/* Tables */

table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 1.25rem 0.6rem 0;
  border-top: 1px solid var(--rule);
  font-weight: 400;
}
thead th {
  border-top: 0;
  color: var(--muted);
  font-size: 0.85rem;
  padding-bottom: 0.35rem;
  white-space: nowrap;
}
td:last-child, th:last-child { padding-right: 0; }

.marks { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; width: 5.5rem; }
.what a, .question { font-weight: 600; }
.did { display: block; font-weight: 400; margin-top: 0.15rem; }
.reg td[data-label] { white-space: nowrap; font-size: 0.95rem; }

.numbers th[scope="row"] { width: 44%; }
.numbers td { font-size: 1.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.numbers td:last-child { color: var(--muted); }

.facts { max-width: 44rem; margin-top: 1.5rem; }
.facts th { width: 11rem; color: var(--muted); font-size: 0.9rem; }

.firsts .question { width: 17%; }
.firsts .words { width: 36%; }
.firsts .status { width: 11%; font-weight: 600; }
.firsts .why { font-size: 0.95rem; }
.status.bad { color: var(--bad); }

/* Quotations */

.q { margin: 0 0 0.2rem; }
.by { margin: 0 0 0.7rem; }
.words .by:last-child, .why .by { margin-bottom: 0; }
.why .by { margin-top: 0.4rem; }

.claims { list-style: none; padding: 0; }
.claims li { border-top: 1px solid var(--rule); padding: 0.8rem 0 0.1rem; }
.claims li:target { background: #f1efe6; }
.claims .q { font-size: 1.1rem; line-height: 1.45; }

/* Lists */

.plain, .log, .scale { list-style: none; padding: 0; }
.plain li, .log li { border-top: 1px solid var(--rule); padding: 0.55rem 0; }
.log time { color: var(--muted); margin-right: 0.5rem; white-space: nowrap; }
.scale li { padding: 0.15rem 0 0.15rem 2rem; text-indent: -2rem; font-size: 0.95rem; }
.scale b { display: inline-block; min-width: 2rem; text-indent: 0; }
.scales { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; max-width: 60rem; }
.scales .scale { max-width: none; }

/* Filters */

.filters { margin-bottom: 0.5rem; }
.filters p { margin: 0 0 0.3rem; max-width: none; }
.flabel { display: inline-block; min-width: 8.5rem; }
button {
  font: inherit;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0.1rem 0;
  margin-right: 0.9rem;
  cursor: pointer;
}
button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.shown { min-height: 1.4rem; }
tr[hidden] { display: none; }

/* Narrow screens: each table row becomes a short block. */

@media (max-width: 46rem) {
  body { font-size: 1rem; }
  .wrap { padding: 1.5rem 1rem 4rem; }
  h1 { font-size: 1.8rem; }
  h2 { margin-top: 2.5rem; }
  .counter { font-size: 1.15rem; }
  .scales { grid-template-columns: 1fr; }

  .reg thead, .firsts thead { display: none; }
  .reg tr, .firsts tr { display: block; border-top: 1px solid var(--rule); padding: 0.7rem 0; }
  .reg tr[hidden] { display: none; }
  .reg td, .firsts td { display: block; border: 0; padding: 0; width: auto; }
  .reg .marks { width: auto; margin-bottom: 0.1rem; }
  .reg td[data-label] { display: inline-block; margin: 0.3rem 1rem 0 0; color: var(--muted); font-size: 0.9rem; white-space: normal; }
  .reg td[data-label]::before, .firsts td[data-label]::before { content: attr(data-label) ": "; }
  .firsts td { margin-bottom: 0.5rem; }
  .firsts .question, .firsts .words, .firsts .status { width: auto; }
  .firsts td[data-label]::before { color: var(--muted); font-weight: 400; }

  .numbers thead { display: none; }
  .numbers tr { display: block; border-top: 1px solid var(--rule); padding: 0.6rem 0; }
  .numbers th, .numbers td { display: block; border: 0; padding: 0; width: auto; }
  .numbers th[scope="row"] { width: auto; }
  .numbers td { white-space: normal; }
  .numbers td:last-child { font-size: 0.9rem; }
  .numbers td:last-child::before { content: "Before: "; }

  .facts th { width: 8rem; }
  .flabel { display: block; min-width: 0; }
  .filters p { margin-bottom: 0.5rem; }
  .filters button { padding: 0.55rem 0; margin-right: 1.25rem; }
  nav a { padding: 0.35rem 0; margin-right: 1.25rem; }
}
