/*
 * Neptune Oceanic — background YouTube video (pairs with assets/js/yt-background.js)
 *
 * The host element (.js-yt-bg) keeps whatever position, size and transform the
 * theme gives it. Inside it sit two layers: the poster image and the player
 * iframe. The poster copies the framing rules the theme applies to the iframe
 * in each place it is used, and letterboxes on black exactly as the player
 * does, so the crossfade between the two is invisible.
 */

.yt-bg {
    position: relative;
}

/* The iframe's size and placement are deliberately NOT set here: each
   section's own stylesheet rules already size it (the banner's
   .video-container iframe, the cards' .exp-youtube-player iframe, the hero's
   .about-us-hero-video-wrapper iframe), and the poster below copies those. */
.yt-bg > iframe {
    border: 0;
    pointer-events: none;
}

/* Only the poster is positioned here. The placeholder the player is built
   into must carry no layout: the YouTube API copies its class onto the
   iframe it creates, so anything set on it would land on the iframe too. */
.yt-bg > .yt-bg-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.yt-bg > .yt-bg-poster {
    display: block;
    object-fit: contain;
    object-position: center;
    background: #000;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.7s ease;
}

.yt-bg.is-live > .yt-bg-poster {
    opacity: 0;
}

/* A hand-made poster (data-poster on the host) is a photograph chosen for the
   frame, so it covers it edge to edge; YouTube stills stay letterboxed above
   to match the player behind them. */
.yt-bg.is-custom > .yt-bg-poster {
    object-fit: cover;
}

/* The player never receives a pointer, so it can never show hover or tap
   controls. Belt and braces over the theme's own rules. */
.yt-bg iframe {
    pointer-events: none !important;
}

/* ---- per-placement framing, mirroring the theme's iframe rules ---------- */

/* Homepage banner: style.css scales .video-container iframe by 1.15 (3 on
   mobile). Absolute positioning is already set by the theme on the host
   (#bannerPlayer sits inside .video-container). */
.video-container .yt-bg > .yt-bg-poster {
    transform: scale(1.15);
    transform-origin: center center;
}

@media (max-width: 768px) {
    .video-container .yt-bg > .yt-bg-poster {
        transform: scale(3);
    }
}

/* About-us hero: the theme centres the iframe at 100vw x 100vh scaled 1.3
   (3 on mobile). The host fills the wrapper; the poster copies the iframe. */
.about-us-hero-video-wrapper .yt-bg {
    position: absolute;
    inset: 0;
}

.about-us-hero-video-wrapper .yt-bg > .yt-bg-poster {
    inset: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.3);
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
}

@media (max-width: 767px) {
    .about-us-hero-video-wrapper .yt-bg > .yt-bg-poster {
        transform: translate(-50%, -50%) scale(3);
    }
}

/* Experience cards: the host itself carries the theme's scale(1.7), so the
   poster inherits it and needs nothing extra. */

/* ---- hand-made posters ------------------------------------------------- */

/* The per-placement zooms above exist only to hide the letterbox of a
   YouTube still. A photograph chosen for the frame needs none of that: it
   sits in the host's own box, covers it, and keeps its full resolution.
   Declared last so it outranks every placement rule, including the mobile
   media queries. */
.yt-bg.is-custom > .yt-bg-poster {
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    transform: none !important;
    object-fit: cover;
}

/* ---- placement rules moved from the template parts' inline <style> blocks ----
   These used to be printed in the page after every stylesheet; they sit at the
   end of this file to keep that order. Each group names the part it came from,
   and the part's own section in style.css says the framing lives here. */

/* ---- template-parts/home/content-banner.php (moved from its inline <style>) ---- */

#bannerPlayer {
    pointer-events: none;
    transform-origin: center center;
    width: 100%;
    height: 100%;
}

#bannerPlayer iframe {
    pointer-events: none !important;
    width: 100% !important;
    height: 100% !important;
}

/* ---- template-parts/home/content-yacht-share-finder.php (moved from its inline <style>) ---- */

.ysf-right iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.8);
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Background-video host (see assets/js/yt-background.js): fills the column; the
   poster copies the iframe framing above so the crossfade is invisible. */

.ysf-right .yt-bg {
    position: absolute;
    inset: 0;
}

/* A hand-made poster (is-custom) skips this zoom and covers the column instead. */
.ysf-right .yt-bg:not(.is-custom) > .yt-bg-poster {
    inset: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.8);
    width: 100%;
    height: 100%;
}

/* If you want to use video element fallback */

.ysf-right-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- template-parts/home/content-experiences.php (moved from its inline <style>) ---- */

.exp-youtube-player {
    pointer-events: none;
    transform-origin: center center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(1.7);
}

.exp-youtube-player iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none !important;
}

/* ---- template-parts/about-us/content-banner.php (moved from its inline <style>) ---- */

.about-us-hero-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.about-us-hero-video-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.3);
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    pointer-events: none;
}

/* Responsive fallback for the video tag */

.about-us-hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
}

@media(max-width:767px){
    .about-us-hero-video-wrapper iframe{
            transform: translate(-50%, -50%) scale(3);
    }
}

/* ---- template-parts/how/content-contentbox.php (moved from its inline <style>) ---- */

.hiw-slide-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hiw-slide-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%) scale(1.2);
    pointer-events: none;
    border: none;
    object-fit: cover;
    width: 100% !important;
}

/* Background-video host (assets/js/yt-background.js). The iframe it builds
   carries .hiw-slide-video, so the rules above size it exactly as before;
   the poster copies that framing so the crossfade is invisible. */

.hiw-slide-video-wrapper .yt-bg {
    position: absolute;
    inset: 0;
}

.hiw-slide-video-wrapper .yt-bg > .yt-bg-poster {
    inset: auto;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(1.2);
}

@media(max-width:767px){
    .hiw-slide-video-wrapper .yt-bg > .yt-bg-poster {
        transform: translate(-50%, -50%) scale(1.8);
    }
}

/* For Reels/Shorts - maintain aspect ratio 9:16 */

.hiw-slide-video-wrapper .hiw-slide-video {
    aspect-ratio: auto;
    width: auto;
    height: 100%;
    min-width: unset;
    min-height: 100%;
}

/* For landscape videos - maintain aspect ratio 16:9 */

.hiw-slide-video-wrapper.landscape .hiw-slide-video {
    width: 100%;
    height: auto;
    min-width: 100%;
    min-height: unset;
}

@media(max-width:767px){
  .hiw-slide-video{
        transform: translate(-50%, -50%) scale(1.8);
  }
}

/* ---- template-parts/yacht-single/content-contentbox.php ---- */

/* Yacht single video box: the host is a fixed-height, full-width band with
   container-type: size, so the 16:9 player is sized against the box itself
   (not the viewport) to the smallest size that covers it, and centred. A
   YouTube still (no hand-made poster) copies that framing; the hand-made
   poster keeps the is-custom rule above and simply covers the box. */

.videoBox .videoBox-yt > iframe,
.videoBox .videoBox-yt:not(.is-custom) > .yt-bg-poster {
    position: absolute;
    inset: auto;
    top: 50%;
    left: 50%;
    width: max(100cqw, calc(100cqh * 16 / 9)) !important;
    height: max(100cqh, calc(100cqw * 9 / 16)) !important;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
