/* ============================================================
   HERO YOUTUBE VIDEO — CSS CROP (object-fit:cover for iframes)
   Uses aspect-ratio + min-% to handle any container size properly.
   Iframe is offset DOWN and RIGHT to crop the YouTube HUD
   (title bar, controls) behind overflow:hidden.
   Targets both YouTube IFrame API and direct embed fallback.
   ============================================================ */

/* The wrapper — overflow hides the scaled-up iframe edges */
.hero-bg.cropped-video {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0 !important;
  background: #000;
}

/* The poster image — fades out on video load */
.hero-bg .hero-video-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

/* The YouTube API player div — fills container, its iframe covers it */
#hero-youtube-player {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0;
  pointer-events: none !important;
}

/* YouTube API generates an iframe inside #hero-youtube-player */
/* Both the API iframe and the fallback direct iframe get the same crop */
.hero-bg.cropped-video #hero-youtube-player iframe,
.hero-bg.cropped-video .hero-youtube-iframe {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: auto !important;
  height: auto !important;
  min-width: 100% !important;
  min-height: 100% !important;
  aspect-ratio: 16 / 9 !important;
  /* Shift right 15px, down 55px to crop title bar + HUD edges */
  transform: translate(calc(-50% + 15px), calc(-50% + 55px)) !important;
  pointer-events: none !important;
  border: none !important;
  z-index: 2;
  filter: blur(0);
}
