/*
 * Page video block — click-to-load Wistia player inside the page content.
 *
 * Standalone file, enqueued only on pages that carry a wistia_media_id. It is
 * deliberately outside the gulp main.* bundle so a theme rebuild cannot drop it.
 *
 * The frame is a fixed 16:9 box and the player is absolutely positioned inside
 * it, so pressing play never moves the copy underneath: no layout shift.
 */

.sh-video {
    margin: 0 0 32px;
}

.sh-video__frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background-color: #051624;
}

/* Older engines without aspect-ratio still get a 16:9 box. */
@supports not (aspect-ratio: 16 / 9) {
    .sh-video__frame {
        height: 0;
        padding-bottom: 56.25%;
    }
}

.sh-video__trigger {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.sh-video__poster,
.sh-video__poster img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
 * The play button is drawn here, not with an inline <svg>: the theme's
 * remove_elementor_svg_after_picture() filter deletes any <svg> that follows a
 * <picture> or an <img>, so an icon inside this button would disappear.
 */
.sh-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: #f4772f;
    box-shadow: 0 6px 24px rgba(5, 22, 36, 0.45);
    transition: transform 0.25s ease-in-out, background-color 0.25s ease-in-out;
    pointer-events: none;
}

.sh-video__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    /* Equilateral-ish triangle, nudged right so it reads centred in the circle. */
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 13px 0 13px 21px;
    border-color: transparent transparent transparent #ffffff;
}

.sh-video__trigger:hover .sh-video__play,
.sh-video__trigger:focus-visible .sh-video__play {
    transform: translate(-50%, -50%) scale(1.08);
    background-color: #0b304e;
}

.sh-video__trigger:focus-visible {
    outline: 3px solid #f4772f;
    outline-offset: 3px;
}

/* Fallback for engines without :focus-visible. */
.sh-video__trigger:focus {
    outline: 3px solid #f4772f;
    outline-offset: 3px;
}

.sh-video__trigger:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .sh-video__play,
    .sh-video__trigger:hover .sh-video__play,
    .sh-video__trigger:focus-visible .sh-video__play {
        transition: none;
        transform: translate(-50%, -50%);
    }
}

/* The injected player, and the <noscript> fallback, fill the same box. */
.sh-video__player,
.sh-video__player iframe,
.sh-video__noscript {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    border: 0;
}

/* The thank-you pages are a short, centred column; keep the video with it. */
.sh-video--confirmation {
    max-width: 720px;
    margin: 32px auto 0;
}

@media (max-width: 767px) {
    .sh-video {
        margin-bottom: 24px;
    }

    .sh-video__play {
        width: 56px;
        height: 56px;
    }

    .sh-video__play::before {
        border-width: 10px 0 10px 16px;
    }
}
