/* An event's film (public/hub/film.js): the silent film behind a card, the words gliding in, the sound
   button and the player. Colours come from wherever the card sits (the hub's look of the day, an event
   page's theme); the film itself is the park's own Ivory & Pine. */

/* the silent film behind a card: the still at once, the film fading in over it once it plays */
.film-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; border-radius: inherit; pointer-events: none; }
.film-bg img, .film-bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--film-at, 50% 22%); display: block; }
.film-bg video { opacity: 0; transition: opacity .8s ease; }
.film-bg video.is-playing { opacity: 1; }

/* the words arrive one after another; "Details coming soon" last, slower */
:is([data-film-card], [data-reveal]) [data-r] { opacity: 0; transform: translateY(10px); filter: blur(4px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1), filter .7s; }
:is([data-film-card], [data-reveal]).is-in [data-r] { opacity: 1; transform: none; filter: none; }
:is([data-film-card], [data-reveal]).is-in [data-r="2"] { transition-delay: .2s; }
:is([data-film-card], [data-reveal]).is-in [data-r="3"] { transition-delay: .9s; transition-duration: 1.1s; }
:is([data-film-card], [data-reveal]).is-in [data-r="4"] { transition-delay: 1.3s; }
@media (prefers-reduced-motion: reduce) {
  :is([data-film-card], [data-reveal]) [data-r] { transform: none; filter: none; transition: opacity .3s; transition-delay: 0s !important; }
}

/* "Details coming soon": a soft light that keeps breathing (the card's own ink: the accent stays on the button) */
.film-soon { display: flex; align-items: center; gap: 8px; }
.film-soon > i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; animation: film-soon 2.6s ease-out infinite; }
@keyframes film-soon { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, currentColor 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .film-soon > i { animation: none; } }
[data-film-count]:empty { display: none; }
[data-film-count]::before { content: "· "; }

/* buttons on a film card sit above the card's link */
.film-int, .film-snd { position: relative; z-index: 1; font: inherit; border: 0; cursor: pointer; }
.film-int svg { width: 16px; height: 16px; flex: none; }
.film-snd { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: transparent;
  color: inherit; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 50%, transparent); }
.film-snd svg { width: 18px; height: 18px; }
.film-int:focus-visible, .film-snd:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.film-link { color: inherit; text-decoration: none; }
.film-link::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.film-link:focus-visible { outline: none; }
.film-link:focus-visible::after { outline: 2px solid currentColor; outline-offset: -4px; }

/* the player: the film full screen on the park's ivory, like the launch film's */
.film-player { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; justify-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: #fbf7ef; color: #23493a; }
.film-player[hidden] { display: none; }
.film-player-top { width: 100%; max-width: 520px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.film-player-name { font: 700 11px/1.2 var(--font-sans, system-ui); letter-spacing: .2em; text-transform: uppercase; color: #8a6420; }
.film-close { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(35, 73, 58, .08); color: #23493a; font-size: 1.625rem; line-height: 1; cursor: pointer; }
.film-close:focus-visible, .film-again:focus-visible, .film-end .film-int:focus-visible { outline: 2px solid #23493a; outline-offset: 2px; }
.film-player video { height: 100%; min-height: 0; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 22px; background: #fbf7ef;
  box-shadow: 0 0 0 1px #eadfc9, 0 20px 50px rgba(35, 73, 58, .18); }
.film-end { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.film-end[hidden] { display: none; }
.film-again, .film-end .film-int { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 1rem; }
.film-again { background: rgba(35, 73, 58, .08); color: #23493a; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.film-again svg { width: 18px; height: 18px; }
.film-end .film-int { background: #d9822b; color: #1d2b24; }   /* Ivory & Pine: its accent and ink */
.film-end .film-int.is-on { background: transparent; color: #23493a; box-shadow: inset 0 0 0 1.5px rgba(35, 73, 58, .35); }
.film-words { width: 100%; max-width: 520px; font-size: var(--text-callout, 1rem); }
.film-words summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.film-words div { max-height: 30dvh; overflow-y: auto; padding: 0 0 12px; }
.film-words p { margin: 0 0 8px; line-height: 1.45; }

/* "I'm interested": tiny kites lift off the button (film.js celebrate), and a moment of "We'll let you know" */
.film-burst { position: fixed; z-index: 400; width: 0; height: 0; pointer-events: none; }
.film-burst i { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 1.5px; opacity: 0; }
.film-thanks { display: none; }
.film-soon.is-thanks > span:not(.film-thanks) { display: none; }
.film-soon.is-thanks > .film-thanks { display: inline; animation: film-thanks .45s ease both; }
@keyframes film-thanks { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .film-soon.is-thanks > .film-thanks { animation: none; } }
.film-int.is-on svg { animation: film-tick .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes film-tick { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .film-int.is-on svg { animation: none; } }
