/* Deck mechanics and neutral layout helpers. No brand styling here:
   colours and fonts come from theme/theme.css via CSS variables. */
:root { --slide-w: 1920px; --slide-h: 1080px; }
html, body { margin: 0; padding: 0; }
body { background: #111; overflow: hidden; }

.slide {
  box-sizing: border-box;
  width: var(--slide-w); height: var(--slide-h);
  position: absolute; left: 0; top: 0;
  overflow: hidden;
  transform-origin: 0 0;
  display: none;
}
.slide.current { display: block; }

/* ?all : every slide stacked, notes visible beside it (review mode) */
body.all { overflow: auto; background: #333; }
body.all .slide { display: block; position: relative; margin: 0 0 0 0; }
body.all .frame { display: flex; gap: 24px; align-items: flex-start; margin: 24px; }
body.all .frame .holder { flex: none; position: relative; overflow: hidden; box-shadow: 0 2px 12px #0008; }
body.all aside.notes { display: block !important; flex: 1; min-width: 280px; max-width: 560px;
  color: #ddd; font: 15px/1.5 system-ui, sans-serif; background: #222; padding: 12px 16px; border-radius: 6px; }
body.all .frame .num { color: #888; font: 13px system-ui; position: absolute; }

/* print: one slide per page */
@media print {
  @page { size: 1920px 1080px; margin: 0; }
  body { background: none; overflow: visible; }
  .slide { display: block !important; position: relative !important; transform: none !important;
    page-break-after: always; break-after: page; }
  aside.notes { display: none !important; }
}

/* speaker-notes overlay in present mode (press n) */
body.shownotes .slide.current aside.notes {
  display: block !important; position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 40%; overflow: auto; background: #000d; color: #eee;
  font: 26px/1.4 system-ui, sans-serif; padding: 20px 40px; z-index: 10;
}

/* neutral layout helpers usable by content */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; align-items: start; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; align-items: start; }
.wide-left { display: grid; grid-template-columns: 1.6fr 1fr; gap: 64px; align-items: start; }
.stack > * + * { margin-top: 24px; }
.center { text-align: center; }
.dim { opacity: .55; }
.chart svg { width: 100%; height: auto; display: block; }

/* build steps (see deck.js) */
.slide [data-step] { transition: opacity .25s; }
.slide [data-step].future { opacity: 0; }
.slide [data-until] { transition: opacity .25s; }
.slide [data-until].past, body.all .slide [data-until] { opacity: 0; }
@media print { body:not(.steps) .slide [data-step].future { opacity: 1; } body:not(.steps) .slide [data-until] { opacity: 0; } }

/* .slide.page: one page of a deck imported from PDF (scripts/import-pdf).
   An <object>, not an <img>: SVG loaded as an image cannot fetch the page's
   external assets/. pointer-events keeps clicks and keys on the deck. */
.slide.page { padding: 0; background: #fff; }
.slide.page > object, .slide.page > img { display: block; width: 100%; height: 100%; pointer-events: none; }

/* Playback of the talk recording (see deck.js): a "Watch the talk" button, then the
   video in the lower right (landscape), under the slides (portrait), or an audio bar. */
.deck-play { position: fixed; left: 16px; bottom: 16px; z-index: 20; padding: 10px 16px;
  border: 0; border-radius: 999px; background: #000b; color: #fff; cursor: pointer;
  font: 600 15px/1 system-ui, sans-serif; transition: opacity .4s; }
@media (hover: hover) { body.deck-idle .deck-play { opacity: 0; } }  /* touch screens have no mousemove to wake it */
body.playing .deck-play { display: none; }
.deck-player { display: none; position: fixed; z-index: 20; background: #000; }
body.playing .deck-player { display: flex; flex-direction: column;
  right: 16px; bottom: 16px; width: clamp(240px, 24vw, 480px);
  border-radius: 8px; overflow: hidden; box-shadow: 0 4px 24px #000a; }
.deck-player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.deck-player-bar { display: flex; gap: 4px; justify-content: flex-end; padding: 4px; background: #111; }
.deck-player-bar button { border: 0; border-radius: 4px; padding: 4px 10px; background: none; color: #ccc;
  cursor: pointer; font: 13px/1.4 system-ui, sans-serif; }
.deck-player-bar button:hover { color: #fff; background: #fff2; }
.deck-player-bar button.on { color: #fff; background: #fff3; }
body.playing .deck-player.portrait { left: 0; right: 0; width: auto; bottom: auto; border-radius: 0; box-shadow: none; }
body.playing-audio .deck-player { left: 0; right: 0; bottom: 0; width: auto; border-radius: 0;
  flex-direction: row; align-items: center; gap: 8px; padding: 0 8px; }
body.playing-audio .deck-player audio { flex: 1; min-width: 0; }
@media print { .deck-play, .deck-player { display: none !important; } }
