/* Featured video wrapper */
.videos-featured-wrapper {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    line-height: 0;
    cursor: pointer;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

.videos-featured-wrapper,
.videos-featured-wrapper * {
    max-width: 100% !important;
    box-sizing: border-box;
}

.videos-featured-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
    cursor: pointer;
}

.videos-poster,
.videos-iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.videos-featured-iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.videos-featured-wrapper a,
.single .videos-featured-wrapper a {
    pointer-events: none !important;
    display: contents !important;
}

.videos-poster {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: #000;
}

.videos-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.videos-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(0,0,0,0.7);
    border-radius: 12px;
    pointer-events: none;
}

.videos-play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
}

.videos-poster.is-playing .videos-play-btn {
    display: none;
}

.videos-poster.is-playing iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* Sticky-player placeholder */
.videos-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.videos-placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.85;
}

/* Sticky player */
.videos-floating-player {
    position: fixed;
    z-index: 99999;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    bottom: 20px;
    right: 20px;
    width: 320px;
    max-width: 90vw;
}

.videos-floating-player.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.videos-floating-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.videos-floating-close:hover {
    background: rgba(0,0,0,0.95);
}

.videos-unmute-button {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 21;
    padding: 7px 10px;
    border: 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}

.videos-unmute-button:hover {
    background: rgba(0, 0, 0, 0.95);
}

.videos-unmute-button[hidden] {
    display: none;
}

.videos-floating-inner {
    width: 100%;
    height: auto;
    background: #000;
    position: relative;
}

/* YouTube, Vimeo, and Twitter embeds use a 16:9 ratio. */
.videos-floating-player[data-video-type="youtube"] .videos-floating-inner,
.videos-floating-player[data-video-type="vimeo"] .videos-floating-inner,
.videos-floating-player[data-video-type="twitter"] .videos-floating-inner,
.videos-floating-inner:has(iframe) {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.videos-floating-inner iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.videos-floating-player[data-video-type="html5"] {
    width: min(320px, 90vw);
}

.videos-floating-player[data-video-type="html5"] .videos-floating-inner video,
.videos-floating-player[data-video-type="html5"] .videos-featured-video {
    width: 100% !important;
    height: auto !important;
    max-height: calc(100vh - 40px);
    object-fit: contain;
    display: block;
    aspect-ratio: auto !important;
}

@media (max-width: 759px) {
    .videos-featured-wrapper {
        aspect-ratio: 16 / 9;
        max-height: 56.25vw;
    }

    .videos-floating-player {
        bottom: max(12px, env(safe-area-inset-bottom));
        right: max(12px, env(safe-area-inset-right));
        width: min(220px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        border-radius: 8px;
    }

    .videos-floating-player[data-video-type="html5"] {
        width: min(220px, calc(100vw - 24px));
    }

    .videos-floating-player[data-video-type="html5"] .videos-floating-inner video,
    .videos-floating-player[data-video-type="html5"] .videos-featured-video {
        max-height: 42vh;
    }

    .videos-floating-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        top: 4px;
        right: 4px;
    }
}
