/* Shared stylesheet for every lesson and reference page in this workspace. */
:root {
  --ink: #1d1d1f;
  --muted: #6b6b6b;
  --accent: #1f4e8c;
  --ok: #1e7b34;
  --ok-bg: #eaf6ec;
  --bad: #b3261e;
  --bad-bg: #fbeceb;
  --rule: #e2e2e2;
  --paper: #fffff8;
  --opp: #c2410c;   /* colour for "opposite" pairings */
  --adj: #1d4ed8;   /* colour for "adjacent" */
  --hyp: #15803d;   /* colour for "hypotenuse" */
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 760px;
  padding: 40px 22px 90px;
  background: var(--paper);
  color: var(--ink);
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
}

nav.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 26px; }
nav.crumbs a { color: var(--muted); }

h1 { font-weight: normal; font-size: 2.1rem; line-height: 1.2; margin: 0 0 6px; }
.subtitle { font-style: italic; color: var(--muted); margin: 0 0 30px; }
h2 { font-weight: normal; font-style: italic; font-size: 1.45rem; margin: 42px 0 10px; }
h3 { font-weight: normal; font-size: 1.1rem; margin: 26px 0 6px; }

a { color: var(--accent); }

.big-idea {
  border-left: 4px solid var(--accent);
  padding: 6px 0 6px 18px;
  margin: 24px 0;
  font-size: 1.15rem;
}

ol.steps { padding-left: 1.4em; }
ol.steps li { margin: 6px 0; }

.worked {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  background: #fff;
}
.worked .label { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.side-note { font-size: .88rem; color: var(--muted); }

figure { margin: 20px 0; text-align: center; }
figure svg { max-width: 100%; height: auto; }
figcaption { font-size: .85rem; color: var(--muted); font-style: italic; }

.opp { color: var(--opp); font-weight: bold; }
.adj { color: var(--adj); font-weight: bold; }
.hyp { color: var(--hyp); font-weight: bold; }

table.pairs { border-collapse: collapse; margin: 14px auto; }
table.pairs th, table.pairs td { border-bottom: 1px solid var(--rule); padding: 6px 16px; text-align: center; }
table.pairs th { font-weight: normal; font-style: italic; color: var(--muted); }

.callout {
  background: #fff7e6;
  border: 1px solid #f3d9a4;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 20px 0;
}

footer.next {
  margin-top: 50px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: .95rem;
}

/* Quiz component (assets/quiz.js) */
.quiz-item { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 18px; margin: 16px 0; background: #fff; }
.quiz-item .quiz-q { margin: 0 0 10px; }
.quiz-item .quiz-num { color: var(--muted); font-size: .85rem; }
.quiz-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.quiz-choices button {
  font: inherit; font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid #d0d0d0; border-radius: 8px;
  background: #fafafa; color: var(--ink);
  cursor: pointer;
}
.quiz-choices button:hover:not(:disabled) { background: #eef3fa; }
.quiz-choices button:disabled { cursor: default; }
.quiz-choices button.right { border-color: var(--ok); background: var(--ok-bg); }
.quiz-choices button.wrong { border-color: var(--bad); background: var(--bad-bg); }
.quiz-why { margin-top: 10px; font-size: .95rem; display: none; }
.quiz-why.show { display: block; }
.quiz-why .verdict-right { color: var(--ok); font-weight: bold; }
.quiz-why .verdict-wrong { color: var(--bad); font-weight: bold; }
.quiz-score { font-weight: bold; margin-top: 12px; }

/* Practice-test component (assets/test.js) */
.test-q { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 18px; margin: 18px 0; background: #fff; break-inside: avoid; }
.test-q h3 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 1rem; color: var(--accent); }
.test-skill { color: var(--muted); font-size: .8rem; font-style: italic; }
.test-stem p { margin: 6px 0; }
.test-stem img, .test-choices img { display: block; margin: 10px auto; max-width: 100%; height: auto; }
.test-stem table { border-collapse: collapse; margin: 10px auto; }
.test-stem td, .test-stem th { border: 1px solid #bbb; padding: 4px 12px; text-align: center; }
.test-choices { list-style: none; padding: 0; margin: 10px 0 0; }
.test-choices li { margin: 6px 0; }
.test-choices label { display: flex; gap: 10px; align-items: center; padding: 6px 12px; border: 1px solid #e3e3e3; border-radius: 8px; cursor: pointer; }
.test-choices label:hover { background: #eef3fa; }
.test-choices.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.test-choices.grid li { margin: 0; }
.test-letter { font-weight: bold; min-width: 1.2em; }
.test-choices label.right { border-color: var(--ok); background: var(--ok-bg); }
.test-choices label.wrong { border-color: var(--bad); background: var(--bad-bg); }
.test-work { margin-top: 10px; border-top: 1px dashed #ccc; min-height: 90px; color: #aaa; font-size: .75rem; padding-top: 3px; }
.graded .test-work { display: none; }
.test-after { display: none; }
.graded .test-after { display: block; }
.test-result { margin-top: 10px; font-weight: bold; }
.test-result.ok { color: var(--ok); }
.test-result.bad { color: var(--bad); }
.test-after summary { cursor: pointer; color: var(--accent); }
.test-explain { background: #f6f6f1; border-radius: 8px; padding: 8px 14px; margin-top: 8px; font-size: .95rem; }
.test-bar { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--rule); padding: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.test-bar button { font: inherit; font-size: .95rem; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.test-bar button.secondary { background: #fff; color: var(--accent); }
.test-bar button:disabled { opacity: .5; cursor: default; }
.test-clock { font-size: .9rem; color: var(--muted); }
.test-clock.over { color: var(--bad); font-weight: bold; }
.test-score { font-weight: bold; }
table.test-skills { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.test-skills th, table.test-skills td { border-bottom: 1px solid var(--rule); padding: 5px 10px; text-align: left; }
table.test-skills th { font-weight: normal; font-style: italic; color: var(--muted); }
table.test-skills tr.miss td:first-child { color: var(--bad); }

@media print {
  body { background: #fff; font-size: 12pt; padding: 0; max-width: none; }
  .test-after, .test-summary { display: none !important; }
  .test-choices label { border: none; padding: 2px 0; }
  nav.crumbs, footer.next, .no-print { display: none; }
  .quiz-choices button { border-color: #999; }
  a { color: inherit; text-decoration: none; }
}
