/* N9 Arena Video Highlights v0.3.1 */
.n9-video-gallery {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Main highlight — close to the original Elementor proportions. */
.n9-video-main {
    position: relative;
    width: 100%;
    height: clamp(520px, 70vh, 780px);
    background: #000;
    overflow: hidden;
}

.n9-video-main video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #000;
}

/* Single smooth horizontal thumbnail strip; never creates a second row. */
.n9-video-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 18px 16px 12px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.n9-video-thumbnails::-webkit-scrollbar { display: none; }
.n9-video-thumbnails.is-centered { justify-content: center; }

.n9-video-thumbnail {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: block;
    flex: 0 0 clamp(135px, 12vw, 175px);
    width: clamp(135px, 12vw, 175px);
    height: clamp(82px, 7.3vw, 104px);
    padding: 0 !important;
    margin: 0;
    border: 2px solid transparent !important;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    cursor: pointer;
    scroll-snap-align: center;
    box-shadow: none;
    outline: none;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

/* Float only — inactive thumbnails remain borderless. */
.n9-video-thumbnail:hover,
.n9-video-thumbnail:focus-visible {
    transform: translateY(-5px);
    border-color: transparent !important;
    box-shadow: 0 7px 18px rgba(255,255,255,.22), 0 5px 14px rgba(0,0,0,.28);
}

/* Only the currently playing video gets the blue border. */
.n9-video-thumbnail.is-active,
.n9-video-thumbnail.is-active:hover,
.n9-video-thumbnail.is-active:focus-visible {
    border-color: #0073e6 !important;
    box-shadow: 0 0 0 1px rgba(0,115,230,.16), 0 6px 16px rgba(0,0,0,.24);
}

/* Thumbnail image/video fills the complete tab. */
.n9-video-thumbnail img,
.n9-video-thumbnail video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .n9-video-main { height: clamp(430px, 62vh, 640px); }
    .n9-video-thumbnail {
        flex-basis: 135px;
        width: 135px;
        height: 82px;
    }
}

@media (max-width: 767px) {
    .n9-video-main {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .n9-video-thumbnails {
        justify-content: flex-start;
        gap: 10px;
        padding: 14px 10px 10px;
        scroll-snap-type: x mandatory;
    }

    /* JS adds this whenever all thumbnails fit, including a single video. */
    .n9-video-thumbnails.is-centered {
        justify-content: center;
    }

    .n9-video-thumbnail {
        flex-basis: 105px;
        width: 105px;
        height: 64px;
        border-radius: 6px;
    }

    .n9-video-thumbnail:hover,
    .n9-video-thumbnail:focus-visible {
        transform: translateY(-3px);
    }
}
