/*!
 * Company Profile video (homepage About section) + sticky mini-player   v1.1.0 (wide inline frame, no player controls)
 * Markup: index.php (.suspl-about .sab-head) · Script: js/suspl-profile-video.js
 * The video sits over the existing blueprint drawing; once played, it floats to a mini-player
 * (bottom-left) when the section scrolls away. Plain CSS values (no clamp / calc / var).
 */
.suspl-profile-video {
    position: relative;
    z-index: 2;
    width: 100%;
    /* v1.1: full width of the heading column (Jigar's marked box) */
    max-width: 640px;
    margin-top: 30px;
}

/* the slot keeps its 16:9 space while the frame is floating (no layout shift) */
.suspl-profile-video-slot {
    position: relative;
    width: 100%;
    padding-top: 39%;
    /* v1.1: wide banner shape (about 2.56 : 1); the 16:9 video is cropped to fill it */
}

.suspl-profile-video-frame {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 3px solid #ffffff;
    border-radius: 14px;
    background: #0b1d33;
    box-shadow: 0 18px 40px rgba(0, 31, 70, 0.22), 0 3px 10px rgba(0, 31, 70, 0.1);
}

.suspl-profile-video-media {
    /* 16:9 box, centred, cropped by the frame (like object-fit: cover) */
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 0;
    padding-top: 56.25%;
    transform: translateY(-50%);
    pointer-events: none;
    /* no YouTube controls: clicks never reach the player */
}

.suspl-profile-video-media iframe {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* the mini-player is 16:9, so the whole video shows there */
.suspl-profile-video.is-sticky .suspl-profile-video-media {
    top: 0;
    transform: none;
}

/* thumbnail + play button (one button = whole frame) */
.suspl-about button.suspl-profile-video-play {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.suspl-profile-video-thumb {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.suspl-profile-video-play::after {
    /* soft navy tint so the button reads on any photo */
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 31, 70, 0.05) 0%, rgba(0, 31, 70, 0.28) 100%);
}

.suspl-profile-video-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.28), 0 10px 26px rgba(0, 31, 70, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.suspl-profile-video-btn svg {
    display: block;
    width: 26px;
    height: 26px;
    margin-left: 4px;
    fill: #001f46;
}

.suspl-profile-video-btn::after {
    /* thin construction-yellow ring */
    content: "";
    position: absolute;
    left: -4px;
    top: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #f4b400;
    border-radius: 50%;
    opacity: 0.9;
}

.suspl-profile-video-play:hover .suspl-profile-video-thumb {
    transform: scale(1.03);
}

.suspl-profile-video-play:hover .suspl-profile-video-btn,
.suspl-profile-video-play:focus-visible .suspl-profile-video-btn {
    transform: scale(1.07);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.34), 0 12px 30px rgba(0, 31, 70, 0.34);
}

.suspl-about button.suspl-profile-video-play:focus-visible {
    outline: 3px solid #f4b400;
    outline-offset: -3px;
}

/* close (×) — only on the mini-player */
.suspl-about button.suspl-profile-video-close {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 31, 70, 0.3);
    color: #001f46;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.suspl-profile-video-close svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #001f46;
    stroke-width: 2.6;
    stroke-linecap: round;
}

.suspl-about button.suspl-profile-video-close:hover {
    background: #f4b400;
    transform: scale(1.06);
}

.suspl-about button.suspl-profile-video-close:focus-visible {
    outline: 3px solid #f4b400;
    outline-offset: 2px;
}

/* ---------------------------------------------------------------- floating mini-player */
.suspl-profile-video.is-sticky .suspl-profile-video-frame {
    position: fixed;
    left: 5px;
    /* v1.1.1: left 5px / bottom 10px (Jigar); the script only lifts it above the Brochure tab if they overlap */
    top: auto;
    bottom: 10px;
    z-index: 9990;
    width: 270px;
    height: 153px;
    margin-bottom: env(safe-area-inset-bottom);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 31, 70, 0.32), 0 4px 12px rgba(0, 31, 70, 0.14);
}

.suspl-profile-video.is-sticky .suspl-profile-video-close {
    display: flex;
}

/* the section's content layer is a stacking context (z-index 1): lift it while the player floats,
   so the mini-player stays above the following sections */
section.suspl-about.has-pv-sticky,
.suspl-about.has-pv-sticky .sab-wrap,
.suspl-about.has-pv-sticky .suspl-profile-video {
    z-index: 9990;
}

.suspl-profile-video-frame.is-moving {
    transition: transform 0.45s cubic-bezier(0.22, 0.8, 0.26, 1), opacity 0.3s ease;
}

.suspl-profile-video-frame.is-hiding {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------------------------------------------------------------- sizes */
@media (min-width: 1600px) {
    .suspl-profile-video {
        max-width: 760px;
        margin-top: 36px;
    }

    .suspl-profile-video-btn {
        width: 86px;
        height: 86px;
        margin: -43px 0 0 -43px;
    }

    .suspl-profile-video-btn svg {
        width: 30px;
        height: 30px;
    }
}

@media (min-width: 1920px) {
    .suspl-profile-video {
        max-width: 900px;
        margin-top: 42px;
    }
}

@media (min-width: 2560px) {
    .suspl-profile-video {
        max-width: 1200px;
        margin-top: 56px;
    }

    .suspl-profile-video-frame {
        border-width: 4px;
        border-radius: 20px;
    }

    .suspl-profile-video-btn {
        width: 116px;
        height: 116px;
        margin: -58px 0 0 -58px;
    }

    .suspl-profile-video-btn svg {
        width: 40px;
        height: 40px;
    }

    .suspl-profile-video.is-sticky .suspl-profile-video-frame {
        width: 480px;
        height: 270px;
    }

    .suspl-about button.suspl-profile-video-close {
        width: 42px;
        height: 42px;
    }

    .suspl-profile-video-close svg {
        width: 18px;
        height: 18px;
    }
}

@media (min-width: 3840px) {
    .suspl-profile-video {
        max-width: 1800px;
        margin-top: 84px;
    }

    .suspl-profile-video-frame {
        border-width: 6px;
        border-radius: 30px;
    }

    .suspl-profile-video-btn {
        width: 170px;
        height: 170px;
        margin: -85px 0 0 -85px;
    }

    .suspl-profile-video-btn svg {
        width: 58px;
        height: 58px;
    }

    .suspl-profile-video.is-sticky .suspl-profile-video-frame {
        width: 720px;
        height: 405px;
    }

    .suspl-about button.suspl-profile-video-close {
        width: 60px;
        height: 60px;
        right: 14px;
        top: 14px;
    }

    .suspl-profile-video-close svg {
        width: 26px;
        height: 26px;
    }
}

/* tablets */
@media (max-width: 1023px) {
    .suspl-profile-video.is-sticky .suspl-profile-video-frame {
        width: 288px;
        height: 162px;
    }
}

/* phones: the video takes the column width; compact mini-player */
@media (max-width: 991px) {
    .suspl-profile-video {
        width: 100%;
        max-width: 620px;
        margin-top: 22px;
        margin-bottom: 26px;
    }
}

@media (max-width: 767px) {
    .suspl-profile-video-btn {
        width: 62px;
        height: 62px;
        margin: -31px 0 0 -31px;
    }

    .suspl-profile-video-btn svg {
        width: 22px;
        height: 22px;
    }

    .suspl-profile-video.is-sticky .suspl-profile-video-frame {
        width: 240px;
        height: 135px;
        border-width: 2px;
    }

    .suspl-about button.suspl-profile-video-close {
        width: 36px;
        height: 36px;
        right: 6px;
        top: 6px;
    }
}

@media (max-width: 359px) {
    .suspl-profile-video.is-sticky .suspl-profile-video-frame {
        width: 208px;
        height: 117px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .suspl-profile-video-frame.is-moving,
    .suspl-profile-video-frame.is-hiding,
    .suspl-profile-video-thumb,
    .suspl-profile-video-btn {
        transition: none;
    }
}

/* v1.1.1: own play / pause button (bottom-left of the video, inline and on the mini-player) */
.suspl-about button.suspl-profile-video-toggle {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 31, 70, 0.3);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.suspl-profile-video-toggle svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: #001f46;
}

.suspl-profile-video-toggle.is-paused svg {
    margin-left: 2px;
}

.suspl-about button.suspl-profile-video-toggle:hover {
    background: #f4b400;
    transform: scale(1.06);
}

.suspl-about button.suspl-profile-video-toggle:focus-visible {
    outline: 3px solid #f4b400;
    outline-offset: 2px;
}

.suspl-profile-video.is-sticky .suspl-profile-video-toggle {
    left: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
}

.suspl-profile-video.is-sticky .suspl-profile-video-toggle svg {
    width: 13px;
    height: 13px;
}

@media (min-width: 2560px) {
    .suspl-about button.suspl-profile-video-toggle { width: 56px; height: 56px; left: 16px; bottom: 16px; }
    .suspl-profile-video-toggle svg { width: 22px; height: 22px; }
    .suspl-profile-video.is-sticky .suspl-profile-video-toggle { width: 42px; height: 42px; }
    .suspl-profile-video.is-sticky .suspl-profile-video-toggle svg { width: 17px; height: 17px; }
}

@media (min-width: 3840px) {
    .suspl-about button.suspl-profile-video-toggle { width: 84px; height: 84px; left: 24px; bottom: 24px; }
    .suspl-profile-video-toggle svg { width: 32px; height: 32px; }
    .suspl-profile-video.is-sticky .suspl-profile-video-toggle { width: 60px; height: 60px; left: 14px; bottom: 14px; }
    .suspl-profile-video.is-sticky .suspl-profile-video-toggle svg { width: 24px; height: 24px; }
}

@media (max-width: 767px) {
    .suspl-profile-video.is-sticky .suspl-profile-video-toggle { width: 36px; height: 36px; left: 6px; bottom: 6px; }
}
