/*
* Core Cinematheque Plugin Styles
* This section remains unchanged and works for all screen sizes.
*/

/* Ensure our main wrapper is wide */
#syce-plugin-wrapper {
    width: 100%;
}

/* Use CSS Grid for the 3-per-row layout, more specific selector */
#syce-plugin-wrapper .syce-videos-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    opacity: 0;
    transition: opacity 2.0s ease-in-out;
}

/* Individual video item, more specific selector */
#syce-plugin-wrapper .syce-video {
    width: 100%;
    position: relative;
    cursor: pointer;
}

#syce-plugin-wrapper .syce-video img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: transform 0.3s ease-in-out;
}

#syce-plugin-wrapper .syce-video:hover img {
    transform: scale(1.05);
}

/* Play Icon Overlay */
#syce-plugin-wrapper .syce-lightbox-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 30px solid white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#syce-plugin-wrapper .syce-lightbox-link:hover::after {
    opacity: 1;
}

/* Load More Button */
#syce-plugin-wrapper .syce-load-more {
    text-align: center;
    margin-top: 20px;
}

#syce-plugin-wrapper .syce-load-more button {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#syce-plugin-wrapper .syce-load-more button:hover {
    background-color: #555;
}


/* Disable page scrolling when lightbox is active */
body.syce-no-scroll {
    overflow: hidden;
}

/* Ensure footer element have a defined stacking order */
.footer-info {
    position: relative;
    z-index: 0 !important;
}




/*
* LIGHTBOX STYLES - THIS IS THE ONLY SECTION THAT NEEDS TO CHANGE
*/
.syce-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4  !important;
}

.syce-lightbox-overlay iframe {
    /* Use max dimensions for desktop */
    max-width: 900px;
    max-height: 506px;
    
    /* Use a fluid width and aspect ratio for ALL screen sizes */
    width: 90%;
    aspect-ratio: 16 / 9;

    border-radius: 8px;
    border: none;
}

.syce-lightbox-overlay-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #syce-plugin-wrapper .syce-videos-container {
        grid-template-columns: 1fr;
    }
    
    /* Move the close button closer on mobile */
    .syce-lightbox-overlay-close {
        top: 80px;
        right: 10px;
    }

    /* Adjust the iframe for a better fit on smaller screens and on rotation */
    .syce-lightbox-overlay iframe {
        width: 90vw;
        max-width: 90vw;
        height: auto;
        max-height: 80vh;
    }
}