/* ============================================================
   trainer.css — §13. The drill, the mock paper and the diagnosis.

   Two rules run through this file. First, a question looks the same
   whether it is being drilled or sat under a clock, so the .qcard styles
   are shared and only the chrome around them changes. Second, the mock
   paper looks like a paper: a strip of numbered questions you can jump
   between, a clock that goes red near the end, and nothing anywhere that
   reveals whether an answer is right until it is submitted.
   ============================================================ */

/* ============================================================
   the drill hub
   ============================================================ */

.drillgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-3);
}

.drillcard {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: var(--s-3);
  align-items: start;
  text-align: left;
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.drillcard:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--surface-2);
}

.drillcard__ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.drillcard b {
  display: block;
  color: var(--ink);
  font-size: var(--t-md);
  margin-bottom: 3px;
}

.drillcard__blurb {
  display: block;
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.drillcard__meta {
  display: block;
  font-size: var(--t-xs);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================================================
   one question
   ============================================================ */

.qcard {
  display: grid;
  gap: var(--s-4);
}

.qcard__stem {
  font-size: var(--t-md);
  line-height: var(--leading);
  color: var(--ink);
}

.qcard__stem code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  word-break: break-word;
}

.qcard__body.choices {
  display: grid;
  gap: var(--s-2);
}

/* A picked-but-not-yet-marked choice, which only the mock paper uses.
   It must read as "this is what I put" and not as "this is right". */
.choice.is-picked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.choice.is-picked .choice__key {
  background: var(--accent);
  color: #fff;
}

.bandchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 650;
  letter-spacing: 0.03em;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-3);
}

.bandchip.band-1 {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}

.bandchip.band-3 {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}

/* ============================================================
   the mock paper
   ============================================================ */

.mock {
  display: grid;
  gap: var(--s-4);
}

.mock__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.mock__count {
  font-size: var(--t-sm);
  color: var(--ink-2);
}

.mock__clock {
  font-family: var(--mono);
  font-size: var(--t-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.mock__clock.is-low {
  color: var(--bad);
  animation: pulse 1s steps(2, end) infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mock__clock.is-low {
    animation: none;
  }
}

/* The question strip. It is the single most useful thing about sitting a
   paper on a screen: you can see at a glance what is left. */
.mock__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mock__dot {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-size: var(--t-xs);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 140ms var(--ease);
  position: relative;
}

.mock__dot:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.mock__dot.is-done {
  background: color-mix(in srgb, var(--accent-2) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent-2) 55%, transparent);
  color: var(--ink);
}

.mock__dot.is-here {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  color: var(--ink);
}

.mock__dot.is-flagged::after {
  content: "⚑";
  position: absolute;
  top: -6px;
  right: -3px;
  font-size: 11px;
  color: var(--warn);
}

.mock__foot {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  align-items: center;
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}

.mock__foot #mkSubmit {
  margin-left: auto;
}

#mkFlag.is-on {
  border-color: var(--warn);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}

/* ============================================================
   the review after submitting
   ============================================================ */

.mockreview {
  display: grid;
  gap: 5px;
}

.reviewrow {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}

.reviewrow.is-ok {
  border-left: 3px solid var(--ok);
}

.reviewrow.is-bad {
  border-left: 3px solid var(--bad);
}

.reviewrow.is-blank {
  border-left: 3px solid var(--ink-3);
}

.reviewrow summary {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px var(--s-4);
  cursor: pointer;
  font-size: var(--t-sm);
  color: var(--ink-2);
  list-style: none;
}

.reviewrow summary::-webkit-details-marker {
  display: none;
}

.reviewrow summary:hover {
  color: var(--ink);
}

.reviewrow__n {
  width: 26px;
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.reviewrow__band {
  margin-left: auto;
  font-size: var(--t-xs);
  color: var(--ink-3);
}

.reviewrow__body {
  padding: 0 var(--s-4) var(--s-4) calc(var(--s-4) + 26px + var(--s-3));
  display: grid;
  gap: var(--s-3);
  font-size: var(--t-sm);
}

.reviewrow__stem {
  color: var(--ink);
}

.reviewrow__body p {
  margin: 0;
}

/* ============================================================
   the quick check (§14) reuses the quiz styles, plus this
   ============================================================ */

.quizhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}
