/* Session 8 D6. Small on purpose: no framework, no reset library, no build step.
   The Coptic font stack matters more than anything else here, because a reader
   who sees boxes cannot use any of this. */
:root {
  --fg: #1a1a1a; --muted: #5c5c5c; --rule: #ddd; --bg: #fff; --link: #1a4d8f;
}
@media (prefers-color-scheme: dark) {
  :root { --fg: #e8e8e8; --muted: #a0a0a0; --rule: #3a3a3a; --bg: #16181c; --link: #8ab4f8; }
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 0 1.25rem 4rem; background: var(--bg); color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  max-width: 46rem; margin-inline: auto;
}
a { color: var(--link); }
header.site, footer.site { border-bottom: 1px solid var(--rule); padding: 1rem 0; }
footer.site { border-bottom: 0; border-top: 1px solid var(--rule); margin-top: 3rem; color: var(--muted); font-size: .85rem; }
header.site .brand { font-weight: 700; text-decoration: none; }
nav a { margin-right: 1rem; }
h1 { font-size: 1.5rem; line-height: 1.25; }
.note { color: var(--muted); font-size: .85rem; }

/* The Coptic block is U+2C80..U+2CFF. A font stack that does not cover it shows
   boxes, so the fallback chain is spelled out rather than left to chance. The
   project font is NOT bundled yet (themes/copticref/static/fonts/README.md);
   these are the system faces that do cover it. */
.coptic, .entry h2 {
  font-family: "Coptic", "Segoe UI Historic", "Noto Sans Coptic",
               "New Athena Unicode", "Arial Unicode MS", serif;
  font-feature-settings: normal;
  font-variant-ligatures: none;   /* Coptic has no ligatures; don't fake any */
  direction: ltr;                   /* Coptic is left-to-right */
  unicode-bidi: isolate;
}
.entry dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.entry dt { color: var(--muted); font-size: .85rem; }
.entry dd { margin: 0; }

@media print {
  header.site nav, footer.site { display: none; }
  body { max-width: none; color: #000; background: #fff; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #444; }
}

/* ── the reader (Session 10) ─────────────────────────────────────────────── */
.reader { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 44rem) { .reader { grid-template-columns: 1fr; } }
.hits { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow: auto; }
.hits button.hit { display: block; width: 100%; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--rule); padding: .4rem .3rem; cursor: pointer;
  color: inherit; font: inherit; }
.hits button.hit:hover, .hits button.hit:focus { background: color-mix(in srgb, var(--link) 10%, transparent); }
.hits .lemma { font-size: 1.15rem; margin-right: .5rem; }
.hits .gloss { color: var(--muted); font-size: .85rem; }
.chip { display: inline-block; border: 1px solid var(--rule); border-radius: 3px;
  font-size: .7rem; padding: 0 .3rem; margin-left: .2rem; color: var(--muted); }
.chip-N { border-style: dashed; }
.err { color: #b3261e; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#q { width: 100%; padding: .5rem; font: inherit; border: 1px solid var(--rule); border-radius: 4px;
  background: var(--bg); color: var(--fg); }
.letters { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; }
.letters li { font-size: 1.4rem; }
.count { color: var(--muted); font-size: .85rem; }

/* ── the corpus reader (Session 10 D3) ───────────────────────────────────── */
.verse { margin: 0 0 1.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.verse h2 { margin: 0 0 .4rem; font-size: 1rem; }
.verse .urn { font-family: ui-monospace, monospace; font-size: .7rem; word-break: break-all; }
.cop { font-size: 1.35rem; line-height: 2.1; margin: .2rem 0 .5rem; }
/* Touch target (Session 13 D5). Lighthouse flagged every span.tk: an inline
   non-replaced element is only as tall as its line box, under the 24px minimum,
   so these words were not reliably tappable on a phone. inline-block plus
   min-height/min-width gives each token a real target while the verse still
   reads as continuous text. */
span.tk { cursor: pointer; border-radius: 3px; padding: .15em .1em;
          display: inline-block; min-height: 24px; min-width: 24px; line-height: 1.35; }
span.tk:hover { background: color-mix(in srgb, var(--link) 16%, transparent); }
span.tk:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.en { margin: 0; color: var(--muted); }
.cop-raw { font-size: 1.3rem; line-height: 1.8; }
#corpus-entry { margin-top: 2rem; padding: 1rem; border: 1px solid var(--rule); border-radius: 4px; }
#corpus-entry:empty { display: none; }
.btn { display: inline-block; border: 1px solid var(--rule); border-radius: 4px;
  padding: .3rem .6rem; text-decoration: none; color: inherit; }
.btn:hover { background: color-mix(in srgb, var(--link) 10%, transparent); }
.worklink { text-decoration: none; border-bottom: 1px solid var(--rule); }

/* ── the quiz (Session 16 D3) ─────────────────────────────────────────────── */
#quiz-controls, #quiz-app { max-width: 42rem; }
#quiz-controls select, #quiz-controls button,
#quiz-app button, #quiz-export, #quiz-reset {
  font: inherit; color: inherit; background: var(--bg);
}
#quiz-controls select, #quiz-import-file {
  width: 100%; max-width: 28rem; padding: .5rem; border: 1px solid var(--rule);
  border-radius: 4px; background: var(--bg);
}
#quiz-start, .quiz-next, #quiz-export, #quiz-reset {
  border: 1px solid var(--rule); border-radius: 4px; padding: .55rem .9rem;
  min-height: 44px; cursor: pointer;
}
#quiz-start:hover, .quiz-next:hover, #quiz-export:hover, #quiz-reset:hover {
  background: color-mix(in srgb, var(--link) 10%, transparent);
}
#quiz-start:focus-visible, .quiz-next:focus-visible,
#quiz-export:focus-visible, #quiz-reset:focus-visible,
#quiz-choices button.hit:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px;
}
#quiz-choices button.hit { min-height: 44px; }
#quiz-choices button.hit .choice { font-size: 1.1rem; }
#quiz-choices button.hit.right { border-left: .3rem solid #157347; }
#quiz-choices button.hit.wrong { border-left: .3rem solid #b3261e; }
#quiz-choices button.hit:disabled { cursor: default; opacity: 1; }

/* Session 22 D1: the word under practice is the page's focal object. */
.speak-big, .write-big { font-size: 2rem; line-height: 1.3; margin: .5rem 0; }
