/* deck-foundation v1: stage, presenter chrome and print. Pairs with deck.js.
   Markup: <div class="deck"><div class="deck-stage"><section class="slide layout-…">…</section>…</div></div> */

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--stage-bg);
}

.deck {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--stage-bg);
}
.deck-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  transform-origin: 0 0;
  background: var(--surface);
}
.deck-stage > .slide {
  position: absolute;
  inset: 0;
}

/* Speaker notes live inside each slide but are never shown on it. */
.slide > .notes {
  display: none;
}

/* Event logos: the dark-background logo by default, the light one on light slides. */
img[data-event="logo-light"] {
  display: none;
}
[data-mode="light"] img[data-event="logo"] {
  display: none;
}
[data-mode="light"] img[data-event="logo-light"]:not([hidden]) {
  display: inline-block;
}

/* ---------- Presenter controls (outside the stage, so they never scale) ---------- */

.deck-controls {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  font: 500 14px/1 var(--font-label);
  color: var(--ink-muted);
  transition: opacity var(--duration) ease;
}
.deck.is-idle .deck-controls:not(:focus-within) {
  opacity: 0;
  pointer-events: none;
}
.deck-controls button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}
.deck-controls button:hover {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
.deck-controls button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.deck-controls svg {
  width: 18px;
  height: 18px;
}
.deck-counter {
  min-width: 64px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.deck-progress {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 20;
  width: calc(var(--progress, 0) * 100%);
  height: 3px;
  background: var(--accent);
  transition: width var(--duration) var(--ease);
}

/* Blackout (B or .): the audience sees black, the presenter keeps their place. */
.deck.is-black::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
}

@media (prefers-reduced-motion: reduce) {
  .deck-controls,
  .deck-progress {
    transition: none;
  }
}

/* Phones held upright: the 16:9 slide is tiny, so suggest rotating (shown in the empty space above it). */
@media (orientation: portrait) and (max-width: 700px) {
  .deck::before {
    content: "Rotate your phone for a larger view";
    position: fixed;
    top: 24px;
    left: 0;
    right: 0;
    z-index: 20;
    text-align: center;
    font: 500 14px/1.4 var(--font-label);
    color: var(--ink-muted);
  }
}

/* ---------- Print / PDF: one 1920x1080 page per slide, every fragment shown ---------- */

@media print {
  @page {
    size: 1920px 1080px;
    margin: 0;
  }
  html,
  body {
    height: auto;
    overflow: visible;
    background: none;
  }
  .deck {
    position: static;
    overflow: visible;
  }
  .deck-stage {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    transform: none !important;
    background: none;
  }
  .deck-stage > .slide {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    break-after: page;
  }
  .deck-stage > .slide:last-child {
    break-after: auto;
  }
  .deck-controls,
  .deck-progress,
  .deck > .sr-only {
    display: none;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
