/* ==========================================================================
   Vimeo Video Block
   Colours driven entirely by the ACF colour scheme system.
   The parent element carries .colour-scheme--{name}, which provides
   --scheme-bg, --scheme-text, --scheme-highlight, --scheme-button, --scheme-button-text
   via nebula_inject_scheme_class_tokens() in functions.php.

   LAYOUT NOTE: This block uses a split-overlap technique.
   .video-details__wrap has the coloured background and extends down by half
   the video height. .video__wrap then pulls up by the same amount, so the
   video appears to overlap the colour break point.
   ========================================================================== */

/* ============================================================
   0. LOCAL TOKEN ALIASES
   ============================================================ */
.vimeo-video-block {
    --video-bg:           var(--scheme-bg,          #ffffff);
    --video-text:         var(--scheme-text,         #313a4c);
    --video-heading:      var(--scheme-highlight,    #BAD532);
    --video-btn-bg:       var(--scheme-button,       #BAD532);
    --video-btn-icon:     var(--scheme-button-text,  #313a4c);
    --video-btn-hover-bg: var(--scheme-button-hover, #313a4c);
    --video-btn-hover-icon: var(--scheme-button-text-hover, #BAD532);
}

/* ============================================================
   1. OUTER WRAPPER
   ============================================================ */
.vimeo-video-block {
    position: relative;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: block !important;
    box-sizing: border-box;
    z-index: 1;
}

.vimeo-video-block.alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;
}

.video-details__inner,
.video__container__inner {
    max-width: 1540px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================
   2. TOP SECTION — coloured background
   Padding-bottom extends the colour down by half the video height
   so the top half of the video sits against the scheme colour.
   ============================================================ */
.video-details__wrap {
    background-color: var(--video-bg);
    color: var(--video-text);
    padding-top: 60px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 22.5vw; /* = half of (80vw × 9/16) */
    position: relative;
    z-index: 1;
}

.video-details__content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding-bottom: 20px;
}

.video-details__heading h2 {
    margin: 0 0 24px;
    color: var(--video-heading);
}

.video-details__text {
    max-width: 1280px;
    margin: 0 auto 30px;
    color: var(--video-text);
}

/* ============================================================
   3. VIDEO SECTION — pulls up over the colour break
   margin-top matches the padding-bottom above so the video
   overlaps exactly at the colour boundary.
   ============================================================ */
.video__wrap {
    position: relative;
    z-index: 5;
    width: 100%;
    margin-top: -22.5vw; /* matches padding-bottom above */
    padding-bottom: 80px; /* Creates space below the video block */
}

.video__container__wrap {
    position: relative;
    padding: 0 24px;
    padding-bottom: 0 !important;
}

/* ============================================================
   4. EMBED
   ============================================================ */
.vimeo-embed {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    width: 80%;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.vimeo-embed :is(iframe, img) {
    block-size: 100%;
    border: 0;
    border-radius: inherit;
    inline-size: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
}

/* ============================================================
   5. PLAY BUTTON
   ============================================================ */
.vimeo-embed__overlay-link {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    inset: 0;
    z-index: 99;
    cursor: pointer;
}

.vimeo-embed__button {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--video-btn-bg);
    transition: background-color 0.3s ease-in-out;
}

.vimeo-embed__button::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent var(--video-btn-icon);
    transform: translateX(3px);
    transition: border-color 0.3s ease-in-out;
}

.vimeo-embed__overlay-link:hover .vimeo-embed__button {
    background-color: var(--video-btn-hover-bg);
}

.vimeo-embed__overlay-link:hover .vimeo-embed__button::before {
    border-color: transparent transparent transparent var(--video-btn-hover-icon);
}

/* ============================================================
   6. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    /* Mobile: video is 100% width, height = 56.25vw, half = 28vw */

    .video-details__wrap {
        padding-top: 40px;
        padding-bottom: 28vw;
    }

    .video__wrap {
        margin-top: -28vw;
        padding-bottom: 40px; /* Creates smaller mobile space below the video block */
    }

    .vimeo-embed {
        width: 100%;
        border-radius: 0;
    }

    .video__container__wrap {
        padding: 0;
    }
}

@media (min-width: 48em) {
    /* Desktop: video is 80% width, height ≈ 45vw, half = 22.5vw */

    .vimeo-embed {
        border-radius: 45px;
    }

    .vimeo-embed__button {
        width: 120px;
        height: 120px;
    }

    .vimeo-embed__button::before {
        border-width: 30px 0 30px 50px;
        transform: translateX(6px);
    }
}