/* ==========================================================================
   Slideshow — stage-screen storytelling
   Nod to Homecoming King / The King's Jester: one big screen behind the
   comedian, one story beat per slide, framed by bands of stage light.
   ========================================================================== */

.slideshow {
  position: relative;
  /* the screen stays pinned while these steps scroll past */
  --steps: 5;
  margin-bottom: var(--space-section);
}

.slideshow__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(1rem, 3vh, 2rem);
  padding: 4.5rem var(--page-pad) 2rem;
  background:
    radial-gradient(70% 55% at 50% 50%, rgba(255,70,60,0.18), transparent 70%),
    linear-gradient(180deg, #1d0306 0%, #2a050a 50%, #1d0306 100%);
  overflow: hidden;
}

/* Bands of stage light above and below the screen */
.slideshow__band {
  width: min(100%, 980px);
  height: 6px;
  background: linear-gradient(90deg, transparent, rgba(255,240,230,0.95) 20%, #fff 50%, rgba(255,240,230,0.95) 80%, transparent);
  box-shadow: 0 0 24px 4px rgba(255,120,100,0.55), 0 0 70px 12px rgba(227,20,31,0.35);
  opacity: 0.85;
}

.screen {
  position: relative;
  width: min(100%, 980px);
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  background: #0c0102;
  border-radius: var(--radius-sm);
  box-shadow: 0 40px 120px -30px rgba(227,20,31,0.55);
  overflow: hidden;
}

.screen__slides { position: absolute; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(0.4rem, 1.5vw, 1rem);
  padding: clamp(1rem, 4vw, 3rem);
  text-align: center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity var(--duration-normal) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}
.slide.is-active { opacity: 1; transform: none; }

.slide__kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 0.5rem + 0.5vw, 0.8rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

/* 1. Photo slide: label, foto, keterangan rapat sebagai satu kelompok di tengah */
.slide--photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2.2vh, 1.2rem);
}
.slide__photo {
  position: relative;
  height: 58%;
  min-height: 0;
  width: auto;
  max-width: 100%;
  flex-shrink: 1;
  aspect-ratio: 7 / 8;
  container-type: inline-size;
  overflow: hidden;
  border: 6px solid var(--cream);
  border-radius: var(--radius-sm);
  transform: rotate(-2deg);
}
.slide__caption {
  margin: 0;
  max-width: 28ch;
  text-wrap: balance;
  font-size: clamp(0.75rem, 0.6rem + 0.7vw, 1.1rem);
  font-weight: 600;
  line-height: 1.3;
}

.slide__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

/* 2–3. Statement slides */
.slide__big {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 125%;
  /* Diukur dari lebar layar (cqi), bukan viewport: baris terpanjang
     "Too 'everywhere" = 12,9em, jadi 6,6cqi selalu muat di dalam padding. */
  font-size: min(4.4rem, 6.6cqi);
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
}
.slide--inverse { background: var(--red-500); }

/* 4. T-table that fills in row by row */
.ttable {
  width: min(100%, 720px);
  border-collapse: collapse;
  font-size: clamp(0.7rem, 0.5rem + 1vw, 1.25rem);
}
.ttable th {
  padding: 0 0.8em 0.5em;
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.5em;
  text-transform: uppercase;
  border-bottom: 3px solid var(--white);
}
.ttable th + th, .ttable td + td { border-left: 3px solid var(--white); }
.ttable td { padding: 0.6em 0.8em; font-weight: 500; }
.ttable tbody tr {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}
.slide--table.is-active tbody tr { opacity: 1; transform: none; }
.slide--table.is-active tbody tr:nth-child(1) { transition-delay: 250ms; }
.slide--table.is-active tbody tr:nth-child(2) { transition-delay: 750ms; }
.slide--table.is-active tbody tr:nth-child(3) { transition-delay: 1250ms; }

/* 5. End card */
.slide--end { background: linear-gradient(180deg, var(--red-400), var(--red-700)); }
.slide__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 125%;
  font-size: min(6.5rem, 11cqi); /* "Diplobrat" = 7,5em, selalu muat di layar */
  line-height: 0.9;
  text-transform: uppercase;
}
.slide__date {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 0.6rem + 0.8vw, 1.2rem);
}

/* Presenter HUD */
.screen__hud {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 0.5rem + 0.3vw, 0.7rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  pointer-events: none;
}
.screen__live::before {
  content: "";
  display: inline-block;
  width: 0.55em; height: 0.55em;
  margin-right: 0.5em;
  background: var(--red-300);
  border-radius: 50%;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse { 50% { opacity: 0.25; } }

/* Invisible scroll steps that drive the slides */
.slideshow__steps { list-style: none; margin: -100vh 0 0; padding: 0; }
.slideshow__steps li { height: 70vh; }
.slideshow__steps li:first-child { height: 100vh; }

/* Phones: a portrait screen reads better than a letterboxed 16:9 */
@media (max-width: 640px) {
  .screen { aspect-ratio: 4 / 5; }
  .slide { padding-bottom: 2.6rem; }
  .slide__photo { height: 56%; }
  /* Di HP baris panjang boleh pecah; kata terpanjang "'everywhere" = 9,74em, 8,4cqi tetap muat. */
  .slide__big { font-size: 8.4cqi; }
  .ttable { font-size: 0.82rem; }
  .ttable th { font-size: 1.35em; }
  .ttable td { padding: 0.7em 0.5em; }
}

@media (prefers-reduced-motion: reduce) {
  .slide, .ttable tbody tr { transition: none; }
  .screen__live::before { animation: none; }
}
