/* course.css — shared stylesheet for the "Pocock Skills" teaching workspace.
   Tufte-flavoured: generous margins, serif body, restrained palette, print-friendly. */

:root {
  --ink: #1a1a1a;
  --paper: #fdfcf9;
  --muted: #6b6a64;
  --rule: #e2ded3;
  --accent: #8a3324;      /* rust red — Pocock's repo accent vibe */
  --code-bg: #f4f1ea;
  --link: #33577a;
  --good: #2e6b3f;
  --bad: #8a3324;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 4rem 1.5rem 6rem;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* --- typography --- */
h1, h2, h3 { line-height: 1.15; font-weight: 600; }
h1 { font-size: 2.3rem; margin: 0 0 0.3rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin: 3rem 0 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
h3 { font-size: 1.15rem; margin: 1.8rem 0 0.4rem; }
p, li { font-size: 1.02rem; }
a { color: var(--link); text-decoration: none; border-bottom: 1px solid rgba(51,87,122,0.3); }
a:hover { border-bottom-color: var(--link); }

.subtitle { color: var(--muted); font-style: italic; font-size: 1.15rem; margin: 0 0 1.5rem; }
.kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; color: var(--accent);
          font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 700; margin: 0; }

/* --- code --- */
code { font-family: "SF Mono", "JetBrains Mono", Menlo, monospace; font-size: 0.85em;
       background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre { background: var(--code-bg); padding: 1rem 1.2rem; border-radius: 6px; overflow-x: auto;
      border: 1px solid var(--rule); }
pre code { background: none; padding: 0; font-size: 0.82rem; line-height: 1.5; }

/* --- sidenotes / asides --- */
.aside { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.85rem;
         color: var(--muted); background: #f7f5ee; border-left: 3px solid var(--rule);
         padding: 0.8rem 1rem; margin: 1.5rem 0; border-radius: 0 4px 4px 0; }

/* --- callout for a key idea --- */
.key { border: 1px solid var(--rule); border-left: 4px solid var(--accent);
       background: #fff; padding: 1rem 1.2rem; margin: 1.5rem 0; border-radius: 0 6px 6px 0; }
.key strong { color: var(--accent); }

/* --- two-column compare (before/after, good/bad) --- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.compare > div { padding: 0.8rem 1rem; border-radius: 6px; font-size: 0.9rem; }
.compare .neg { background: #faf0ee; border: 1px solid #e6cdc7; }
.compare .pos { background: #eef5ef; border: 1px solid #cadecf; }
.compare h4 { margin: 0 0 0.4rem; font-size: 0.9rem; font-family: ui-sans-serif, system-ui, sans-serif; }
.compare .neg h4 { color: var(--bad); }
.compare .pos h4 { color: var(--good); }
@media (max-width: 40rem) { .compare { grid-template-columns: 1fr; } }

/* --- citations --- */
.cite { font-size: 0.75rem; font-family: ui-sans-serif, system-ui, sans-serif;
        color: var(--muted); vertical-align: super; }
.refs { font-size: 0.85rem; font-family: ui-sans-serif, system-ui, sans-serif; color: var(--muted); }
.refs li { margin-bottom: 0.4rem; }

/* --- footer nav --- */
.nav { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--rule);
       font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.9rem; }
.ask { margin-top: 2rem; background: #f0ece1; border-radius: 6px; padding: 1rem 1.2rem;
       font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.9rem; color: var(--muted); }
.ask strong { color: var(--ink); }

/* --- print --- */
@media print {
  body { max-width: none; padding: 0; font-size: 11pt; background: #fff; }
  h2 { page-break-after: avoid; }
  .quiz, .nav, .ask { page-break-inside: avoid; }
  a { color: var(--ink); border: none; }
}

/* --- quiz widget (pairs with assets/quiz.js) --- */
.quiz { border: 1px solid var(--rule); border-radius: 8px; padding: 1.2rem 1.3rem;
        margin: 1.8rem 0; background: #fff;
        font-family: ui-sans-serif, system-ui, sans-serif; }
.quiz .q { font-weight: 600; margin: 0 0 0.9rem; font-size: 1rem; }
.quiz button { display: block; width: 100%; text-align: left; margin: 0.4rem 0;
               padding: 0.6rem 0.9rem; border: 1px solid var(--rule); border-radius: 5px;
               background: var(--paper); font: inherit; font-size: 0.92rem; cursor: pointer;
               transition: background 0.12s, border-color 0.12s; }
.quiz button:hover:not(:disabled) { border-color: var(--accent); background: #fbf8f2; }
.quiz button:disabled { cursor: default; opacity: 0.85; }
.quiz button.correct { background: #eef5ef; border-color: var(--good); color: var(--good); font-weight: 600; }
.quiz button.wrong { background: #faf0ee; border-color: var(--bad); color: var(--bad); }
.quiz .explain { margin: 0.9rem 0 0; padding-top: 0.8rem; border-top: 1px dashed var(--rule);
                 font-size: 0.9rem; color: var(--muted); }
