/* SI 658 slides — viewer chrome (buttons, nav bar, notes, presenting). */

.viewer { --v-gap: 12px; margin-top: 24px; }
.viewer [hidden] { display: none !important; }
.v-tools, .v-nav, .v-timer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v-tools { margin-bottom: 10px; scroll-margin-top: 12px; }
.v-seg { display: inline-flex; }
.v-seg .v-btn + .v-btn { border-left: none; }

.v-btn {
  display: inline-flex; flex-direction: row; align-items: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 8px 14px;
  font: 700 1rem/1.2 var(--sans); color: var(--blue); text-decoration: none;
  background: var(--white); border: 2px solid var(--blue); border-radius: var(--radius); cursor: pointer;
}
.v-btn:hover { background: var(--blue-15); }
.v-btn[aria-pressed="true"] { background: var(--blue); color: var(--white); }
.v-btn[aria-pressed="true"]::before { content: "✓ " / ""; }
.v-btn:disabled { opacity: 1; color: #5B7089; border-color: #5B7089; background: transparent; cursor: default; }
.v-btn:focus-visible, .v-jump select:focus-visible { outline: var(--focus-on-light); outline-offset: 3px; }
.v-pdf { flex-direction: column; align-items: flex-start; gap: 0; }
.v-pdf .v-sub { font-weight: 400; font-size: .8125rem; color: var(--blue-secondary); }
.v-pdf:hover .v-sub { color: var(--blue); }

/* the how-to, folded by default: still the stage's accessible description (aria-describedby) while closed */
.v-hint { font-size: .9375rem; line-height: 1.5; color: var(--blue-secondary); margin: 0 0 10px; max-width: 72ch; }
.v-hint > summary { cursor: pointer; font-weight: 700; color: var(--blue); width: fit-content; padding: 2px 0; }
.v-hint > summary:focus-visible { outline: 3px solid var(--maize); outline-offset: 2px; }
.v-hint > p { margin: 6px 0 0; }

.v-stage { position: relative; }
.v-stage .slide[hidden] { display: none !important; }
.v-stage:focus { outline: none; }
.v-stage:focus-visible { outline: 4px solid var(--blue); outline-offset: 4px; }
.viewer[data-mode="stage"] .v-stage .deck { box-shadow: 0 0 0 1px var(--line); }
/* the whole slide plus its controls fit in the window */
.viewer[data-mode="stage"]:not(.is-presenting) .v-stage { max-width: max(320px, calc((100svh - 110px) * 16 / 9)); }

.v-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 10px; }
.v-jump select {
  min-height: 44px; max-width: min(46ch, 70vw); padding: 8px 10px;
  font: 400 1rem/1.2 var(--sans); color: var(--blue); background: var(--white);
  border: 2px solid var(--blue); border-radius: var(--radius);
}
.v-pos { font-family: var(--mono); color: var(--blue-secondary); min-width: 5ch; }

.v-notes { margin-top: 16px; padding: 16px 20px; background: var(--white); border-left: 8px solid var(--maize); max-width: 80ch; }
.v-notes-h { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.v-notes-body p { line-height: 1.6; margin: 0 0 .6em; }

/* Page view: the deck reads as part of the page */
.viewer[data-mode="read"] .v-stage { margin-top: 8px; }

/* Presenting (full screen): the slide as large as the screen allows, controls tucked below */
.viewer.is-presenting {
  margin: 0; padding: 12px; background: #001A33;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
}
.viewer.is-presenting .v-tools > :not(.v-present), .viewer.is-presenting .v-hint, .viewer.is-presenting .v-notes { display: none; }
.viewer.is-presenting .v-tools { order: 3; margin: 0; }
.viewer.is-presenting .v-stage { width: min(100%, calc((100vh - 84px) * 16 / 9)); }
.viewer.is-presenting .v-stage .deck { box-shadow: none; }
.viewer.is-presenting .v-bar { width: min(100%, calc((100vh - 84px) * 16 / 9)); margin: 0; }
/* controls hidden while presenting until F12; when shown they replace "Exit full screen", centred */
.viewer.is-presenting:not(.show-controls) .v-bar { display: none; }
.viewer.is-presenting.show-controls .v-tools { display: none; }
.viewer.is-presenting .v-bar, .viewer.is-presenting .v-nav, .viewer.is-presenting .v-timer { justify-content: center; }
.viewer.is-presenting .v-btn { background: transparent; color: var(--white); border-color: var(--paper-on-blue); }
.viewer.is-presenting .v-btn:focus-visible, .viewer.is-presenting select:focus-visible { outline: var(--focus-on-blue); }
.viewer.is-presenting .v-jump select { background: #001A33; color: var(--white); border-color: var(--paper-on-blue); }
.viewer.is-presenting .v-pos { color: var(--paper-on-blue); }
/* "Exit full screen" fades when the mouse is still (it stays while it has keyboard focus); so does the pointer */
.viewer.is-presenting .v-tools { transition: opacity .6s ease; }
.viewer.is-presenting.is-idle .v-tools:not(:focus-within) { opacity: 0; }
.viewer.is-presenting.is-idle { cursor: none; }
@media (prefers-reduced-motion: reduce) { .viewer.is-presenting .v-tools { transition: none; } }
/* on the last slide there's nowhere to go: no Next button while presenting */
.viewer.is-presenting .v-next:disabled { visibility: hidden; }

@media (forced-colors: active) {
  .v-btn[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
}
@media print {
  .v-tools, .v-hint, .v-bar, .v-notes { display: none !important; }
}

/* "Slides" row on session cards (course app) */
.slides-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 10px 0 0; }
.kind-slides { background: var(--white); color: var(--blue); border: 2px solid var(--blue); }
.slides-meta { color: var(--blue-secondary); font-size: .9375rem; }
.deck-status { color: var(--blue-secondary); margin-top: 16px; }

/* Light table: every slide as a tile, as wide as the window, sized so the whole deck fits on screen */
.v-table {
  --cols: 4; --gutter: 24px;
  position: relative; left: 50%; transform: translateX(-50%);
  width: calc(100vw - 2 * var(--gutter)); max-width: 2400px;
  margin-top: 12px;
}
.v-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 16px; }
.v-grid > li { margin: 0; min-width: 0; }
.v-tile {
  all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; width: 100%; cursor: pointer;
}
.v-thumb { display: block; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .12s; }
.v-thumb .deck { display: block; pointer-events: none; }
.v-thumb .slide { content-visibility: visible; }
.v-tile:hover .v-thumb { box-shadow: 0 0 0 3px var(--blue); }
.v-tile[aria-current="true"] .v-thumb { box-shadow: 0 0 0 4px var(--maize), 0 0 0 6px var(--blue); }
.v-tile:focus-visible { outline: none; }
.v-tile:focus-visible .v-thumb { box-shadow: 0 0 0 4px var(--white), 0 0 0 8px var(--blue); }
.v-tile-cap {
  display: flex; gap: 8px; align-items: baseline; min-width: 0;
  font-size: .875rem; line-height: 1.3; color: var(--blue);
}
.v-tile-cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.v-tile-n { font-family: var(--mono); font-weight: 700; color: var(--blue-secondary); margin-right: 4px; }
.v-tile:hover .v-tile-cap, .v-tile:focus-visible .v-tile-cap { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .v-table { --gutter: 16px; } .v-grid { gap: 12px; } }
@media (forced-colors: active) {
  .v-thumb { border: 1px solid CanvasText; }
  .v-tile[aria-current="true"] .v-thumb, .v-tile:focus-visible .v-thumb { outline: 4px solid Highlight; }
}
@media print { .v-table { display: none !important; } }

.v-md .v-sub-inline { font-weight: 400; }

/* Page view: contents at the top (viewer.js), slides + notes side by side when wide (deck.css) */
.viewer[data-mode="read"] .v-stage { container: vpage / inline-size; }
.v-toc { margin: 8px 0 28px; padding: 20px 24px 20px; background: var(--white); border-top: 4px solid var(--blue); scroll-margin-top: 12px; }
.v-toc-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-size: 1.375rem; font-weight: 800; line-height: 1.2; }
.v-toc-h:focus { outline: none; }
.v-toc-h:focus-visible { outline: var(--focus-on-light); outline-offset: 4px; }
.v-toc-n { font: 500 .8125rem/1 var(--mono); color: var(--blue-secondary); }
.v-toc-groups { columns: 3 15rem; column-gap: 32px; }
.v-toc-g { break-inside: avoid; margin: 0 0 18px; }
.v-toc-part { margin: 0 0 4px; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-secondary); }
.v-toc-list { list-style: none; margin: 0; padding: 0; }
.v-toc-list a {
  display: flex; align-items: baseline; gap: 10px; min-height: 32px; padding: 6px 4px;
  color: var(--blue); text-decoration: none; line-height: 1.35; border-bottom: 1px solid var(--blue-15);
}
.v-toc-list a:hover .v-toc-t { text-decoration: underline; text-underline-offset: 3px; }
.v-toc-list a:focus-visible { outline: var(--focus-on-light); outline-offset: 2px; }
.v-toc-num { flex: none; min-width: 2ch; text-align: right; font: 500 .8125rem/1.35 var(--mono); font-variant-numeric: tabular-nums; color: var(--blue-secondary); }
.v-toc-list .is-part .v-toc-t { font-weight: 800; }
.v-notes-body .s-dir { font-style: italic; color: var(--blue-secondary); }
@media print { .v-toc { display: none; } }

/* Presenting by filling the window (iPhone, and wherever real full screen isn't available; viewer.js) */
html.v-locked, html.v-locked body { overflow: hidden; overscroll-behavior: none; }
.v-turn { display: none; }
.viewer.is-pseudo {
  position: fixed; inset: 0; z-index: 2147483000;
  width: 100vw; height: 100vh; height: 100dvh; box-sizing: border-box;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.viewer.is-pseudo .v-stage {
  width: min(100%, calc((100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 16 / 9));
}
/* the controls float over the slide instead of taking height from it */
.viewer.is-pseudo .v-tools { position: absolute; z-index: 2; top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right)); }
.viewer.is-pseudo .v-bar {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%);
  bottom: max(6px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 12px);
  padding: 6px; border-radius: 8px; background: rgb(0 26 51 / .92);
}
.viewer.is-pseudo .v-btn { background: rgb(0 26 51 / .88); }
.viewer.is-pseudo .v-jump select { max-width: min(40ch, 44vw); }
.viewer.is-pseudo .v-turn {
  display: block; margin: 0; font-size: .9375rem; text-align: center; color: var(--paper-on-blue);
}
@media (orientation: landscape) { .viewer.is-pseudo .v-turn { display: none; } }
