/* ============================================
   MEDIA BACKGROUND (image or auto-playing video, shared component)
   ============================================ */

.media-video {
  position: relative;
  overflow: hidden;
}

/* Oversized via viewport units and centered so it always covers its
   container regardless of aspect ratio — a container can never be bigger
   than the viewport, so this is always large enough, cropped by
   .media-video's overflow: hidden. Needed for both platforms: Vimeo's
   "background" player mode doesn't reliably auto-cover a container sized
   by CSS rather than its own responsive embed script, and YouTube never
   auto-covers on its own. */
.media-video__iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78vh; /* 16 / 9 * 100vh */
  height: 56.25vw; /* 9 / 16 * 100vw */
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  animation: media-video-reveal 0s linear 0.8s forwards;
}

/* YouTube briefly shows its own paused-state play/pause/skip controls while
   it loads, before autoplay actually kicks in — controls=0 only hides the
   bottom control bar, not this. Fading the iframe in after a short delay
   hides that flash instead of trying to suppress it directly. */
@keyframes media-video-reveal {
  to {
    opacity: 1;
  }
}
