/*
 * Add "loop-video-media" to the Elementor container containing the
 * Featured Image and [acf_hover_video] Shortcode widget.
 */
.loop-video-media {
    position: relative !important;
    overflow: hidden;
    cursor: pointer;
    isolation: isolate;
}

/* Hover video is measured to the exact Featured Image rectangle by JS. */
.loop-video-media > .eahv-hover-video {
    position: absolute !important;
    left: var(--eahv-preview-left, 0) !important;
    top: var(--eahv-preview-top, 0) !important;
    width: var(--eahv-preview-width, 0) !important;
    height: var(--eahv-preview-height, 0) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    display: block !important;
    object-fit: cover;
    border-radius: var(--eahv-preview-radius, 0) !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
    z-index: 50 !important;
    pointer-events: none;
    background: #000;
}

.loop-video-media:hover > .eahv-hover-video,
.loop-video-media.eahv-is-previewing > .eahv-hover-video {
    opacity: 1 !important;
    visibility: visible !important;
}

.eahv-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 110px 28px 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.eahv-modal.eahv-is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.eahv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(3px);
}

/* Shrink-wrap the actual video so overlay tools sit on the video's top-right. */
.eahv-modal__dialog {
    position: relative;
    z-index: 2;
    display: inline-flex;
    width: fit-content;
    max-width: min(1200px, calc(100vw - 150px));
    max-height: 90vh;
    align-items: center;
    justify-content: center;
}

.eahv-modal__player {
    display: block;
    width: auto;
    height: auto;
    max-width: min(1200px, calc(100vw - 150px));
    max-height: 88vh;
    object-fit: contain;
    background: #000;
    border-radius: 10px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .55);
}


/* Post title overlay: max two lines, directly above the native video timeline. */
.eahv-modal__title {
    position: absolute;
    z-index: 7;
    left: 22px;
    right: 82px;
    bottom: 52px;
    margin: 0;
    color: #fff;
    font-size: clamp(17px, 1.5vw, 22px);
    line-height: 1.22;
    font-weight: 600;
    text-align: left;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .9);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    pointer-events: none;
    max-height: calc(2 * 1.22em);
}

.eahv-modal__title[hidden] {
    display: none !important;
}

.eahv-modal__top-controls {
    position: absolute;
    z-index: 8;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.eahv-modal__tool,
.eahv-share {
    appearance: none;
    border: 0;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(35, 35, 35, .78);
    color: #fff;
    cursor: pointer;
    box-shadow: none;
    transition: background .15s ease, transform .15s ease;
}

.eahv-modal__tool:hover,
.eahv-share:hover {
    background: rgba(25, 25, 25, .95);
    transform: scale(1.04);
}

.eahv-icon {
    display: block;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.eahv-icon--sound-off {
    display: none;
}

.eahv-modal__sound.eahv-is-muted .eahv-icon--sound-on {
    display: none;
}

.eahv-modal__sound.eahv-is-muted .eahv-icon--sound-off {
    display: block;
}

.eahv-modal__share-menu {
    position: absolute;
    z-index: 9;
    top: 72px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 26px;
    background: rgba(35, 35, 35, .88);
    box-shadow: 0 8px 25px rgba(0, 0, 0, .28);
}

.eahv-modal__share-menu[hidden] {
    display: none !important;
}

.eahv-share {
    width: 34px;
    height: 34px;
    background: transparent;
    font: 700 21px/1 Arial, sans-serif;
}

.eahv-share--facebook {
    background: #1877f2;
    font-family: Arial, sans-serif;
    font-size: 22px;
    text-transform: lowercase;
}

.eahv-share--x {
    font-size: 19px;
    font-weight: 400;
}

.eahv-share--copy.eahv-is-copied::after {
    content: "✓";
    font-size: 18px;
}

.eahv-share--copy.eahv-is-copied .eahv-icon {
    display: none;
}

.eahv-modal__close,
.eahv-modal__nav {
    position: fixed;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(48, 48, 48, .92);
    color: #fff;
    cursor: pointer;
    box-shadow: none;
    transition: background .15s ease, transform .15s ease;
}

.eahv-modal__close:hover,
.eahv-modal__nav:hover {
    background: rgba(70, 70, 70, .98);
    transform: scale(1.04);
}

.eahv-modal__close {
    top: 32px;
    right: 28px;
    font-size: 44px;
    line-height: 1;
    font-weight: 300;
}

.eahv-modal__nav {
    right: 28px;
    font-size: 34px;
    line-height: 1;
}

.eahv-modal__nav--prev {
    top: calc(50% - 68px);
}

.eahv-modal__nav--next {
    top: calc(50% + 8px);
}

.eahv-modal__nav[hidden] {
    display: none !important;
}

body.eahv-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .eahv-modal {
        padding: 72px 12px 92px;
    }

    .eahv-modal__dialog {
        max-width: 100%;
        max-height: 78vh;
    }

    .eahv-modal__player {
        max-width: 100%;
        max-height: 78vh;
    }

    
/* Post title overlay: max two lines, directly above the native video timeline. */
.eahv-modal__title {
    position: absolute;
    z-index: 7;
    left: 22px;
    right: 82px;
    bottom: 52px;
    margin: 0;
    color: #fff;
    font-size: clamp(17px, 1.5vw, 22px);
    line-height: 1.22;
    font-weight: 600;
    text-align: left;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .9);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    pointer-events: none;
    max-height: calc(2 * 1.22em);
}

.eahv-modal__title[hidden] {
    display: none !important;
}

.eahv-modal__top-controls {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    .eahv-modal__tool {
        width: 42px;
        height: 42px;
    }

    .eahv-modal__share-menu {
        top: 58px;
        right: 10px;
    }

    .eahv-modal__close,
    .eahv-modal__nav {
        width: 48px;
        height: 48px;
    }

    .eahv-modal__close {
        top: 14px;
        right: 14px;
        font-size: 36px;
    }

    .eahv-modal__nav {
        top: auto;
        bottom: 20px;
        font-size: 28px;
    }

    .eahv-modal__nav--prev {
        right: calc(50% + 8px);
    }

    .eahv-modal__nav--next {
        right: auto;
        left: calc(50% + 8px);
    }
}

@media (max-width: 767px) {
    .eahv-modal__title {
        left: 14px;
        right: 54px;
        bottom: 48px;
        font-size: clamp(16px, 4.4vw, 19px);
    }
}

/* v1.4.0: hosted-video preview support */
.loop-video-media > .eahv-hover-video--embed {
    overflow: hidden;
    background: #000;
}

.loop-video-media > .eahv-hover-video--embed .eahv-hover-video__iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    max-width: none;
    min-width: 0;
    min-height: 0;
    border: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background: #000;
}

.eahv-modal__player[hidden],
.eahv-modal__embed-wrap[hidden],
.eahv-modal__tool[hidden] {
    display: none !important;
}

.eahv-modal__embed-wrap {
    position: relative;
    width: min(1200px, calc(100vw - 150px));
    aspect-ratio: 16 / 9;
    max-height: 88vh;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .55);
}

.eahv-modal__player--embed {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #000;
}

@media (max-width: 767px) {
    .eahv-modal__embed-wrap {
        width: 100%;
        max-width: 100%;
        max-height: 78vh;
    }
}

/* v1.4.3: YouTube preview uses the normal player canvas with no extra zoom/crop.
 * Provider controls are disabled through supported embed parameters in PHP.
 * YouTube's internal iframe DOM cannot be styled from WordPress CSS because it is cross-origin.
 */
