/* Shared stylesheet for every lesson and reference sheet in this workspace. */
:root {
  --ink: #1f1d1a;
  --muted: #6b665e;
  --paper: #fffdf8;
  --rule: #e4ded2;
  --accent: #8a2c1d;
  --good: #2f6b3a;
  --bad: #9b2c2c;
  --wash: #f5f0e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

header .kicker {
  font: 600 0.75rem/1 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 { font-size: 2.1rem; line-height: 1.2; margin: 0.4rem 0 0.6rem; font-weight: 500; }
h2 { font-size: 1.35rem; margin: 2.6rem 0 0.6rem; font-weight: 600; border-top: 1px solid var(--rule); padding-top: 1.4rem; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 0.4rem; }

.lede { font-size: 1.15rem; color: var(--muted); font-style: italic; }

a { color: var(--accent); }
code, kbd { font: 0.85em/1.4 "Cascadia Code", Consolas, monospace; background: var(--wash); padding: 0.05em 0.3em; border-radius: 3px; }

.cite { font-size: 0.75em; vertical-align: super; line-height: 0; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font: 600 0.75rem/1.3 system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
td.id { font-weight: 600; white-space: nowrap; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--wash);
  padding: 0.8rem 1rem;
  margin: 1.4rem 0;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.aside { font-size: 0.88rem; color: var(--muted); }

.win {
  border: 1px solid var(--good);
  padding: 0.8rem 1rem;
  margin: 1.4rem 0;
}
.win strong { color: var(--good); }

.warmup { border-left: 3px solid var(--muted); }
.warmup::before {
  content: "Warm-up · from earlier lessons";
  display: block;
  font: 600 0.72rem/1 system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.evidence {
  font: 0.88rem/1.5 "Cascadia Code", Consolas, monospace;
  background: white;
  border: 1px solid var(--rule);
  padding: 0.7rem 0.9rem;
  margin: 0.8rem 0;
  white-space: pre-wrap;
}

figure { margin: 1.4rem 0; }
figure img { max-width: 100%; display: block; margin: 0 auto; }
figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.4rem; }

footer nav.pager { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
footer nav.pager a { margin: 0; }

footer { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1rem; font-size: 0.9rem; color: var(--muted); }
footer nav a { margin-right: 1rem; }

/* Reference sheets: denser, two columns on wide screens, print on one page where possible. */
body.reference main { max-width: 60rem; }
body.reference h2 { margin-top: 1.6rem; }
.columns { column-count: 2; column-gap: 2.5rem; }
.columns > * { break-inside: avoid; }
@media (max-width: 50rem) { .columns { column-count: 1; } }

@media print {
  body { font-size: 11pt; background: white; }
  main { padding: 0; max-width: none; }
  .mcq button, .drill .score, .recall textarea, .recall button { display: none; }
  .drill { background: none; padding: 0; }
  .recall .model { display: block !important; }
  .recall .model::before { content: "Model answer: "; font-weight: 600; }
  a { color: inherit; text-decoration: none; }
}
