/* View-Slides button + in-app slide-deck overlay (native PDF <iframe>).
   Page-scoped (linked from learn/lesson.html, know/topics.html, and the two
   eXam/practice templates via {% block extra_head %}); plain CSS so no Tailwind
   rebuild. Chrome mirrors 20-simulate.css; a distinct indigo accent sets the
   "View Slides" button apart from the amber Simulate / cyan Handout buttons, and
   the body is a large PDF viewport rather than a letterboxed sim. */

/* ── Launch button (indigo) ─────────────────────────────────────────────────────── */
.slides-launch {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(129, 140, 248, 0.12);
  color: #c7d2fe;
}
.slides-launch:hover { background: rgba(129, 140, 248, 0.20); color: #e0e7ff; }
.slides-launch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.55);
}

/* ── Overlay ─────────────────────────────────────────────────────────────────────── */
.slides-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.slides-overlay[hidden] { display: none; }
.slides-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(2px);
}

.slides-modal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1100px, 96vw);
  height: min(900px, 92vh);   /* definite height so the PDF body can flex-fill */
  max-height: 92vh;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.slides-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.5rem 0.6rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.slides-modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slides-modal-actions { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.slides-modal-newtab,
.slides-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: #94a3b8;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.slides-modal-newtab svg,
.slides-modal-close svg { width: 1.1rem; height: 1.1rem; }
.slides-modal-newtab:hover,
.slides-modal-close:hover { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; }

.slides-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

/* The deck itself: a large PDF viewport the native viewer fills. */
.slides-frame-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: #0b1120;
}
.slides-frame-wrap[hidden] { display: none; }
.slides-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Mobile: the modal goes full-screen — a PDF is unusable when tiny. ────────────── */
@media (max-width: 640px) {
  .slides-overlay { padding: 0; }
  .slides-modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slides-launch, .slides-modal-newtab, .slides-modal-close { transition: none; }
}
