/*
 * learn.css — styles for learn pages built with learn.js.
 * Load after theme.css.
 *
 * .steps (numbered step dots), .step-body/.step-title/.step-content,
 * .step-foot (Back/Next), .word-grid(.wide) > button.word (word cards),
 * .quiz-* (listen quiz; answer buttons are .pic-btn from theme.css).
 */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.steps .dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.steps .dot.done { border-color: var(--jade); color: var(--jade); }
.steps .dot[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps .dot:disabled { opacity: 0.4; cursor: not-allowed; }

.step-body { outline: none; }
.step-title { margin: 0 0 12px; font-size: 26px; }
.step-content > p { max-width: 62ch; }

.step-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Word cards */
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.word-grid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* Where Jyutping sits over each character (theme.css), a syllable takes
   ~50px: give sentence cards two columns so most fit on one line. */
@media (min-width: 700px) { .word-grid.wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
@media (max-width: 560px) {
  .word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .word-grid.wide { grid-template-columns: 1fr; }
  .word { padding: 10px 8px 12px; }
  .word img { width: 84px; height: 84px; }
  .word .hanzi { font-size: 24px; }
  .word .play { top: 6px; right: 6px; width: 26px; height: 26px; }
}
.word {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .word:hover { border-color: var(--ink-soft); } }
.word:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.word img { width: 112px; height: 112px; margin-bottom: 6px; }
.word .hanzi { font-size: 30px; font-weight: 700; line-height: 1.2; }
.word .en { font-weight: 600; }
.word .note { margin-top: 6px; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.word .play {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
}
.word.no-img { align-items: flex-start; text-align: left; padding-right: 50px; }
.word.no-img .hanzi { font-size: 26px; }
.word.pulse .play { animation: pulse 0.6s ease-out; }
@keyframes pulse {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  to { box-shadow: 0 0 0 14px transparent; }
}


/* Listen quiz */
.quiz-top { display: flex; gap: 8px; margin-bottom: 12px; }
.listen { margin-bottom: 14px; }
.quiz-feedback .btn { margin-top: 10px; }
.quiz-done { text-align: center; padding: 20px 0; }
.quiz-score { margin: 0; font-size: 48px; font-weight: 800; color: var(--accent); }
