/* =====================================================================
   Slide decks (/slides/<slug>)

   The page is twenty captioned images. The viewer class folds them into
   one at a time; without it the reader simply scrolls the lot.

   Note on hiding: [hidden] is overridden by any author `display` rule,
   so everything hidden here is hidden by a class whose own rule sets
   display: none. The bare attribute is only used for things that have
   no display rule of their own.
   ===================================================================== */

/* The bug this codebase already has on the events page: [hidden] is only honoured while
   no author rule sets `display` on the element, and several controls below are flex. So
   the attribute is given teeth explicitly, once, for this page. Without it the viewer
   controls would be visible — and inert — to a reader with JavaScript off. */
.sl-page [hidden] { display: none !important; }

.sl-title { margin: 8px 0 12px; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; }
.sl-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin: 18px 0 0; padding: 0; list-style: none;
  font-size: var(--fs-sm); color: var(--muted);
}
.sl-meta li { display: inline-flex; align-items: center; gap: 7px; }
.sl-meta i { width: 16px; height: 16px; }

/* ---------- the stage ---------- */
.sl-stage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.sl-slide { margin: 0; }
.sl-slide img { display: block; width: 100%; height: auto; }
.sl-slide figcaption {
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.sl-slide figcaption span { font-weight: 700; color: var(--brand-ink); margin-right: 4px; }

/* With the viewer running, only the current slide is in the box. */
.sl-page.is-viewer .sl-slide { display: none; }
.sl-page.is-viewer .sl-slide.is-current { display: block; }

/* The grid view shows them all at once. */
.sl-page.is-grid .sl-stage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  padding: 12px;
  background: var(--wash);
}
.sl-page.is-grid .sl-slide {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.sl-page.is-grid .sl-slide.is-current { box-shadow: inset 0 0 0 2px var(--brand); }
.sl-page.is-grid .sl-slide figcaption { font-size: var(--fs-xs); padding: 8px 10px; }

.sl-stage:fullscreen { border: 0; border-radius: 0; display: grid; place-items: center; background: var(--ink); }
.sl-stage:fullscreen .sl-slide figcaption { color: #B9C7E0; border-color: #24365C; }

/* ---------- controls ---------- */
.sl-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.sl-nav {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: var(--r);
  cursor: pointer;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid transparent;
}
.sl-nav:hover:not(:disabled) { border-color: var(--brand); }
.sl-nav:disabled { opacity: 0.35; cursor: default; }
.sl-nav i { width: 20px; height: 20px; }

.sl-progress {
  flex: 1 1 120px;
  min-width: 80px;
  height: 5px;
  border-radius: 5px;
  background: var(--wash-2);
  overflow: hidden;
}
.sl-progress span { display: block; height: 100%; width: 5%; background: var(--brand); transition: width 0.18s ease; }

.sl-counter { margin: 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--ink); }
.sl-counter #sl-now { font-weight: 700; }
.sl-of { color: var(--muted); margin-left: 3px; }

.sl-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.sl-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--wash);
  border: 1px solid var(--line);
}
.sl-tool:hover { color: var(--brand-ink); border-color: var(--brand); background: var(--brand-soft); }
.sl-tool i { width: 15px; height: 15px; }
.sl-tool[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }

.sl-hint {
  display: flex; align-items: center; gap: 9px;
  margin: 10px 0 0; font-size: var(--fs-xs); color: var(--muted);
}
.sl-hint i { width: 15px; height: 15px; flex: none; }
.sl-hint kbd {
  padding: 1px 6px; border-radius: 5px; font: inherit; font-size: 0.95em;
  background: var(--wash-2); border: 1px solid var(--line); border-bottom-width: 2px;
}

/* ---------- filmstrip ---------- */
.sl-strip {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.sl-thumb {
  position: relative;
  flex: none;
  width: 124px;
  padding: 0;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.sl-thumb img { display: block; width: 100%; height: auto; opacity: 0.75; }
.sl-thumb:hover img { opacity: 1; }
.sl-thumb span {
  position: absolute; left: 4px; bottom: 4px;
  min-width: 17px; padding: 1px 5px;
  border-radius: 20px;
  background: rgba(11, 27, 63, 0.82);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
}
.sl-thumb.is-current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.sl-thumb.is-current img { opacity: 1; }

/* ---------- share ---------- */
.sl-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.sl-copyslide {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--wash);
  border: 1px solid var(--line);
}
.sl-copyslide:hover { color: var(--brand-ink); border-color: var(--brand); }
.sl-copyslide.is-done { color: var(--success); border-color: var(--success); }
.sl-copyslide i { width: 15px; height: 15px; }

.sl-about { margin: 16px 0 0; max-width: 70ch; font-size: var(--fs-sm); line-height: 1.75; color: var(--muted); }

/* ---------- quiz ---------- */
.sl-quiz {
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.sl-quiz-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.sl-quiz-head h2 { margin: 6px 0 8px; font-size: var(--fs-xl); }
.sl-quiz-sub { margin: 0; max-width: 60ch; font-size: var(--fs-sm); line-height: 1.7; color: var(--muted); }
.sl-score {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 10px 16px; border-radius: 13px;
  background: var(--brand-soft); border: 1px solid var(--brand);
}
.sl-score-n { font-size: 1.3rem; font-weight: 700; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.sl-score-l { font-size: var(--fs-xs); color: var(--muted); }

.sl-q { padding: 22px 0; border-bottom: 1px solid var(--line-soft); }
.sl-q:last-child { border-bottom: 0; padding-bottom: 4px; }
.sl-q-n {
  margin: 0 0 6px; font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.sl-q-text { margin: 0 0 14px; font-size: var(--fs-lg); line-height: 1.5; }

.sl-q-options { display: flex; flex-direction: column; gap: 8px; }
.sl-opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r);
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--wash);
  border: 1px solid var(--line);
  transition: border-color 0.14s ease, background 0.14s ease;
}
.sl-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.sl-opt:disabled { cursor: default; }
.sl-opt-k {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
}
.sl-opt.is-right { background: #E8F6EF; border-color: var(--success); color: #0b5c40; }
.sl-opt.is-right .sl-opt-k { background: var(--success); border-color: var(--success); color: #fff; }
.sl-opt.is-wrong { background: #FDECEB; border-color: #b4232a; color: #7A1F24; }
.sl-opt.is-wrong .sl-opt-k { background: #b4232a; border-color: #b4232a; color: #fff; }

.sl-q-result { margin-top: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--wash); border: 1px solid var(--line); }
.sl-q.is-correct .sl-q-result { background: #E8F6EF; border-color: #a9ddc5; }
.sl-q.is-incorrect .sl-q-result { background: #FDF4E3; border-color: #f0dcb4; }
.sl-q-verdict { margin: 0 0 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.sl-q-why { margin: 0 0 10px; font-size: var(--fs-sm); line-height: 1.75; color: var(--ink-2); }
.sl-q-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--brand); text-decoration: none;
}
.sl-q-back:hover { text-decoration: underline; }
.sl-q-back i { width: 14px; height: 14px; }

.sl-note { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

@media (max-width: 760px) {
  .sl-tools { margin-left: 0; width: 100%; }
  .sl-tool span { display: none; }
  .sl-tool { padding: 9px 12px; }
  .sl-quiz { padding: 18px 16px; }
  .sl-thumb { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .sl-progress span, .sl-opt { transition: none; }
}
