/* ═══════════════════════════════════════════════
   SLIDESHOW / PRESENTATION MODE
   All rules scoped under body.slideshow-active
   ═══════════════════════════════════════════════ */

/* ── Toggle button in nav ── */
.slideshow-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
  
  /* Hidden by default in scroll view */
  opacity: 0;
  transform: translateX(-10px) scale(0.95);
  pointer-events: none;
}

/* Reveal when hovering the nav */
nav:hover .slideshow-toggle,
.slideshow-toggle:focus-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

/* Always visible in slideshow mode (the nav itself handles auto-hiding) */
body.slideshow-active .slideshow-toggle {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
.slideshow-toggle:hover {
  color: var(--accent, var(--gold, #fff));
  border-color: var(--accent, var(--gold, rgba(255,255,255,0.2)));
}
.slideshow-toggle.active {
  color: var(--accent, var(--gold, #fff));
  border-color: var(--accent, var(--gold, rgba(255,255,255,0.25)));
  background: rgba(255,255,255,0.06);
}
.slideshow-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Slide mode: body ── */
body.slideshow-active {
  overflow: hidden;
  height: 100vh;
}

/* ── Slide wrapper (injected by JS) ── */
.slideshow-viewport {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-2, var(--bg, #0f1115));
  overflow: hidden;
}

.slideshow-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.slideshow-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── 16:9 frame ── */
.slideshow-frame {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  border-radius: 0;

  /* Subtle scrollbar for overflow slides */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.slideshow-frame::-webkit-scrollbar {
  width: 4px;
}
.slideshow-frame::-webkit-scrollbar-track {
  background: transparent;
}
.slideshow-frame::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

/* ── Content reformatting inside slides ── */
/* Better vertical distribution: make wrappers fill height and center content */
.slideshow-frame > div {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.slideshow-frame .hero,
.slideshow-frame .section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.slideshow-frame .video-container {
  flex-grow: 1;
  width: 100%;
  padding: 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Override legacy padding hack for iframes which collapses in flex containers */
.slideshow-frame .video-container > div {
  width: 100%;
  padding-bottom: 0 !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
}

.slideshow-frame .hero {
  margin-right: 0px;
  margin-left: 0px;
  padding: 20px 64px 20px;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-bottom: none;
}
.slideshow-frame .hero h1 {
  font-size: clamp(32px, 4vw, 56px);
  margin-bottom: 20px;
}
.slideshow-frame .hero-sub {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 40px;
  padding-bottom: 20px;
}
.slideshow-frame .hero-stats {
  gap: 1px;
}
.slideshow-frame .stat-item {
  padding: 32px;
}
.slideshow-frame .stat-num {
  font-size: 28px;
  margin-bottom: 6px;
}
.slideshow-frame .stat-label {
  font-size: 11px;
}

.slideshow-frame .section {
  padding: 0 64px;
  margin: 0;
  max-width: 100%;
  border-bottom: none;
}

/* ── Pinned Slide Titles ── */
.slideshow-frame .section-label,
.slideshow-frame .hero-eyebrow {
  position: absolute;
  top: 48px;
  left: 64px;
  right: 64px;
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--accent);
  z-index: 10;
}

.slideshow-frame .section-label::before,
.slideshow-frame .hero-eyebrow::before {
  display: none;
}

.slideshow-frame .section-label::after,
.slideshow-frame .hero-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.slideshow-frame h1,
.slideshow-frame h2,
.slideshow-frame h3 {
  text-wrap: balance;
}

.slideshow-frame p,
.slideshow-frame li,
.slideshow-frame .pull-quote {
  text-wrap: pretty;
}

.slideshow-frame h2 {
  font-size: clamp(32px, 4vw, 44px);
  margin-bottom: 24px;
  line-height: 1.2;
}
.slideshow-frame h3 {
  padding-bottom: 26px;
}
.slideshow-frame ul {
  gap: 24px;
}
.slideshow-frame .lead {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
  margin-bottom: 40px;
  color: var(--muted);
}

/* ── Tighter grids ── */
.slideshow-frame .two-col,
.slideshow-frame .pattern-grid,
.slideshow-frame .exploration-grid,
.slideshow-frame .platform-grid,
.slideshow-frame .challenge-grid,
.slideshow-frame .constraint-grid,
.slideshow-frame .samsung-highlights,
.slideshow-frame .states-grid,
.slideshow-frame .compare-grid {
  gap: 1px;
}
.slideshow-frame .col-card,
.slideshow-frame .pattern-card,
.slideshow-frame .exploration-card,
.slideshow-frame .platform-card,
.slideshow-frame .challenge-card,
.slideshow-frame .constraint-card,
.slideshow-frame .samsung-highlight,
.slideshow-frame .state-card,
.slideshow-frame .compare-card {
  padding: 24px;
}
.slideshow-frame .col-card h3,
.slideshow-frame .pattern-card h3,
.slideshow-frame .exploration-card h3,
.slideshow-frame .platform-card h3,
.slideshow-frame .compare-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}
.slideshow-frame .col-card li,
.slideshow-frame .pattern-card p,
.slideshow-frame .exploration-card p,
.slideshow-frame .platform-card p,
.slideshow-frame .challenge-card p,
.slideshow-frame .constraint-card p,
.slideshow-frame .state-card p,
.slideshow-frame .compare-card p {
  font-size: 16px;
  line-height: 1.6;
}
.slideshow-frame .col-card ul {
  gap: 12px;
}

.slideshow-frame .pattern-icon,
.slideshow-frame .challenge-icon,
.slideshow-frame .constraint-icon {
  font-size: 20px;
  margin-bottom: 10px;
}
.slideshow-frame .pattern-tag,
.slideshow-frame .platform-tag,
.slideshow-frame .state-badge {
  margin-top: 10px;
  font-size: 10px;
  padding: 3px 10px;
}
.slideshow-frame .exp-num {
  font-size: 28px;
  margin-bottom: 12px;
}
.slideshow-frame .verdict {
  font-size: 10px;
  padding: 4px 10px;
}

/* ── Slide 5 (Tradeoff) Specific Layout ── */
.slideshow-frame .section:has(.tradeoff-table) {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  grid-template-rows: auto auto 1fr;
  gap: 0 64px;
  align-content: center;
}
.slideshow-frame .section:has(.tradeoff-table) > .section-label {
  grid-column: 1 / -1;
}
.slideshow-frame .section:has(.tradeoff-table) > h2 {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 24px;
}
.slideshow-frame .section:has(.tradeoff-table) > .lead {
  grid-column: 1;
  grid-row: 2;
  margin-bottom: 0;
  font-size: 16px;
}
.slideshow-frame .section:has(.tradeoff-table) > .pull-quote {
  grid-column: 1;
  grid-row: 3;
  margin: 40px 0 0 0;
  font-size: 18px;
  padding-left: 16px;
  align-self: start;
}
.slideshow-frame .section:has(.tradeoff-table) > .tradeoff-table {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  margin: 0;
  width: 100%;
}

/* ── Tradeoff table ── */
.slideshow-frame .tradeoff-table th {
  font-size: 10px;
  padding: 10px 14px;
}
.slideshow-frame .tradeoff-table td {
  font-size: 12px;
  padding: 12px 14px;
}

/* ── Pull quotes ── */
.slideshow-frame .pull-quote {
  font-size: clamp(16px, 2vw, 22px);
  padding-left: 24px;
  margin: 24px 0;
}

/* ── Results grid ── */
.slideshow-frame .results-grid {
  gap: 32px;
}
.slideshow-frame .metric-num {
  font-size: 28px;
  margin-bottom: 4px;
}
.slideshow-frame .metric-label {
  font-size: 12px;
}
.slideshow-frame .metric-item {
  padding-left: 16px;
}
.slideshow-frame .metric-row {
  gap: 14px;
}
.slideshow-frame .retro-list {
  gap: 12px;
}
.slideshow-frame .retro-item {
  padding: 16px;
}
.slideshow-frame .retro-item h4 {
  font-size: 12px;
  margin-bottom: 4px;
}
.slideshow-frame .retro-item p {
  font-size: 12px;
  line-height: 1.5;
}

/* ── Samsung callout ── */
.slideshow-frame .samsung-callout {
  padding: 28px;
  margin-top: 16px;
}
.slideshow-frame .samsung-callout h3 {
  font-size: 18px;
  margin-bottom: 12px;
}
.slideshow-frame .samsung-callout p {
  font-size: 13px;
  margin-bottom: 10px;
}

/* ── Screens grid ── */
.slideshow-frame .screens-grid {
  gap: 8px;
}
.slideshow-frame .screen-thumb img {
  cursor: pointer;
}

/* ── Video containers ── */
.slideshow-frame .video-container {
  padding: 32px 64px;
  max-width: 100%;
}

/* ── Compare grid ── */
.slideshow-frame .compare-pivot {
  padding: 20px 16px;
  font-size: 22px;
}
.slideshow-frame .compare-label {
  font-size: 10px;
  margin-bottom: 10px;
}
.slideshow-frame .compare-card ul {
  gap: 6px;
}
.slideshow-frame .compare-card li {
  font-size: 12px;
}

/* ── State cards ── */
.slideshow-frame .state-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  margin-bottom: 12px;
}
.slideshow-frame .state-card h3 {
  font-size: 14px;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════
   SLIDE CONTROLS (injected by JS)
   ═══════════════════════════════════════════════ */

.slideshow-controls {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(15,17,21,0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px 12px 0 0;
  font-family: 'Lexend Deca', sans-serif;
  user-select: none;
}

.slideshow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.slideshow-arrow:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
}
.slideshow-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

.slideshow-counter {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.06em;
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.slideshow-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 61;
  background: rgba(255,255,255,0.06);
}
.slideshow-progress-bar {
  height: 100%;
  background: var(--accent, var(--gold, #17D5FF));
  transition: width 0.35s ease;
  border-radius: 0 1px 1px 0;
}

/* ── Keyboard hint (shown briefly on first activation) ── */
.slideshow-hint {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 62;
  padding: 8px 16px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-family: 'Lexend Deca', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.slideshow-hint.visible {
  opacity: 1;
}

/* ── Hide ALL original page content in slide mode ── */
/* Everything except nav, lightbox, slideshow-injected elements, and local editor gets hidden */
body.slideshow-active > *:not(nav):not(.lightbox):not(.slideshow-viewport):not(.slideshow-controls):not(.slideshow-progress):not(.slideshow-hint):not(#local-editor-panel):not(script):not(style):not(link) {
  display: none !important;
}

/* ── Ensure nav and slideshow viewport layer correctly ── */
body.slideshow-active nav {
  z-index: 55;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.slideshow-active nav.nav-hidden {
  transform: translateY(-100%);
}

.slideshow-viewport {
  z-index: 50;
}

/* ── Responsive: smaller screens ── */
@media (max-width: 1024px) {
  .slideshow-frame .hero {
    padding: 36px 40px 32px;
  }
  .slideshow-frame .section {
    padding: 32px 40px;
  }
  .slideshow-frame .video-container {
    padding: 24px 40px;
  }
}
