.video-banner {
    position: relative;
    overflow: hidden;
}

.video-banner.small { height: 350px; }
.video-banner.medium { height: 750px; }
.video-banner.large { height: 950px; }

.hero-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

/* Updated to include the new .embed-container wrapper and control block rules */
.hero-video-wrapper video, 
.hero-video-wrapper .embed-container,
.placeholder-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* --- Updated CSS to handle faked "object-fit: cover" dynamically --- */
.hero-video-wrapper .embed-container {
    pointer-events: none; 
    transition: pointer-events 0.3s ease;
}

/* While the video is looping silently in the background, crop it */
.hero-video-wrapper .embed-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%; 
    min-height: 100%;
    min-width: 177.77vh; 
    transform: translate(-50%, -50%);
    transition: all 0.3s ease; /* Adds a clean transition when resetting sizes */
}

/* Fallbacks for your custom banner container heights while looping */
@media (min-aspect-ratio: 16/9) {
    .hero-video-wrapper .embed-container iframe { height: 56.25vw; }
}
@media (max-aspect-ratio: 16/9) {
    .hero-video-wrapper .embed-container iframe { width: 177.78vh; }
}

/* NEW RULE: Once clicked, prevent cropping and fit the player cleanly 
   inside the block parameters so controls are 100% visible */
.video-overlay-trigger.is-playing ~ .embed-container iframe {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: translate(0, 0);
    min-height: 0;
    min-width: 0;
}

/* Adjacent sibling selectors to unlock pointer interactions */
.video-overlay-trigger.is-playing {
    display: none;
}

.video-overlay-trigger.is-playing ~ video,
.video-overlay-trigger.is-playing ~ .embed-container {
    pointer-events: auto;
}
/* ----------------------------------------------------------------- */

img.video-start-btn {
    margin: 5px auto !important;
}

.video-overlay-trigger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    cursor: pointer;
    /* background: rgba(0,0,0,0.01); */
}

.video-overlay-trigger::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* background-color: rgba(0, 0, 0, 0.3); */
    z-index: 2;
}

/* When the overlay trigger gets the 'is-playing' class from our JS, 
   we let pointer events pass directly to the videos below it */
.video-overlay-trigger.is-playing {
    display: none;
}

/* Adjacent sibling selectors to unlock controls once the UI overlay fades out */
.video-overlay-trigger.is-playing ~ video,
.video-overlay-trigger.is-playing ~ .embed-container {
    pointer-events: auto;
}

.content-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 51;
    pointer-events: none;
}

.content-overlay .cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
}

.video-message {
    color: #ffffff;
    font-size: 18px;
    line-height: 1.4;
    position: relative;
}

span.video-trigger-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.play-trigger-ui {
    position: relative;
    z-index: 52;
    margin-bottom: 30px;
    pointer-events: auto;
}

.video-start-btn {
    width: 138px;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.play-trigger-ui:hover .video-start-btn {
    transform: scale(1.1);
}

.height-100 { 
    height: 100%; 
}

@media only screen and (max-width: 639px) {
    .video-start-btn {
        width: 80px; /* Smaller button on mobile */
    }
    .video-banner.medium, .video-banner.large {
        height: 450px;
    }
}