/* Styles for the widgets in assets/quiz.js. Link after lesson.css. */

.quiz, .recall, .predict {
  max-width: var(--measure);
  border: 1px solid var(--rule);
  background: #fffefb;
  padding: 1.1rem 1.2rem;
  margin: 0 0 1.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
}

@media (prefers-color-scheme: dark) {
  .quiz, .recall, .predict { background: #191811; }
}

.quiz .q, .recall .q, .predict .q {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
  max-width: none;
}

.quiz::before, .recall::before, .predict::before {
  content: 'Check yourself';
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.recall::before { content: 'From memory'; }
.predict::before { content: 'Predict first'; }

/* ---------- Options ---------- */

.opt {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.4rem;
  background: var(--code-bg);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { cursor: default; opacity: 0.75; }
.opt.is-right { background: #e3f0e8; border-color: var(--ok); color: #14301f; opacity: 1; }
.opt.is-wrong { background: #f7e6e5; border-color: var(--no); color: #3a1211; }

@media (prefers-color-scheme: dark) {
  .opt.is-right { background: #1b2f22; color: #cfe8d8; }
  .opt.is-wrong { background: #33191a; color: #f0cfcd; }
}

/* ---------- Feedback ---------- */

.quiz-feedback {
  margin-top: 0.7rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--rule);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.quiz-feedback.is-right { border-left-color: var(--ok); }
.quiz-feedback.is-wrong { border-left-color: var(--no); }

/* ---------- Reveal ---------- */

.reveal-btn {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: pointer;
}
.reveal-btn:hover { background: var(--accent-soft); }

.recall-input {
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.6rem;
  margin-bottom: 0.7rem;
  background: var(--code-bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  resize: vertical;
}

.answer {
  margin-top: 0.8rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--ok);
  font-size: 0.82rem;
  line-height: 1.55;
}
.answer > :last-child { margin-bottom: 0; }
.answer pre { margin-top: 0.6rem; }

@media print {
  .opt { border: 1px solid var(--rule); }
  .reveal-btn, .recall-input { display: none; }
  .answer { display: block !important; }
  .answer::before {
    content: 'Answer: ';
    font-weight: 600;
  }
}
