/* v3.9: the "A better day out" film. Tokens come from site.v2.css, so light and dark follow the site.
   v3.10: one 75-second film in one clean frame. The video element defines the 16:9 box itself, with no border,
   ring or second dark wrapper, so poster and picture fill the same rounded silhouette at every width. */

.film-player { position: relative; margin: 0; }
/* No dark backing under the picture: a backing color shows as a dark arc in the anti-aliased corners. */
.film-frame { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-m); }
/* The box is exactly 16:9 like the film; cover only absorbs sub-pixel rounding, so no gutter can appear. */
.film-frame video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: inherit;
}
.film-frame video:fullscreen { object-fit: contain; border-radius: 0; }
.film-frame video:-webkit-full-screen { object-fit: contain; border-radius: 0; }
/* The homepage action: one way in, with the running time beside it. */
/* The duration is a quiet label beside the link text, never underlined with it. */
.film-duration { display: inline-block; margin-left: .5em; color: var(--muted); font-weight: 500; text-decoration: none; }
.film-play { display: inline-block; margin-right: .3em; font-size: .72em; vertical-align: .08em; }
.film-meta { margin: 0; font-size: .86rem; color: var(--muted); }
.film-error { margin: 10px 0 0; font-size: .92rem; color: var(--ink); }
.film-error[hidden] { display: none; }
.film-retry { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--brand-cta); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.film-retry:focus-visible { outline: 2px solid var(--brand-cta); outline-offset: 2px; }

/* The video description: collapsed, quiet, and complete enough to stand in for the film. */
.film-transcript-toggle { border-top: 1px solid var(--line); padding-top: 12px; }
.film-transcript-toggle summary { cursor: pointer; width: fit-content; font-weight: 600; font-size: .92rem; color: var(--brand-cta); }
.film-transcript-toggle summary:focus-visible { outline: 2px solid var(--brand-cta); outline-offset: 3px; border-radius: 4px; }
.film-transcript { display: grid; gap: 10px; margin-top: 12px; max-width: 68ch; font-size: .94rem; line-height: 1.6; color: var(--ink-2); }
.film-transcript p { margin: 0; }
.film-transcript strong { color: var(--ink); }
.film-transcript .film-credit { font-size: .84rem; color: var(--muted); }

/* Homepage dialog: sized by the film, so a short window narrows the whole dialog instead of letterboxing. */
.film-dialog {
  --film-pad: 24px; --film-chrome: 18.5rem;
  width: min(1040px, calc(100vw - 48px), calc((100dvh - var(--film-chrome)) * 16 / 9 + 2 * var(--film-pad)));
  min-width: min(320px, calc(100vw - 16px));
  max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 0;
  border-radius: var(--r-l); background: var(--card); color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.5); overflow: auto; overscroll-behavior: contain;
}
.film-dialog::backdrop { background: rgba(12, 16, 20, 0.66); }
.film-dialog-inner { display: grid; gap: 16px; padding: 0 var(--film-pad) var(--film-pad); }
.film-dialog-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 20px; background: var(--card);
}
.film-dialog-head h2 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.15; }
.film-dialog-head p { margin: 3px 0 0; font-size: .94rem; line-height: 1.45; color: var(--ink-2); }
.film-close {
  flex: none; min-width: 44px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.film-close:hover { border-color: var(--control-border); }
.film-close:focus-visible { outline: 2px solid var(--brand-cta); outline-offset: 3px; }
.film-dialog-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.film-dialog-foot .launch-button { min-height: 44px; }
html.film-open, html.film-open body { overflow: hidden; }

/* Phones: the film runs edge to edge across the dialog, the widest picture the screen allows. */
@media (max-width: 680px) {
  .film-dialog { --film-pad: 16px; width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  .film-dialog-inner { gap: 14px; }
  .film-dialog-head { padding-top: 14px; align-items: flex-start; }
  .film-dialog-head p { font-size: .9rem; }
  .film-dialog .film-player { margin-inline: calc(-1 * var(--film-pad)); }
  .film-dialog .film-frame { border-radius: 0; }
  .film-dialog .film-error { padding-inline: var(--film-pad); }
}
/* Landscape phones and other short windows: the film fits under the heading, Close stays in view,
   and the actions follow below. */
@media (max-height: 520px) {
  .film-dialog { --film-pad: 16px; --film-chrome: 6.5rem; width: min(1040px, calc(100vw - 16px), calc((100dvh - var(--film-chrome)) * 16 / 9 + 2 * var(--film-pad))); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .film-dialog-inner { gap: 12px; }
  .film-dialog-head { padding-top: 12px; }
  .film-dialog-head p { display: none; }
  .film-dialog .film-player { margin-inline: 0; }
  .film-dialog .film-frame { border-radius: var(--r-m); }
  .film-dialog .film-error { padding-inline: 0; }
}

/* /demo watch page */
.watch-intro { padding-block: 56px 28px; }
.watch-stage { display: grid; gap: 18px; padding-bottom: 56px; }
.watch-stage .film-frame { width: min(100%, calc((100dvh - 9rem) * 16 / 9)); margin-inline: auto; }
.watch-stage .film-player { display: grid; gap: 14px; }
.watch-chapters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.watch-chapters button {
  min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.watch-chapters button:hover { border-color: var(--brand-cta); }
.watch-chapters button:focus-visible { outline: 2px solid var(--brand-cta); outline-offset: 2px; }
.watch-chapters button[aria-current="true"] { border-color: var(--brand-cta); color: var(--brand-cta); }
.watch-chapters .t { color: var(--muted); font-weight: 500; margin-left: 6px; }
.watch-side { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.watch-side p { margin: 0; }
/* Older links to the short introduction now land on this film. */
#short { scroll-margin-top: 84px; }
@media (max-width: 680px) {
  .watch-intro { padding-block: 40px 18px; }
  .watch-chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-chapters button { width: 100%; font-size: .84rem; text-align: left; }
}
/* Edge to edge on upright phones, like the dialog; a phone on its side keeps the height-capped frame. */
@media (max-width: 680px) and (orientation: portrait) {
  .watch-stage .film-frame { width: auto; margin-inline: calc((100% - 100vw) / 2); border-radius: 0; }
}
