/* Site video player — the shared chrome for every video on the site (first built
   for the TrialFront hero film; class names keep the tf-film prefix).
   Pair with assets/film-player.js. Markup: see news-cshl-exploring-the-genome-talk.html
   (click-to-play, with sound) or trialfront.html (muted autoplay). */
.tf-film { position: relative; border-radius: 8px; overflow: hidden; background: #F7F2EB; box-shadow: 0 10px 28px -8px rgba(63, 53, 35, 0.26); aspect-ratio: 16 / 9; max-width: 100%; }
.tf-film__video { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.tf-film__bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 999px; background: rgba(32, 48, 89, 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #F8F5EC; opacity: 0; transform: translateY(4px); transition: opacity 180ms ease, transform 180ms ease; }
.tf-film:hover .tf-film__bar, .tf-film:focus-within .tf-film__bar, .tf-film[data-state="paused"] .tf-film__bar { opacity: 1; transform: none; }
@media (hover: none) { .tf-film__bar { opacity: 1; transform: none; } }
.tf-film__btn { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.tf-film__btn:hover { color: #FC8765; }
.tf-film__btn:focus-visible, .tf-film__track:focus-visible { outline: 2px solid #FC8765; outline-offset: 2px; }
.tf-film__btn svg { width: 16px; height: 16px; }
.tf-film .tf-film__icon-play { display: none; }
.tf-film[data-state="paused"] .tf-film__icon-play { display: block; }
.tf-film[data-state="paused"] .tf-film__icon-pause { display: none; }
.tf-film__track { position: relative; flex: 1; height: 4px; border-radius: 999px; background: rgba(248, 245, 236, 0.28); cursor: pointer; }
.tf-film__track::before { content: ""; position: absolute; inset: -8px 0; }
.tf-film__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: #F86447; }
/* Sound: an autoplaying film starts muted (browser rule); "Play with sound" restarts it with narration. */
.tf-film .tf-film__icon-sound { display: none; }
.tf-film[data-sound="on"] .tf-film__icon-sound { display: block; }
.tf-film[data-sound="on"] .tf-film__icon-muted { display: none; }
.tf-film__sound-cta { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px; border: 0; border-radius: 999px; background: rgba(32, 48, 89, 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #F8F5EC; font: 500 14px/1 "Inter Tight", system-ui, sans-serif; cursor: pointer; transition: opacity 220ms ease, background-color 160ms ease; }
.tf-film__sound-cta svg { width: 16px; height: 16px; flex: none; }
.tf-film__sound-cta:hover { background: rgba(32, 48, 89, 0.95); color: #FC8765; }
.tf-film__sound-cta:focus-visible { outline: 2px solid #FC8765; outline-offset: 2px; }
.tf-film[data-sound="on"] .tf-film__sound-cta { opacity: 0; pointer-events: none; }
@media (min-width: 768px) { .tf-film__sound-cta { top: 16px; left: 16px; font-size: 15px; } }
/* Captions: off by default; CC button in the bar. Inter Tight on a soft Dark Delft band. */
.tf-film[data-cc="on"] .tf-film__cc { color: #FC8765; }
.tf-film__video::cue { font-family: "Inter Tight", system-ui, sans-serif; font-weight: 500; font-size: 0.95em; line-height: 1.35; color: #F8F5EC; background-color: rgba(32, 48, 89, 0.84); }

/* Click-to-play films: a "Play" pill in the same slot and style as "Play with sound";
   it leaves once the film has started. */
.tf-film__play-cta { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px; border: 0; border-radius: 999px; background: rgba(32, 48, 89, 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #F8F5EC; font: 500 14px/1 "Inter Tight", system-ui, sans-serif; cursor: pointer; transition: opacity 220ms ease, background-color 160ms ease; }
.tf-film__play-cta svg { width: 16px; height: 16px; flex: none; }
.tf-film__play-cta:hover { background: rgba(32, 48, 89, 0.95); color: #FC8765; }
.tf-film__play-cta:focus-visible { outline: 2px solid #FC8765; outline-offset: 2px; }
.tf-film[data-started] .tf-film__play-cta { opacity: 0; pointer-events: none; }
@media (min-width: 768px) { .tf-film__play-cta { top: 16px; left: 16px; font-size: 15px; } }
/* Elapsed / total time — for long films; omit the element on short ones. */
.tf-film__time { flex: none; font: 500 12px/1 "Google Sans Code", ui-monospace, monospace; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: #F8F5EC; white-space: nowrap; }
/* Full screen keeps the custom bar: the whole player goes full screen, not the bare video. */
.tf-film:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; max-width: none; background: #000; box-shadow: none; }
.tf-film:fullscreen .tf-film__video { object-fit: contain; }

/* YouTube variant (assets/film-player-youtube.js): the picture is a YouTube embed, so the
   bar sits under it as a strip. YouTube's API terms do not allow anything drawn over the player. */
.tf-film--yt { aspect-ratio: auto; display: flex; flex-direction: column; background: #14142F; }
.tf-film--yt .tf-film__stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.tf-film--yt .tf-film__frame, .tf-film--yt .tf-film__frame iframe, .tf-film--yt .tf-film__stage > iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.tf-film--yt .tf-film__poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #14142F; cursor: pointer; }
.tf-film--yt .tf-film__poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tf-film--yt .tf-film__poster:hover .tf-film__play-cta { background: rgba(32, 48, 89, 0.95); color: #FC8765; }
.tf-film--yt .tf-film__poster:focus-visible { outline: 2px solid #FC8765; outline-offset: -4px; }
.tf-film--yt[data-started] .tf-film__poster { display: none; }
.tf-film--yt .tf-film__bar { position: static; opacity: 1; transform: none; border-radius: 0; padding: 8px 12px; background: #203059; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tf-film--yt .tf-film__bar[hidden] { display: none; }
.tf-film--yt:fullscreen { background: #000; }
.tf-film--yt:fullscreen .tf-film__stage { flex: 1; aspect-ratio: auto; }
/* The poster is someone else's artwork with its own title top-left, so the play pill sits centred. */
.tf-film--yt .tf-film__play-cta { top: 50%; left: 50%; transform: translate(-50%, -50%); }
