/* RS Koi YouTube Video Gallery – Frontend */

.rs-koi-ytg-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Each video thumbnail item */
.rs-koi-ytg-item {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    outline: 2px solid transparent;
    transition: outline-color 0.15s, transform 0.15s;
    flex: 0 0 calc(33.333% - 6px);
}

@media (max-width: 480px) {
    .rs-koi-ytg-item {
        flex: 0 0 calc(50% - 4px);
    }
}

.rs-koi-ytg-item:hover,
.rs-koi-ytg-item:focus {
    outline-color: #ff0000;
    transform: scale(1.02);
}

.rs-koi-ytg-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    overflow: hidden;
}

.rs-koi-ytg-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.rs-koi-ytg-item:hover .rs-koi-ytg-thumb img {
    opacity: 0.85;
}

/* Play button overlay */
.rs-koi-ytg-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.rs-koi-ytg-play-btn svg {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    transition: transform 0.15s;
    width: 48px;
    height: 34px;
}

.rs-koi-ytg-item:hover .rs-koi-ytg-play-btn svg {
    transform: scale(1.12);
}

/* ── Lightbox ── */
.rs-koi-ytg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rs-koi-ytg-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

.rs-koi-ytg-lightbox-inner {
    position: relative;
    z-index: 1;
    width: 90vw;
    max-width: 900px;
}

.rs-koi-ytg-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.rs-koi-ytg-close:hover {
    opacity: 1;
}

.rs-koi-ytg-iframe-wrap {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.rs-koi-ytg-iframe-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Animation */
.rs-koi-ytg-lightbox {
    animation: rsKoiFadeIn 0.18s ease;
}

@keyframes rsKoiFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
