/* Scroll pages: full-height slides that snap, beside the sidebar (or under a
   fixed header on narrow screens). Add class="deck-page" to <body>. An
   optional fixed #stage sits behind. */

html:has(.deck-page) {
  scroll-snap-type: y mandatory;
}

.deck-page {
  padding: 0;
}

.deck-page .site-head {
  position: fixed;
  top: var(--pad-top);
  left: var(--pad-side);
  z-index: 2;
  margin: 0;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.slide {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--pad-top) + var(--head-height) + 20px) var(--pad-side) 64px;
  display: flex;
  align-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  pointer-events: none; /* empty space passes hover/click through to the stage */
}
.slide > * {
  pointer-events: auto;
}

.slide-text {
  width: min(36ch, 38vw);
}

/* A slide whose content is one large thing (a video, a figure) */
.slide--media {
  align-items: center;
}
.slide-media {
  width: 100%;
}

.deck-nav {
  position: fixed;
  left: var(--pad-side);
  bottom: 16px;
  z-index: 2;
  display: flex;
  gap: 12px;
}
.deck-nav a[aria-current] {
  color: var(--here);
}

/* Narrow screens: stage on top, text at the bottom */
@media (max-width: 719px) {
  .slide:not(.slide--media) {
    align-items: flex-end;
  }
  .slide-text {
    width: 100%;
  }
}

/* Wide screens: the header is in the sidebar, so a slide only has to centre
   its content; the slide numbers sit centred under it. */
@media (min-width: 720px) and (min-height: 520px) {
  .slide {
    padding: 64px 32px;
  }
  .deck-nav {
    left: var(--side);
    right: 0;
    justify-content: center;
  }
}

/* Narrow or short screens: the photo row has the bottom-left corner */
@media (max-width: 719px), (max-height: 519px) {
  .deck-nav {
    left: auto;
    right: var(--pad-side);
  }
}
