/* The film player: a fixed 16:9 frame with rounded corners, so nothing shifts while the poster or film loads.
   Uses the site's color variables from styles.css, with fallbacks so it also works on its own. */

.film-player {
  --film-radius: 16px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--film-radius);
  overflow: hidden;
  /* Keeps the rounded clip on Safari while the video plays. */
  isolation: isolate;
  background: #0b0805;
  box-shadow: 0 0 0 1px rgba(243, 234, 219, 0.09);
}

.film-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0805;
  border-radius: inherit;
}

.film-video:focus-visible {
  outline: 2px solid var(--gold, #E0B567);
  outline-offset: -2px;
}

.film-fallback {
  margin: 0;
  padding: 24px;
  color: var(--cream, #F3EADB);
}

/* The big play button covers the whole poster, so a click anywhere on it starts the film. */
.film-play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, rgba(14, 10, 7, 0.28), rgba(14, 10, 7, 0) 62%);
  color: #1A130D;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.film-play[hidden] { display: none; }

.film-play-icon {
  display: grid;
  place-items: center;
  width: clamp(60px, 13%, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(243, 234, 219, 0.94);
  box-shadow: 0 0 0 10px rgba(243, 234, 219, 0.16), 0 14px 36px rgba(0, 0, 0, 0.4);
  transition: transform 0.45s var(--ease, cubic-bezier(.16, 1, .3, 1)), background-color 0.2s ease;
}

.film-play-icon svg {
  width: 40%;
  height: 40%;
  /* The triangle's visual center sits right of its box center. */
  margin-left: 7%;
  fill: currentColor;
}

.film-play:hover .film-play-icon {
  transform: scale(1.07);
  background: #ffffff;
}

.film-play:focus-visible { outline: none; }

.film-play:focus-visible .film-play-icon {
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--panel, #15100b), 0 0 0 7px var(--gold, #E0B567), 0 14px 36px rgba(0, 0, 0, 0.4);
}

.film-error {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(14, 10, 7, 0.88);
  color: var(--cream, #F3EADB);
  font-size: 14px;
  line-height: 1.4;
}

.film-error:empty { display: none; }

/* Windows high contrast drops box shadows, so draw the focus ring as an outline there. */
@media (forced-colors: active) {
  .film-play:focus-visible .film-play-icon { outline: 3px solid CanvasText; outline-offset: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .film-play-icon { transition: none; }
  .film-play:hover .film-play-icon { transform: none; }
}
