/* ==========================================================
   Slide stage — the rendered PowerPoint image
   ========================================================== */

.slide-stage {
  position: relative;
  width: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}
.slide-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  background: #fff;
}
[data-theme="dark"] .slide-stage img { background: #f8fafc; }

.slide-stage .zoom-hint {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(8, 12, 19, .72);
  color: #fff;
  border: 0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s var(--ease);
  backdrop-filter: blur(6px);
}
.slide-stage:hover .zoom-hint, .slide-stage:focus-within .zoom-hint { opacity: 1; }

.slide-stage.missing {
  aspect-ratio: auto;
  min-height: 200px;
  padding: 36px 28px;
  text-align: center;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
  border-style: dashed;
}
.slide-stage.missing h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.slide-stage.missing p { font-size: 13px; max-width: 420px; margin: 0 auto; }

.fidelity-flag {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-line);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================
   Text panel — the accessible, searchable half of the hybrid view
   ========================================================== */

.slide-text {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.slide-text > .kicker { margin-bottom: 10px; }
.slide-title {
  font-size: clamp(20px, 2.4vw, 27px);
  margin-bottom: 16px;
  color: var(--text);
}
.slide-lead {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 16px;
}

.bullets { display: flex; flex-direction: column; gap: 9px; }
.bullet {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14.5px;
  line-height: 1.6;
}
.bullet .dotmark {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-500);
  margin-top: 9px;
  flex-shrink: 0;
}

.exercise-steps { display: flex; flex-direction: column; gap: 10px; }
.exercise-step { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.6; }
.exercise-step .num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.deliverable {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-top: 14px;
}

.notes-disclosure {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.notes-disclosure > summary {
  cursor: pointer;
  padding: 11px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.notes-disclosure > summary::-webkit-details-marker { display: none; }
.notes-disclosure > summary:hover { color: var(--text); }
.notes-disclosure > summary .chev { transition: transform .2s var(--ease); }
.notes-disclosure[open] > summary .chev { transform: rotate(90deg); }
.notes-body {
  padding: 0 15px 15px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* --- chapter outline (generated TOC slide) --- */
.outline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}
.outline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease);
  min-width: 0;
}
.outline-item:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.outline-item .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}
.outline-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-item.done .n { color: var(--ok-fg); }

/* --- resource links --- */
.resource-links { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.resource-links-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
}
.resource-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  word-break: break-word;
  border: 1px solid transparent;
}
.resource-link:hover { border-color: var(--brand); }
.text-link { color: var(--brand); font-weight: 600; word-break: break-word; }

/* ==========================================================
   Video
   ========================================================== */

/* Video and audio extracted from the deck on import, shown under the slide. */
.slide-media {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.slide-media-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
}
.slide-video {
  width: 100%;
  max-height: 72vh;
  display: block;
  border-radius: var(--r-md);
  background: #05080d;
  border: 1px solid var(--line);
}
.slide-audio { width: 100%; display: block; }

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #05080d;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-fallback {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #8891a6;
  text-align: center;
  padding: 22px;
}
.video-fallback a { color: var(--accent-400); font-weight: 600; text-decoration: none; }

/* ==========================================================
   Quiz
   ========================================================== */

.quiz-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.quiz-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-400));
}
.quiz-q {
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 700;
  line-height: 1.4;
  margin: 12px 0 20px;
}

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .14s var(--ease), background .14s var(--ease), transform .12s var(--ease);
  font-size: 14.5px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  width: 100%;
  line-height: 1.5;
}
.opt:hover:not(:disabled) { border-color: var(--brand); transform: translateX(2px); }
.opt:disabled { cursor: default; }
.opt .letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.opt .opt-mark { margin-left: auto; flex-shrink: 0; display: grid; place-items: center; }

.opt.correct { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-fg); }
.opt.correct .letter { background: var(--ok-fg); border-color: var(--ok-fg); color: #fff; }
.opt.wrong { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-fg); }
.opt.wrong .letter { background: var(--bad-fg); border-color: var(--bad-fg); color: #fff; }
.opt.muted { opacity: .55; }

.quiz-feedback {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.quiz-feedback.ok { color: var(--ok-fg); }
.quiz-feedback.bad { color: var(--bad-fg); }

.explain-box {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  color: var(--ok-fg);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  margin-top: 14px;
}
.quiz-retry { margin-top: 14px; }

/* the deck prints the answer on the slide, so it stays hidden until answered */
.quiz-slide-reveal { margin-top: 18px; }

/* ==========================================================
   Section hero
   ========================================================== */

.section-hero {
  text-align: center;
  padding: 46px 24px;
  background:
    radial-gradient(120% 100% at 50% 0%, var(--brand-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.section-hero .kicker { justify-content: center; margin-bottom: 12px; }
.section-hero h1 { font-size: clamp(24px, 3.4vw, 36px); margin-bottom: 14px; }
.section-hero p {
  color: var(--text-2);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ==========================================================
   Certificate
   ========================================================== */

.certificate-panel {
  background:
    radial-gradient(130% 110% at 100% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.certificate-panel h2 { font-size: clamp(21px, 2.6vw, 28px); margin: 10px 0 10px; }
.certificate-panel > p { color: var(--text-2); font-size: 14.5px; max-width: 620px; margin-bottom: 22px; }

.cert-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.cert-stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.cert-stat .v {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
}
.cert-stat .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-top: 4px;
  font-weight: 600;
}
.cert-stat.pass .v { color: var(--ok-fg); }

.cert-checklist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.cert-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-2);
}
.cert-check .mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface-3);
  color: var(--text-3);
}
.cert-check.done { color: var(--text); }
.cert-check.done .mark { background: var(--ok-fg); color: #fff; }

/* Just the download button now — the name comes from the account, not a field. */
.cert-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

@media (max-width: 640px) {
  .slide-text, .quiz-card, .certificate-panel { padding: 18px; }
  .section-hero { padding: 32px 18px; }
}

