/* ===========================================================================
   Fullscreen slideshow — Ken Burns motion + crossfade.
   =========================================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

.show {
  position: fixed;
  inset: 0;
  outline: none;
  cursor: default;
  background: #000;
}
.show.idle { cursor: none; }
.show.idle .ui,
.show.idle .caption { opacity: 0; }

/* --- Crossfading image layers -------------------------------------------- */

.layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease;
  will-change: opacity, transform;
}
.layer.is-active { opacity: 1; }

/* Ken Burns: slow zoom/pan while a layer is active. The animation name is
   toggled per slide from JS so each transition restarts the motion. */
@keyframes kb-in {
  from { transform: scale(1.0) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, -1%); }
}
@keyframes kb-out {
  from { transform: scale(1.12) translate(1.5%, 1%); }
  to   { transform: scale(1.0) translate(0, 0); }
}
.layer.kb-a { animation: kb-in 6s ease-out forwards; }
.layer.kb-b { animation: kb-out 6s ease-out forwards; }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to top, rgba(0,0,0,0.6), transparent 22%);
}

/* --- Progress bar -------------------------------------------------------- */

.progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
  z-index: 5;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: #e8b04b;
  transform-origin: left;
}

/* --- Controls ------------------------------------------------------------ */

.ui {
  position: absolute;
  left: 0; right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(18px, env(safe-area-inset-left)) 0 max(18px, env(safe-area-inset-right));
  transition: opacity 0.35s ease;
}
.ui__center { display: flex; align-items: center; gap: 10px; }
.ui__left, .ui__right { display: flex; align-items: center; gap: 12px; min-width: 120px; }
.ui__right { justify-content: flex-end; }

.ctl {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.ctl:hover { background: rgba(255,255,255,0.22); }
.ctl:active { transform: scale(0.92); }
.ctl:focus-visible { outline: 2px solid #e8b04b; outline-offset: 2px; }
.ctl--play { width: 58px; height: 58px; background: rgba(232,176,75,0.9); color: #1a1206; }
.ctl--play:hover { background: #e8b04b; }

.counter {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}

.caption {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 70px);
  z-index: 6;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  padding: 0 20px;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

/* --- Empty / misc -------------------------------------------------------- */

.empty {
  position: fixed; inset: 0;
  display: grid; place-content: center; gap: 14px;
  text-align: center; color: #aaa;
}
.empty a { color: #e8b04b; }

@media (max-width: 600px) {
  .ui__left, .ui__right { min-width: 0; }
  .counter { display: none; }
  .ctl { width: 42px; height: 42px; }
  .ctl--play { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .layer.kb-a, .layer.kb-b { animation: none; }
  .layer { transition-duration: 0.4s; }
}
