/* =========================================================
   VIDEOS LIST: admin-managed episodes (videos list collection).
   videos.html: episode cards rendered per request into
   [data-list="videos"] (functions/_lib/video-render.js).
   index.html: the branded tile used by the homepage feature when
   an admin episode has no poster image.
   Loaded after videos.css; reuses its masthead, meta and teaser
   rules. Tokens from design-system.css.
   ========================================================= */

/* Under the photo header the stage is no longer the page opener:
   a lighter top so the two dark bands read as header, then episode. */
.site-page-header + .vid-stage { padding-top: clamp(2rem, 4vw, 3.5rem); }

.vid-episodes { display: grid; gap: var(--s-7); }
.vid-row--episodes .vid-row-body { max-width: none; }

.vid-episodes-empty {
  margin: 0;
  font: italic 400 1.0625rem/1.5 var(--font-serif);
  color: var(--navy-deep);
}

/* ---- Episode card: framed screen over the episode copy ---- */
.vid-episode-card {
  display: grid;
  gap: var(--s-5);
  padding-bottom: var(--s-7);
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 6rem;
}

.vid-episode-card:last-of-type { padding-bottom: 0; border-bottom: 0; }

.vid-episode-screen {
  position: relative;
  padding: 12px;
  background: var(--navy-900);
  box-shadow: 0 10px 24px -14px rgba(10, 24, 48, 0.35),
    0 30px 60px -30px rgba(10, 24, 48, 0.55);
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--navy-900) 35%, transparent),
    0 30px 60px -30px color-mix(in srgb, var(--navy-900) 55%, transparent);
}

.vid-episode-screen::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--hairline-gold);
  pointer-events: none;
}

/* Cover = <summary> of a native <details>: opening it swaps in the player. */
.vid-episode-watch > summary { list-style: none; }
.vid-episode-watch > summary::-webkit-details-marker { display: none; }
.vid-episode-watch[open] > summary { display: none; }
.vid-episode-cover { position: relative; display: block; cursor: pointer; }
.vid-episode-cover:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.vid-episode-cover:hover .vid-play,
.vid-episode-cover:focus-visible .vid-play { transform: scale(1.06); background: var(--gold); border-color: var(--gold); }
.vid-episode-cover:hover .vid-play::before,
.vid-episode-cover:focus-visible .vid-play::before { border-left-color: var(--navy-900); }

.vid-episode-player,
.vid-episode-poster {
  display: block;
  width: 100%;
  border: 0;
  background: #000;
}

iframe.vid-episode-player { aspect-ratio: 16 / 9; height: auto; }
video.vid-episode-player { height: auto; max-height: 80vh; object-fit: contain; }
.vid-episode-poster { height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.vid-episode-player:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.vid-episode-copy .vid-masthead { margin-bottom: var(--s-3); }

.vid-episode-title {
  margin: 0 0 var(--s-3);
  font: 600 clamp(1.375rem, 2.4vw, 1.875rem)/1.18 var(--font-serif);
  color: var(--navy-deep);
}

.vid-episode-summary {
  margin: 0;
  max-width: 62ch;
  font: 400 1.0625rem/1.65 var(--font-body);
  color: var(--text-secondary);
}

.vid-episode-copy .vid-meta--light { margin-top: var(--s-4); }

/* ---- Branded tile: no poster yet (card screen and homepage cover) ---- */
.vid-tile {
  display: grid;
  place-items: center;
  width: 100%;
  background:
    radial-gradient(80% 80% at 30% 35%, rgba(42, 82, 160, 0.35) 0%, transparent 70%),
    var(--navy-900);
  background:
    radial-gradient(80% 80% at 30% 35%, color-mix(in srgb, var(--navy-light) 35%, transparent) 0%, transparent 70%),
    var(--navy-900);
}

.vid-episode-tile { aspect-ratio: 16 / 9; }
.vid-teaser-tile { aspect-ratio: 1 / 1; }
.vid-tile .vid-mark--stacked .vid-mark-name { font-size: 1.5rem; }
.vid-tile .vid-mark--stacked .vid-mark-word { font-size: 0.625rem; }

@media (prefers-reduced-motion: reduce) {
  .vid-episode-cover:hover .vid-play,
  .vid-episode-cover:focus-visible .vid-play { transform: none; }
}

@media (min-width: 900px) {
  .vid-episode-card {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--s-6);
    align-items: center;
  }
}

/* The admin-episodes row ships hidden (no episodes = nothing extra on the
   page); .vid-row's display:grid would otherwise beat the UA [hidden] rule. */
.vid-row--episodes[hidden] { display: none; }
