/* Shared course stylesheet: every lesson and reference doc links this. */
@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600&display=swap");

:root {
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --rule: #e3e1dc;
  --paper: #fdfcf8;
  --panel: #f5f3ec;
  --accent: #0d5eaf;        /* Greek flag blue */
  --accent-soft: #e6eef8;
  --good: #1e7b4f;
  --good-soft: #e5f3ec;
  --bad: #b23a3a;
  --bad-soft: #f8e7e7;
  --map-sea: #d3e3f3; --map-greece: #fdfcf8; --map-greece-edge: #8aa6c4; --map-other: #ebe8e1; --map-other-edge: #c9c4b8;
  --serif: "EB Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9e7e2; --muted: #a09d97; --rule: #3a3936; --paper: #1a1a19;
    --panel: #242422; --accent: #6aa6e8; --accent-soft: #1f2d3d;
    --good: #5cc18f; --good-soft: #1c3127; --bad: #e57b7b; --bad-soft: #3a2222;
    --map-sea: #16222f; --map-greece: #2b2b29; --map-greece-edge: #5f7d9c; --map-other: #222220; --map-other-edge: #3a3936;
  }
}

* { box-sizing: border-box; }
html { font-size: 19px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 44rem; margin: 0 auto; padding: 3rem 1rem 5rem; }

/* Header */
.kicker { font-family: var(--sans); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 .4rem; }
h1 { font-weight: 500; font-size: 2.3rem; line-height: 1.15; margin: 0 0 .6rem; }
h2 { font-weight: 500; font-size: 1.45rem; margin: 2.6rem 0 .6rem;
  border-top: 1px solid var(--rule); padding-top: 1.4rem; }
h3 { font-weight: 600; font-size: 1.1rem; margin: 1.6rem 0 .4rem; }
.lede { font-size: 1.2rem; color: var(--muted); font-style: italic; margin: 0 0 1.5rem; }
.meta { font-family: var(--sans); font-size: .78rem; color: var(--muted); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
sup.cite a { font-family: var(--sans); font-size: .65rem; text-decoration: none; }
code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: .85em; }
.greek { font-family: var(--serif); font-size: 1.15em; letter-spacing: .02em; }

/* Callouts */
.box { background: var(--panel); border-left: 3px solid var(--accent);
  padding: .9rem 1.1rem; margin: 1.4rem 0; border-radius: 0 6px 6px 0; }
.box.goal { background: var(--accent-soft); }
.box p:first-child { margin-top: 0; } .box p:last-child { margin-bottom: 0; }
.box-title { font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
th { font-family: var(--sans); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; text-align: left; border-bottom: 1px solid var(--ink); padding: .35rem .5rem; }
td { border-bottom: 1px solid var(--rule); padding: .4rem .5rem; vertical-align: top; }
td.big { font-size: 1.5rem; line-height: 1.1; white-space: nowrap; }

/* Letter tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: .6rem; margin: 1rem 0; }
.tile { border: 1px solid var(--rule); border-radius: 8px; padding: .55rem .5rem .5rem; text-align: center; background: var(--paper); }
.tile .glyph { font-size: 2rem; line-height: 1.1; }
.tile .name { font-family: var(--sans); font-size: .68rem; color: var(--muted); }
.tile .sound { font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--accent); margin-top: .15rem; }
.tile.warn { border-color: var(--bad); }
.tile.warn .sound { color: var(--bad); }

/* Next / footer */
.next { font-family: var(--sans); font-size: .85rem; display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1rem; }
footer.sources { font-size: .85rem; color: var(--muted); }
footer.sources ol { padding-left: 1.2rem; }

/* Quiz component (see quiz.js) */
.quiz { font-family: var(--sans); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.2rem 1.2rem 1rem; margin: 1.4rem 0; background: var(--panel); }
.quiz-progress { font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .6rem; }
.quiz-prompt { font-family: var(--serif); font-size: 1.15rem; margin-bottom: .8rem; }
.quiz-prompt .greek { font-size: 2.2rem; display: block; text-align: center; margin: .3rem 0; letter-spacing: .06em; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
@media (max-width: 520px) { .quiz-options { grid-template-columns: 1fr; } }
.quiz button, .quiz input { font: inherit; font-size: .95rem; }
.quiz-opt { text-align: left; padding: .6rem .8rem; border: 1px solid var(--rule); border-radius: 7px;
  background: var(--paper); color: var(--ink); cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt.correct { background: var(--good-soft); border-color: var(--good); }
.quiz-opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.quiz-row { display: flex; gap: .5rem; }
.quiz input[type=text] { flex: 1; padding: .6rem .8rem; border: 1px solid var(--rule); border-radius: 7px;
  background: var(--paper); color: var(--ink); }
.quiz .btn { padding: .55rem 1rem; border-radius: 7px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; font-weight: 500; }
.quiz .btn.ghost { background: transparent; color: var(--accent); }
.quiz-feedback { margin-top: .8rem; font-size: .9rem; min-height: 1.2rem; }
.quiz-feedback.good { color: var(--good); } .quiz-feedback.bad { color: var(--bad); }
.quiz-feedback .explain { color: var(--ink); display: block; margin-top: .25rem; font-family: var(--serif); font-size: 1rem; }
.quiz-actions { margin-top: .9rem; display: flex; gap: .5rem; justify-content: flex-end; }
.quiz-score { font-family: var(--serif); font-size: 1.2rem; }

/* Print */
@media print {
  html { font-size: 11pt; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .quiz, .next, .no-print { display: none !important; }
  h2 { break-after: avoid; } table, .tile, .box { break-inside: avoid; }
  a { color: #000; }
}

/* Speak buttons (see speak.js) */
.say-btns { white-space: nowrap; margin-left: .35rem; }
button.say { font-family: var(--sans); font-size: .7rem; line-height: 1; padding: .22rem .4rem; margin-left: .15rem;
  border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); color: var(--accent); cursor: pointer; vertical-align: middle; }
button.say:hover { border-color: var(--accent); }

/* Phrase lines: Greek, then how to say it, then meaning */
.phrase { margin: .9rem 0; }
.phrase .gr { font-size: 1.3rem; }
.phrase .say-as { font-family: var(--sans); font-size: .8rem; color: var(--accent); }
.phrase .en { color: var(--muted); font-style: italic; }

/* Builder (see builder.js) */
.builder { border: 1px solid var(--rule); border-radius: 10px; padding: 1.1rem 1.2rem; margin: 1.4rem 0; background: var(--panel); }
.builder-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .7rem; font-family: var(--sans); font-size: .8rem; margin-bottom: 1rem; }
.builder-form label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); }
.builder-form select, .builder-form input { font: inherit; font-size: .95rem; padding: .45rem .55rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); }
.builder-out { background: var(--paper); border-radius: 8px; padding: .4rem 1rem; border: 1px solid var(--rule); }
@media print { .builder { border: none; padding: 0; background: none; } .builder-out { border: none; padding: 0; } }

/* Order questions (quiz.js type "order") */
.quiz-seq { font-family: var(--serif); font-size: 1rem; margin: .8rem 0 .4rem; padding-left: 1.4rem; min-height: 1rem; }
.quiz-seq li { padding: .1rem .3rem; border-radius: 4px; }
.quiz-seq li.correct { background: var(--good-soft); }
.quiz-seq li.wrong { background: var(--bad-soft); }
.quiz-feedback .quiz-seq { color: var(--ink); }

/* Year strip: 12 months with events underneath */
.year { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin: 1.2rem 0; font-family: var(--sans); }
@media (max-width: 560px) { .year { grid-template-columns: repeat(3, 1fr); } }
.year .m { background: var(--paper); padding: .5rem .55rem .6rem; min-height: 4.6rem; }
.year .m b { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }
.year .ev { display: block; font-size: .74rem; line-height: 1.25; margin: .15rem 0; }
.year .ev.nat { color: var(--accent); font-weight: 600; }
.year .ev.mov { font-style: italic; }

/* Timeline: <ol class="timeline"><li><span class="yr">1821</span><div>…</div></li></ol> */
.timeline { list-style: none; padding: 0; margin: 1.4rem 0; border-left: 2px solid var(--accent); }
.timeline li { position: relative; padding: 0 0 1.1rem 1.4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline li.key::before { background: var(--accent); }
.timeline .yr { font-family: var(--sans); font-weight: 600; font-size: .85rem; color: var(--accent); letter-spacing: .03em; }
.timeline .yr small { font-weight: 400; color: var(--muted); }
.timeline li > div { margin-top: .1rem; }

/* People cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .7rem; margin: 1rem 0; }
.card { border: 1px solid var(--rule); border-radius: 8px; padding: .7rem .85rem; background: var(--paper); font-size: .92rem; line-height: 1.4; }
.card .who { font-weight: 600; font-size: 1rem; }
.card .gr { font-size: .95rem; color: var(--muted); }
.card .role { font-family: var(--sans); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: .15rem 0 .35rem; }
.verse { font-size: 1.2rem; line-height: 1.6; margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--rule); }

/* Powers diagram: .powers > .people + .row > .power */
.powers { font-family: var(--sans); margin: 1.4rem 0; }
.powers .people { text-align: center; background: var(--accent); color: #fff; border-radius: 8px; padding: .6rem; font-weight: 600; font-size: .9rem; }
.powers .people small { display: block; font-weight: 400; opacity: .85; }
.powers .arrow { text-align: center; color: var(--muted); font-size: .75rem; margin: .35rem 0; }
.powers .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
@media (max-width: 560px) { .powers .row { grid-template-columns: 1fr; } }
.powers .power { border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: 6px; padding: .6rem .7rem; background: var(--paper); font-size: .8rem; line-height: 1.4; }
.powers .power h4 { margin: 0 0 .3rem; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.powers .power .pname { font-size: 1rem; display: block; margin-bottom: .2rem; }
.box.dated { border-left-color: var(--bad); }
.box.dated .box-title { color: var(--bad); }

/* Map component (see map.js) */
.gmap { border: 1px solid var(--rule); border-radius: 10px; margin: 1rem 0; z-index: 0; background: var(--map-sea); }
.gm-icon { background: none; border: none; }
.gm-dot { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 1.5px solid #fff; }
.gm-label { position: absolute; left: 7px; top: -9px; white-space: nowrap; font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--ink);
  text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 3px var(--paper); }
.gm-label i { font-family: var(--serif); font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.gm-num { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--sans); font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.gm-dot.gm-island, .gm-num.gm-island { background: #2a9d8f; }
.gm-dot.gm-mountain, .gm-num.gm-mountain { background: #8d6e63; }
.gm-dot.gm-country, .gm-num.gm-country { background: #888; }
.gm-dot.gm-sea, .gm-num.gm-sea { background: #4a7fc1; }
.gm-label.gm-sea { font-style: italic; font-weight: 500; color: #4a7fc1; }
.gm-label.gm-country { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--muted); }
.gm-legend { font-family: var(--sans); font-size: .72rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.gm-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; background: var(--c); }
.map-quiz { display: grid; grid-template-columns: 1fr; gap: 0; }
.map-quiz .quiz { margin-top: 1rem; }
@media print { .gmap { display: none; } }
.gm-label.gm-left { left: auto; right: 7px; }
.gmap.leaflet-container { background: var(--map-sea); }

/* Mock interview (see interview.js) */
.iv { font-family: var(--sans); border: 1px solid var(--rule); border-radius: 10px; padding: 1.2rem; margin: 1.4rem 0; background: var(--panel); }
.iv-q { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; margin: .4rem 0 .8rem; }
.iv-gr { font-size: 1.55rem; line-height: 1.3; }
.iv-ctl { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; align-items: center; }
.iv-ctl .btn, .iv .btn { font-size: .85rem; }
.iv-en { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.05rem; margin-top: .3rem; }
.iv-en-main { font-family: var(--serif); font-size: 1.3rem; }
.iv-a { border-left: 3px solid var(--good); background: var(--good-soft); border-radius: 0 8px 8px 0; padding: .8rem 1rem; margin: .4rem 0; }
.iv-a .iv-en { color: var(--ink); font-style: normal; }
.iv .btn { padding: .55rem 1rem; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; font-family: var(--sans); }
.iv .btn.ghost { background: transparent; color: var(--accent); }
@media print { .iv { display: none; } }
