/* CT Quiz Engine — presentation. Uses brand tokens from tokens.css.
   Restrained, editorial, book-like. Colour is always paired with a glyph (accessibility). */

.ctq-quiz {
  font-family: var(--ct-font-body);
  color: var(--ct-ink);
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  line-height: 1.5;
}

.ctq-title {
  font-family: var(--ct-font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 2rem;
  margin: 0 0 0.15em;
}
.ctq-sub  { font-style: italic; color: var(--ct-muted); margin: 0 0 0.5em; }
.ctq-desc { margin: 0 0 0.75em; }
.ctq-meta { font-size: 0.85rem; color: var(--ct-faint); margin: 0 0 0.5em; }
.ctq-obj  { font-size: 0.9rem; color: var(--ct-muted); margin: 0 0 0.5em; }
.ctq-obj summary { cursor: pointer; }
.ctq-obj ul { margin: 0.4em 0 0; padding-left: 1.2em; }

.ctq-head { border-bottom: 2px solid var(--ct-ink); padding-bottom: 0.9rem; margin-bottom: 1.5rem; }

.ctq-q {
  border: 1px solid #e2e2e2;
  border-left: 4px solid var(--ct-hairline);
  border-radius: var(--ct-radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.1rem;
  background: var(--ct-paper);
}
.ctq-q.ctq-done { border-left-color: var(--ct-intro); }

.ctq-prompt { font-size: 1.08rem; margin-bottom: 0.75rem; }
.ctq-n { color: var(--ct-faint); font-weight: 600; margin-right: 0.25em; }

.ctq-options { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.ctq-opt {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.5rem 0.65rem; border: 1px solid #e6e6e6; border-radius: var(--ct-radius);
  cursor: pointer; transition: background 0.12s ease;
}
.ctq-opt:hover { background: #fafafa; }
.ctq-opt input { margin-top: 0.2rem; flex: none; }
.ctq-opt-text { flex: 1; }

/* Result states — glyph + colour, never colour alone */
.ctq-opt.ctq-correct   { border-color: var(--ct-verse);  background: #eef7ee; }
.ctq-opt.ctq-correct   .ctq-opt-text::after { content: "  ✓"; color: var(--ct-verse); font-weight: 700; }
.ctq-opt.ctq-incorrect { border-color: var(--ct-chorus); background: #fbeeed; }
.ctq-opt.ctq-incorrect .ctq-opt-text::after { content: "  ✗"; color: var(--ct-chorus); font-weight: 700; }
.ctq-opt.ctq-missed    { border-color: var(--ct-bridge); background: #fdf6e8; }
.ctq-opt.ctq-missed    .ctq-opt-text::after { content: "  ← missed"; color: #b07d1a; font-size: 0.8em; }

.ctq-text { font-family: var(--ct-font-body); font-size: 1rem; padding: 0.5rem 0.6rem;
  border: 1px solid #cfcfcf; border-radius: var(--ct-radius); width: 100%; max-width: 22rem; }
.ctq-text.ctq-correct   { border-color: var(--ct-verse);  background: #eef7ee; }
.ctq-text.ctq-incorrect { border-color: var(--ct-chorus); background: #fbeeed; }

.ctq-hint { margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--ct-muted); }
.ctq-hint summary { cursor: pointer; }

.ctq-check {
  margin-top: 0.85rem; font-family: var(--ct-font-body); font-size: 0.95rem;
  padding: 0.45rem 1.1rem; border: 0; border-radius: var(--ct-radius);
  background: var(--ct-ink); color: #fff; cursor: pointer;
}
.ctq-check:disabled { background: var(--ct-hairline); cursor: default; }

.ctq-feedback { margin-top: 0.8rem; }
.ctq-feedback:empty { margin: 0; }
.ctq-verdict { font-weight: 700; }
.ctq-verdict.ctq-correct   { color: var(--ct-verse); }
.ctq-verdict.ctq-incorrect { color: var(--ct-chorus); }

.ctq-optfb { margin: 0.5rem 0 0; padding-left: 1.1em; color: var(--ct-ink); }
.ctq-optfb li { margin: 0.2em 0; }

.ctq-expl { margin-top: 0.7rem; padding: 0.65rem 0.8rem; background: #f6f4ef;
  border-radius: var(--ct-radius); font-size: 0.96rem; }
.ctq-voice { display: block; font-weight: 700; font-size: 0.82rem; color: var(--ct-muted);
  margin-bottom: 0.25rem; letter-spacing: 0.02em; }

.ctq-selfassess { margin-top: 0.7rem; padding: 0.6rem 0.75rem; border: 1px dashed var(--ct-hairline);
  border-radius: var(--ct-radius); background: #fbfaf7; font-size: 0.92rem; }
.ctq-accepted { margin-bottom: 0.45rem; color: var(--ct-muted); }
.ctq-countit { font-family: var(--ct-font-body); font-size: 0.85rem; padding: 0.35rem 0.8rem;
  border: 1px solid var(--ct-verse); background: #fff; color: var(--ct-verse);
  border-radius: var(--ct-radius); cursor: pointer; }
.ctq-countit:hover { background: #eef7ee; }
.ctq-selflabel { margin: 0.5rem 0 0.3rem; font-size: 0.85rem; color: var(--ct-muted); }
.ctq-selfbtns { display: flex; gap: 0.5rem; }
.ctq-half { border-color: var(--ct-bridge); color: #b07d1a; }
.ctq-half:hover { background: #fdf6e8; }
.ctq-verdict.ctq-half-verdict { color: #b07d1a; }
.ctq-nearmiss { margin: 0.4rem 0; padding: 0.5rem 0.6rem; background: #fff;
  border-left: 3px solid var(--ct-bridge); border-radius: 3px; }
.ctq-nudge { padding: 0.55rem 0.7rem; background: #fdf6e8; border-left: 3px solid var(--ct-bridge);
  border-radius: 3px; font-size: 0.92rem; }

.ctq-degpicker { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.ctq-accrow, .ctq-degrow { display: flex; gap: 0.3rem; }
.ctq-acc, .ctq-deg, .ctq-note {
  font-family: var(--ct-font-body); font-size: 1rem; min-width: 2.2rem; padding: 0.4rem 0.5rem;
  border: 1px solid #cfcfcf; background: #fff; border-radius: var(--ct-radius); cursor: pointer;
}
.ctq-acc { font-size: 1.15rem; }
.ctq-acc.sel, .ctq-deg.sel, .ctq-note.sel { background: var(--ct-ink); color: #fff; border-color: var(--ct-ink); }
.ctq-acc:disabled, .ctq-deg:disabled, .ctq-note:disabled { cursor: default; opacity: 0.85; }
.ctq-deg.ctq-correct, .ctq-note.ctq-correct { background: var(--ct-verse); border-color: var(--ct-verse); color: #fff; }
.ctq-deg.ctq-incorrect, .ctq-note.ctq-incorrect { background: var(--ct-chorus); border-color: var(--ct-chorus); color: #fff; }

.ctq-skip, .ctq-none { color: var(--ct-faint); font-style: italic; padding: 0.5rem 0; }

/* Screen-reader-only text (real feedback for assistive tech, not just CSS glyphs) */
.ctq-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Restrained connective metadata */
.ctq-meta-line { margin-top: 0.6rem; font-size: 0.82rem; color: var(--ct-faint); }
.ctq-prereq { font-size: 0.85rem; color: var(--ct-muted); margin: 0 0 0.5em; }

.ctq-score {
  position: sticky; bottom: 0; margin-top: 1.5rem;
  background: var(--ct-ink); color: #fff; border-radius: var(--ct-radius);
  padding: 0.7rem 1rem; font-size: 0.92rem; text-align: center;
}
.ctq-score.ctq-pass { background: var(--ct-verse); }
.ctq-score.ctq-fail { background: #8a5a2b; }

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em;
  background: #efece6; padding: 0.05em 0.3em; border-radius: 3px; }
