/* ---------------------------------------------------------------
   The trainers: the overview (/learn/trainer/), the sentence trainers
   (js/drill.js) and what all three trainers share under the quiz.
   Loaded after artikel.css, which has the quiz card itself.

   Colours: the two answers of a sentence trainer are gold (first) and
   violet (second). "Right" stays plain ink, as in the der/die/das trainer.
   --------------------------------------------------------------- */

/* --- Back to the overview, above the title ------------------------------- */

.train-crumb {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.train-crumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.train-crumb a::before {
  content: "← ";
}

.train-crumb a:hover {
  color: var(--accent);
}

/* --- A sentence with a gap ------------------------------------------------- */

.quiz-head {
  margin: 30px 0 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.quiz-word--sentence {
  margin: 10px auto 8px;
  max-width: 32ch;
  font-size: clamp(1.45rem, 5.4vw, 2.1rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: normal;
}

.quiz-word--sentence.is-bare {
  margin-top: 34px;
}

.quiz-word--sentence .quiz-slot {
  min-width: 2em;
  margin: 0 0.08em;
  line-height: 1.15;
}

.quiz-slot[data-c="0"] { color: var(--gold-ink); }
.quiz-slot[data-c="1"] { color: var(--violet); }

/* --- Two answers ----------------------------------------------------------- */

.quiz-choices--two {
  grid-template-columns: repeat(2, 1fr);
}

.quiz-choices--two .quiz-choice {
  display: grid;
  gap: 2px;
  padding: 13px 10px;
  border-color: transparent;
}

.quiz-choice[data-c="0"] { color: var(--gold-ink); background: var(--gold-soft); }
.quiz-choice[data-c="1"] { color: var(--violet); background: var(--violet-soft); }

.quiz-choice[data-c]:hover:not(:disabled) {
  border-color: currentColor;
}

.quiz-choice[data-c].is-right {
  border: 2px solid currentColor;
  background: transparent;
}

.quiz-choice[data-c].is-wrong {
  background: var(--surface-2);
  color: var(--ink-soft);
}

.quiz-choice[data-c].is-wrong .quiz-form {
  text-decoration: line-through;
}

.quiz-choice.is-wrong {
  text-decoration: none;
}

.quiz-choice[data-a].is-wrong {
  text-decoration: line-through;
}

.quiz-cap {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

.quiz.is-yes .quiz-choice[data-c].is-right {
  animation: quiz-pop 0.35s ease;
}

/* --- The answer written out (after a wrong one, and in the list at the end) */

.quiz-full-sentence {
  margin: 0 0 0.5em;
  font-family: var(--font-display-latin);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
}

.quiz-full-sentence .quiz-slot {
  min-width: 0;
  border: 0;
}

.quiz-missed .quiz-full-sentence {
  font-size: 1rem;
  margin: 0;
}

/* --- Topics (Akkusativ/Dativ) ------------------------------------------------ */

.quiz-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quiz-topics button {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.quiz-topics button.is-on {
  background: var(--ink);
  color: var(--bg);
}

/* --- Records ---------------------------------------------------------------- */

.quiz-streak.is-record {
  background: var(--ink);
  color: var(--bg);
}

.quiz-stats {
  margin: -8px 0 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* --- The rule, under the quiz ------------------------------------------------ */

.drill-info {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.drill-info h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  line-height: 1.2;
}

.drill-info h3 {
  margin: 26px 0 8px;
  font-size: 1.08rem;
}

.drill-info p,
.drill-info li {
  color: var(--ink-soft);
  line-height: 1.7;
}

.drill-info b {
  color: var(--ink);
}

.drill-info ol,
.drill-info ul {
  padding-left: 1.2rem;
}

.drill-info li {
  margin-bottom: 0.6em;
}

/* An example sentence: on its own line, in the display face */
.drill-info li .ex {
  display: block;
}

.drill-info .ex {
  font-family: var(--font-display-latin);
  font-size: 1.05rem;
  color: var(--ink);
}

.drill-info .ex b {
  color: var(--accent);
}

.drill-info .c-der { color: var(--blue); }
.drill-info .c-die { color: var(--accent); }
.drill-info .c-das { color: var(--green); }

.drill-table {
  margin: 12px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.drill-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.drill-table th,
.drill-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.drill-table tr:last-child th,
.drill-table tr:last-child td {
  border-bottom: 0;
}

.drill-table th {
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
}

.drill-table td {
  font-family: var(--font-display-latin);
  font-weight: 600;
  color: var(--ink);
}

/* --- More trainers ------------------------------------------------------------ */

.train-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.train-more h2 {
  flex-basis: 100%;
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.train-more a {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display-latin);
  font-weight: 600;
  text-decoration: none;
}

.train-more a:hover {
  border-color: var(--ink-soft);
}

.train-more a.train-more-all {
  margin-left: auto;
  padding-right: 0;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.train-more a.train-more-all:hover {
  color: var(--accent);
}

/* --- The overview --------------------------------------------------------------- */

.artikel.trainers {
  max-width: var(--max-width-wide);
}

.train-days {
  display: inline-block;
  margin: 22px 0 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.9rem;
  font-weight: 600;
}

.train-days[hidden],
.train-stat[hidden] {
  display: none;
}

.train-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.train-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.train-card:hover {
  border-color: var(--ink-soft);
}

.train-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
}

.train-chips i {
  flex: 1;
  padding: 9px 4px;
  border-radius: 10px;
  text-align: center;
  font-family: var(--font-display-latin);
  font-style: normal;
  font-weight: 600;
}

.train-chips i[data-c="der"] { color: var(--blue); background: var(--blue-soft); }
.train-chips i[data-c="die"] { color: var(--accent); background: var(--accent-soft); }
.train-chips i[data-c="das"] { color: var(--green); background: var(--green-soft); }
.train-chips i[data-c="0"] { color: var(--gold-ink); background: var(--gold-soft); }
.train-chips i[data-c="1"] { color: var(--violet); background: var(--violet-soft); }

.train-card h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.train-card p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.train-meta {
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.train-stat::before {
  content: " · ";
}

.train-stat {
  color: var(--ink);
}

/* The three trainers inside the Learn page's card */
.hub-trainers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}

.hub-trainers a {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--tint-soft, var(--surface-2));
  color: var(--ink);
  font-family: var(--font-display-latin);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.hub-trainers a:hover {
  color: var(--tint, var(--accent));
}

@media (max-width: 760px) {
  .train-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .train-card {
    padding: 18px;
  }

  .train-chips {
    margin-bottom: 18px;
    max-width: 16rem;
  }
}

@media (max-width: 600px) {
  .quiz-word--sentence.is-bare {
    margin-top: 26px;
  }

  .quiz-head {
    margin-top: 22px;
  }

  .drill-info {
    margin-top: 44px;
  }

  .train-more a.train-more-all {
    margin-left: 0;
    flex-basis: 100%;
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz.is-yes .quiz-choice[data-c].is-right {
    animation: none;
  }
}

/* --- Sharing a result, and the round of the day -------------------------- */

.quiz-keys[hidden] {
  display: none;
}

.quiz--daily {
  margin-top: 22px;
}

.quiz--daily:empty {
  display: none;
}

/* Before the start and after the end the card is a short panel, not a quiz */
.quiz--intro {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.quiz-daily-label {
  margin: 0;
}

.quiz-daily-text {
  margin: 4px 0 14px;
  max-width: 44ch;
  font-family: var(--font-display-latin);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

.quiz--intro .quiz-score {
  margin: 6px 0 8px;
}

.quiz-dots--result {
  flex: none;
  justify-content: flex-start;
  margin: 0 0 16px;
}

.quiz-dots--result i {
  width: 14px;
  height: 14px;
}

.quiz--intro .quiz-kept {
  margin: 0 0 14px;
}

.quiz--intro .quiz-missed {
  margin-bottom: 14px;
}

/* Density pass (v4): trainer overview on phones — tighter cards. */
@media (max-width: 600px) {
  .train-grid {
    gap: 10px;
    margin-top: 16px;
  }

  .train-card {
    padding: 14px 16px;
  }

  .train-chips {
    margin-bottom: 10px;
  }

  .train-card h2 {
    font-size: 1.2rem;
    margin-bottom: 2px;
  }

  .train-card p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.45;
  }
}
