/* Web Learning – Komponenten für Seiten, Aufgaben und Prüfungsmodus */

/* ---------- Modul-Layout ---------- */
.module-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 30px;
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 16px;
}
.toc__link {
  display: block;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.35;
}
.toc__link:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}
.section {
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.section > .h2 { margin-bottom: 4px; }

/* ---------- Vorschau (gerenderte Beispiele) ---------- */
.preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.preview__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
}
.preview iframe {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
}
.interactive { margin: 2px 0; }

/* ---------- Antwortoptionen mit Layout-Vorschau ---------- */
.options--demo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.options--demo .option {
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}
.options--demo .option__key { margin-top: 0; }
.options--demo .demo-stage { min-height: 0; }

/* ---------- Zuordnen ---------- */
.matchrow {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
  align-items: center;
}
.matchrow select { width: 100%; }
.matchrow p { grid-column: 1 / -1; }

/* ---------- Feedback ---------- */
.feedback__row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

/* ---------- Aufgabenliste ---------- */
.exercise-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.exercise-row:last-child { border-bottom: 0; }
.exercise-row__info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.exercise-row__prompt { font-size: 14px; font-weight: 500; line-height: 1.45; }
.exercise-row__slot { grid-column: 1 / -1; padding-top: 6px; }

/* ---------- Prüfung ---------- */
.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 244px;
  gap: 22px;
  align-items: start;
}
.exam-aside {
  position: sticky;
  top: calc(var(--header-h) + 78px);
  padding: 14px;
}
.exam-top.is-ready { animation: none; }
.review-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
}
.review-row:hover { background: var(--surface-2); }
.review-row:last-child { border-bottom: 0; }
.review-row__n {
  width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--surface-3);
  display: grid; place-items: center; font-size: 11px; font-weight: 650; color: var(--text-2);
}
.review-row__topic { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Spick ---------- */
.cheat-preview-wrap .sheet-a4 { width: 210mm; }
.sheet-a4 .pre,
.sheet-a4 pre { margin: 0; }
.cheat-sec .prose ul { padding-left: 0; }

/* ---------- Präsentationen ---------- */
.flashcard { height: 216px; }
.flashcard__inner { height: 100%; }
.flashcard__face { overflow: auto; }

/* ---------- Kleinigkeiten ---------- */
.sidebar__progress .bar { height: 6px; }
.hero .ring { margin-left: auto; }
.listrow .pill { flex: none; }
.page__head .kicker svg { flex: none; }
.exercise .runner__out { border: 0; }
.section .table td code { overflow-wrap: anywhere; }
.eva-demo code { white-space: pre-wrap; }

@media (max-width: 1000px) {
  .module-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .toc { position: static; order: -1; }
  .toc .stack { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .toc__link { background: var(--surface-2); }
  .exam-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-aside { position: static; order: 2; }
  .exam-top { position: sticky; top: 0; }
}

@media (max-width: 780px) {
  .options--demo { grid-template-columns: 1fr; }
  .matchrow { grid-template-columns: 1fr; }
  .exercise-row { grid-template-columns: 1fr; }
  .exercise-row > .btn { justify-self: start; }
  .cheat-preview-wrap { padding: 8px; }
  .flashcard { height: 200px; }
  .hero .ring { display: none; }
}

@media print {
  .print-root { display: block !important; }
  .print-root .sheet-a4 { width: 210mm; min-height: 0; }
}

@media screen { .print-root { display: none !important; } }
