/* Same reading foundation as 24-130-readings; a different typographic voice. */
:root {
  color-scheme: light;
  --fill-bg: #e8eee5;
  --fill-text: #342538;
  --fill-accent: #a3341c;
  --fill-soft: #dce3d8;
  --fill-highlight: #d5c4fa;
  --fill-special: var(--fill-accent);
  --font-body: 'STIX Two Text', Georgia, serif;
  --font-title: 'Dela Gothic One', 'Arial Black', sans-serif;
  --font-label: 'Fragment Mono', monospace;
  --font-mono: 'Fragment Mono', monospace;
  --font-narrow: var(--font-body);
  --line-height-body: 1.8;
}

* { box-sizing: border-box; }
body { margin: 0; width: auto; font-weight: 400; }
main { max-width: 780px; margin: auto; padding: 56px 27px 100px; }
header { padding-bottom: 20pt; }
.reading-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tag, .tag-light {
  font-family: var(--font-label);
  font-size: 0.84em;
  line-height: 1.7;
  color: var(--fill-accent);
}
.download { border: 0; padding: 3px 8px; background-color: var(--fill-soft); }

h1, h2 {
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.3;
  hyphens: none;
}
.title { font-size: clamp(2.45rem, 8.7vw, 4.5rem); line-height: 1.1; margin-bottom: 24px; }
.subtitle { margin: 0; }
.reading-meta { margin: 8px 0 28px; font-size: 0.73em; }
.reading-meta span { margin: 0 7px; }
h2 { margin-top: 56px; font-size: 1.45em; scroll-margin-top: 28px; }
h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-style: italic;
  font-size: 1.24em;
  letter-spacing: 0;
  line-height: 1.35;
  scroll-margin-top: 28px;
}
p { margin: 20pt 0; }
strong, b { font-weight: 700; }

article { border-top: 3px double var(--fill-accent); margin-top: 28px; padding-top: 4px; overflow-wrap: anywhere; }
article > p:first-child { font-size: 1.08em; }
article > h2:first-of-type { margin-top: 40px; }
blockquote {
  margin-inline: 0;
  padding-left: 24px;
  border-left: 3px solid var(--fill-accent);
  font-size: 1.08em;
}
blockquote strong { font-weight: 600; }
article > ul, article > ol { padding-left: 28px; }
li { margin-block: 8px; }
li::marker { color: var(--fill-accent); }

pre {
  background: var(--fill-soft);
  border-left: 3px solid var(--fill-accent);
  border-radius: 0;
  padding: 20px 24px;
  overflow: auto;
  font-size: 0.76em;
  line-height: 1.7;
  tab-size: 2;
}
code { font-size: 0.8em; overflow: visible; padding: 2px 4px; }
pre code { font-size: inherit; padding: 0; }
table { display: table; width: 100%; table-layout: fixed; font-size: 0.93em; line-height: 1.55; }
th, td { padding: 12px 16px; text-wrap: pretty; }
th { font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }

.contents { padding: 13px 18px; background: var(--fill-soft); }
.contents summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-label);
  font-size: 0.76em;
  color: var(--fill-accent);
  cursor: pointer;
  list-style: none;
}
.contents summary::before { content: '+'; width: 1ch; font-size: 1.15em; }
.contents[open] summary::before { content: '−'; }
.contents-note { margin-left: auto; }
.contents nav { margin-top: 16px; border-top: 1px dotted var(--fill-accent); padding-top: 10px; }
.contents nav ul { padding-left: 0; list-style: none; }
.contents nav li { margin: 12px 0; line-height: 1.55; }
.contents nav a { border-bottom-width: 1px; }

footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 3px double var(--fill-accent);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}
a { background-image: linear-gradient(var(--fill-highlight), var(--fill-highlight)); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
a:hover, a:active, a:focus { color: #342538; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--fill-accent); outline-offset: 5px; }
::selection { background: var(--fill-highlight); color: #342538; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 1; padding: 8px 14px; background: var(--fill-bg); }
.skip-link:focus { top: 12px; }
#review { scroll-margin-top: 24px; }

@media (max-width: 500px) {
  main { padding: 28px 22px 64px; }
  header { padding-bottom: 12px; }
  .title { margin-top: 44px; }
  h2 { font-size: 1.22em; }
  .reading-nav .tag { font-size: 0.74em; }
  blockquote { padding-left: 18px; }
  pre { padding: 16px; }
  th, td { padding: 10px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fill-bg: #18271f;
    --fill-text: #e7efdd;
    --fill-accent: #ff9a7b;
    --fill-soft: #27382d;
    --fill-highlight: #c5b5ff;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media print {
  :root { --fill-bg: white; --fill-text: black; --fill-accent: #555; --fill-soft: #eee; }
  main { max-width: none; padding: 0; }
  header, .contents, footer, .skip-link { display: none; }
  .title { font-size: 36pt; margin-top: 0; }
  h2, h3 { break-after: avoid; }
  pre, blockquote, tr { break-inside: avoid; }
  a { background: none; }
}
