/* Video player (docs/design/final/Mobile.png: a 1182 × 643 frame; Main Controller.png; Progress bar & Info.png).
   "ready": the video's picture with the drawn controls. "playing": the provider's iframe fills the frame and nothing
   is drawn over it (YouTube forbids overlays on its player), so the close, title and previous / next move outside. */
.video-player {
  --vp-w: min(1182px, calc(100vw - 32px), calc((100vh - 220px) * 1182 / 643));
  width: var(--vp-w); max-width: none; max-height: none; padding: 0; border: 0;
  background: transparent; color: #fff; overflow: visible;
}
.video-player::backdrop { background: rgb(10 14 14 / .88); }
.video-player__frame {
  position: relative; aspect-ratio: 1182 / 643; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, #2b2a26, var(--footer-bar));
}
.video-player__poster, .video-player__embed, .video-player__shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-player__poster { object-fit: cover; }
.video-player__embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-player__shade {
  background:
    linear-gradient(to bottom, rgb(0 0 0 / .32), rgb(0 0 0 / 0) 24%),
    linear-gradient(to bottom, rgb(13 17 17 / 0) 76%, rgb(13 17 17 / .62) 90%, rgb(13 17 17 / .94) 98%);
}
[data-state="ready"] .video-player__frame { cursor: pointer; }

/* Round blurred buttons (Mobile ∕ Small buttons.svg: 25 % black, 20px background blur, a faint light rim). */
.video-player__button, .video-player__close {
  position: relative; display: grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 50%;
  color: #fff; cursor: pointer;
}
.video-player__button {
  background: rgb(0 0 0 / .25); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset -1px 1px 1px 1px rgb(255 255 255 / .22);
}
.video-player__button::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(200deg, rgb(255 255 255 / .2), rgb(255 255 255 / 0) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.video-player__button[hidden] { display: none; }
.video-player__button svg { fill: currentColor; }
.video-player__button--step { width: 66px; height: 66px; color: rgb(255 255 255 / .72); }
.video-player__button--step svg { width: 20px; height: 20px; }
.video-player__button--main { width: 98px; height: 98px; }
.video-player__button--main svg { width: 32px; height: 38px; margin-inline-start: var(--sp-2); }
.video-player__button:hover { background: rgb(0 0 0 / .4); color: #fff; }
.video-player__button:focus-visible, .video-player__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.video-player__close { position: absolute; z-index: 2; top: var(--sp-5); left: var(--sp-5); } /* the look is shared (components.css) */
.video-player__close svg { fill: none; stroke: currentColor; stroke-linecap: round; }

.video-player__controls {
  position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: var(--sp-4);
}

.video-player__info {
  position: absolute; z-index: 1; left: 32px; right: 32px; bottom: 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--sp-5); pointer-events: none;
}
.video-player__title, .video-player__date { grid-column: 1; text-align: left; unicode-bidi: plaintext; }
.video-player__title { font-size: var(--fs-lead); font-weight: 400; line-height: 1.5; }
.video-player__date { font-size: var(--fs-xs); line-height: 1.5; }
.video-player__time { grid-column: 2; grid-row: 2; direction: ltr; font-size: var(--fs-xs); line-height: 1.5; font-weight: 300; letter-spacing: -0.03em; white-space: nowrap; margin-bottom: -7px; }
.video-player__time[hidden] { display: none; }
.video-player__track { grid-column: 1 / -1; height: 2px; margin-top: var(--sp-4); border-radius: var(--r-sm); background: rgb(255 255 255 / .33); }

/* Playing: the iframe alone in the frame; close above it, title and previous / next below it. */
[data-state="playing"] .video-player__poster,
[data-state="playing"] .video-player__shade,
[data-state="playing"] .video-player__time,
[data-state="playing"] .video-player__track,
[data-state="playing"] .video-player__button--main { display: none; }
[data-state="playing"] .video-player__frame { overflow: visible; }
[data-state="playing"] .video-player__embed { border-radius: inherit; overflow: hidden; }
[data-state="playing"] .video-player__close {
  top: -56px; left: 0; width: 44px; height: 44px; background: rgb(255 255 255 / .15);
}
[data-state="playing"] .video-player__close svg { width: 16px; height: 16px; }
[data-state="playing"] .video-player__controls { top: calc(100% + 14px); left: auto; right: 0; transform: none; gap: var(--sp-3); }
[data-state="playing"] .video-player__button--step { width: 44px; height: 44px; }
[data-state="playing"] .video-player__button--step svg { width: 16px; height: 16px; }
[data-state="playing"] .video-player__info { top: calc(100% + 14px); bottom: auto; left: 0; right: 112px; }
[data-state="playing"] .video-player__title { font-size: var(--fs-lead); }

@media (max-width: 900px) {
  .video-player__frame { border-radius: var(--r-lg); }
  .video-player__close { top: 10px; left: 12px; }
  .video-player__button--step { width: 48px; height: 48px; }
  .video-player__button--step svg { width: 16px; height: 16px; }
  .video-player__button--main { width: 68px; height: 68px; }
  .video-player__button--main svg { width: 22px; height: 26px; margin-inline-start: var(--sp-1); }
  .video-player__info { left: 18px; right: 18px; bottom: 14px; }
  .video-player__title { font-size: var(--fs-lead); }
  .video-player__date, .video-player__time { font-size: var(--fs-xs); }
  .video-player__track { margin-top: var(--sp-3); }
}
@media (max-width: 560px) {
  .video-player__frame { border-radius: var(--r-md); }
  .video-player__close { top: 4px; left: 4px; width: 44px; height: 44px; }
  .video-player__close svg { width: 15px; height: 15px; }
  .video-player__controls { gap: var(--sp-3); }
  .video-player__button--step { width: 38px; height: 38px; }
  .video-player__button--step svg { width: 13px; height: 13px; }
  .video-player__button--main { width: 52px; height: 52px; }
  .video-player__button--main svg { width: 17px; height: 20px; margin-inline-start: var(--sp-1); }
  .video-player__info { left: 14px; right: 14px; bottom: 10px; column-gap: var(--sp-3); }
  .video-player__title { font-size: var(--fs-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  [data-state="playing"] .video-player__title { white-space: normal; }
  .video-player__date, .video-player__time { font-size: var(--fs-xs); }
  .video-player__time { margin-bottom: -4px; }
  .video-player__track { margin-top: var(--sp-2); }
}
