.video-gallery-section {
    position: relative;
    padding: 50px 0 58px;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(115, 75, 223, 0.14) 0%, transparent 62%),
        linear-gradient(135deg, #f8f6fc 0%, #eef3ea 48%, #f3f1f7 100%);
    overflow: hidden;
}

.video-gallery-section__glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    pointer-events: none;
}

.video-gallery-section__glow--left {
    top: 8%;
    left: -120px;
    background: rgba(115, 75, 223, 0.22);
}

.video-gallery-section__glow--right {
    bottom: -80px;
    right: -100px;
    background: rgba(92, 57, 186, 0.18);
}

.video-gallery-header {
    text-align: center;
    margin-bottom: 42px;
    position: relative;
    z-index: 1;
}

.video-gallery-header__eyebrow {
    margin: 0 0 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.video-gallery-header__title {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--primary-color);
}

.video-gallery-header__divider {
    display: block;
    width: 72px;
    height: 3px;
    margin: 20px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(115, 75, 223, 0.15), var(--accent-color), rgba(115, 75, 223, 0.15));
}

.video-gallery-shell {
    position: relative;
    z-index: 1;
    padding: 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(115, 75, 223, 0.12);
    box-shadow:
        0 24px 60px rgba(22, 26, 45, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset;
    backdrop-filter: blur(8px);
}

.video-gallery-layout {
    align-items: flex-start;
    justify-content: center;
}

.video-gallery-player {
    width: 100%;
}

.video-gallery-player__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #161a2d 0%, #2a1f4e 100%);
    box-shadow:
        0 22px 48px rgba(22, 26, 45, 0.22),
        0 0 0 1px rgba(115, 75, 223, 0.2),
        0 0 0 4px rgba(115, 75, 223, 0.06);
}

.video-gallery-player__native,
.video-gallery-player__youtube {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
    background: #0f1220;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.video-gallery-player__native.is-visible,
.video-gallery-player__youtube.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.video-gallery-player__title {
    margin: 18px 0 0;
    padding-left: 14px;
    border-left: 4px solid var(--accent-color);
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.5;
    font-weight: 600;
    color: var(--primary-color);
}

.video-gallery-playlist-card {
    display: flex;
    flex-direction: column;
    height: auto;
    background: linear-gradient(180deg, #ffffff 0%, #faf9fd 100%);
    border-radius: 16px;
    border: 1px solid rgba(115, 75, 223, 0.1);
    box-shadow: 0 16px 40px rgba(22, 26, 45, 0.08);
    overflow: hidden;
}

.video-gallery-playlist-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid rgba(115, 75, 223, 0.1);
    background: linear-gradient(90deg, rgba(115, 75, 223, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
}

.video-gallery-playlist-card__label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.02em;
}

.video-gallery-playlist-card__label i {
    color: var(--accent-color);
    margin-right: 8px;
}

.video-gallery-playlist-card__hint {
    font-size: 0.75rem;
    color: var(--text-color);
    white-space: nowrap;
}

.video-gallery-playlist {
    overflow: visible;
    padding: 4px 0 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(115, 75, 223, 0.08);
}

.video-gallery-playlist::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.video-gallery-playlist::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 999px;
}

.video-gallery-playlist::-webkit-scrollbar-track {
    background: rgba(115, 75, 223, 0.06);
}

.video-gallery-item {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.video-gallery-item:last-child {
    padding-bottom: 12px;
}

.video-gallery-item:hover {
    background: rgba(115, 75, 223, 0.06);
}

.video-gallery-item.is-active {
    background: linear-gradient(90deg, rgba(115, 75, 223, 0.14) 0%, rgba(115, 75, 223, 0.04) 100%);
    box-shadow: inset 4px 0 0 var(--accent-color);
}

.video-gallery-item__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.video-gallery-item__thumb {
    flex: 0 0 108px;
    width: 108px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #eef0f4;
    box-shadow: 0 4px 14px rgba(22, 26, 45, 0.12);
}

.video-gallery-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-gallery-item--native .video-gallery-item__thumb img {
    object-fit: contain;
    background: #161a2d;
}

.video-gallery-item__thumb-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    font-size: 14px;
    background: rgba(22, 26, 45, 0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-gallery-item:hover .video-gallery-item__thumb-icon,
.video-gallery-item.is-active .video-gallery-item__thumb-icon {
    opacity: 1;
}

.video-gallery-item__body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.video-gallery-item__title {
    display: block;
    font-size: 0.9rem;
    line-height: 1.42;
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.video-gallery-item.is-active .video-gallery-item__title {
    color: var(--accent-color);
}

.video-gallery-item__date {
    margin: 6px 0 0;
    font-size: 0.78rem;
    color: var(--text-color);
}

.video-gallery-item__date i {
    margin-right: 6px;
    color: var(--accent-color);
}

.video-gallery-item + .video-gallery-item {
    border-top: 1px solid rgba(22, 26, 45, 0.07);
}

/* Laptop + desktop: show 4 videos, scroll for the rest */
@media (min-width: 992px) {
    .video-gallery-playlist-card {
        height: auto;
        align-self: flex-start;
    }

    .video-gallery-playlist {
        /* ~4 rows: item padding + 16:9 thumb + title wrap room */
        max-height: calc(4 * (24px + (108px * 9 / 16) + 40px));
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: 4px;
    }

    .video-gallery-playlist-card__hint {
        display: inline;
    }
}

@media (max-width: 991.98px) {
    .video-gallery-section {
        padding: 50px 0 44px;
    }

    .video-gallery-header {
        margin-bottom: 28px;
    }

    .video-gallery-header__eyebrow {
        font-size: 0.75rem;
        letter-spacing: 0.12em;
        margin-bottom: 10px;
    }

    .video-gallery-header__title {
        font-size: clamp(1.3rem, 4.2vw, 1.55rem);
    }

    .video-gallery-header__divider {
        width: 56px;
        margin-top: 16px;
    }

    .video-gallery-shell {
        padding: 16px 12px;
        border-radius: 18px;
    }

    .video-gallery-layout > [class*="col-"]:first-child {
        margin-bottom: 18px;
    }

    .video-gallery-playlist {
        display: block;
        max-height: min(52vh, 420px);
        overflow-x: hidden;
        overflow-y: auto;
        padding: 4px 0 8px;
        scroll-snap-type: none;
    }

    .video-gallery-item {
        display: block;
        width: 100%;
        flex: none;
        padding: 12px 14px;
        border-radius: 0;
        border: 0;
        background: transparent;
        scroll-snap-align: none;
        box-shadow: none;
    }

    .video-gallery-item:last-child {
        padding-bottom: 12px;
    }

    .video-gallery-item.is-active {
        border-color: transparent;
        box-shadow: inset 4px 0 0 var(--accent-color);
        background: linear-gradient(90deg, rgba(115, 75, 223, 0.14) 0%, rgba(115, 75, 223, 0.04) 100%);
    }

    .video-gallery-item + .video-gallery-item {
        border-top: 1px solid rgba(22, 26, 45, 0.07);
    }

    .video-gallery-item__row {
        flex-direction: row;
        gap: 12px;
    }

    .video-gallery-item__thumb {
        flex: 0 0 96px;
        width: 96px;
    }

    .video-gallery-playlist-card__hint::after {
        content: none;
    }
}

@media (max-width: 767.98px) {
    .video-gallery-playlist {
        max-height: min(48vh, 380px);
    }

    .video-gallery-item__thumb {
        flex: 0 0 88px;
        width: 88px;
    }
}

@media (max-width: 575.98px) {
    .video-gallery-item {
        padding: 10px 12px;
    }

    .video-gallery-item__title {
        font-size: 0.86rem;
    }
}
