html {
    overflow-y: scroll;
}

#main article {
    background-color: rgba(10, 10, 10, 0.8);
}

ul.vendors {
    width: 100%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

ul.vendors li {
    width: 20%;
    height: auto;
}

ul.vendors li img {
    width: 100%;
    height: auto;
}

a.external {
    text-decoration: none;
    color: cyan;
    font-weight: bold;
}

a.external link {
    text-decoration: none;
    ;
}

ul.no-bullets {
    list-style-type: none;
}

.creators {
    width: 100%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 2em;
}

.creators img {
    width: 48%;
    height: auto;
    margin-bottom: 1em;
}

.expand-image:hover {
    cursor: pointer;
}

.play-trailer {
    cursor: pointer;
}

.play-trailer:hover {
    color: cyan;
}

/* Modal Background */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Modal Visible State */
.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Wrapper */
.modal-content {
    position: relative;
    width: 95%;
    max-width: 90%;
    /* Increased maximum width */
    align-items: center;
    margin: auto;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    padding-top: 2.5rem;
}

.gallery-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: auto;
    position: relative;
    background: #000;
    /* Optional: black background to frame small images better */
}

.gallery-modal img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
    /* Optional: black background if image doesn't fill */
}

/* Base positioning with vertical centering */
.gallery-modal .modal-prev,
.gallery-modal .modal-next {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    color: #fff;
    border: none;
    padding: 1rem;
    margin: 0 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    position: relative;
    /* maintain inline flow unless repositioned */
}

/* Absolute positioning for larger screens */
@media (min-width: 769px) {
    .gallery-modal {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        position: relative;
    }

    .gallery-modal .modal-prev,
    .gallery-modal .modal-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    .gallery-modal .modal-prev {
        left: 10px;
    }

    .gallery-modal .modal-next {
        right: 10px;
    }
}

/* Stack buttons vertically on mobile */
@media (max-width: 768px) {
    .gallery-modal {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .gallery-modal .modal-prev,
    .gallery-modal .modal-next {
        margin: 0.5rem 0;
        width: auto;
        position: static;
        transform: none;
    }
}

.modal-content .close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
}

/* Initial hidden state for sliding images */
#modalImage {
    opacity: 0;
    transition: opacity 0.6s ease-in-out, transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    position: relative;
}

/* Slide In From Right */
#modalImage.slide-in-right {
    transform: translateX(80px);
}

/* Slide In From Left */
#modalImage.slide-in-left {
    transform: translateX(-80px);
}

/* Active (settled) state */
#modalImage.active {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Video Wrapper */
.video-wrapper iframe {
    width: 100%;
    height: calc(100vh - 100px);
    /* Maximize height minus padding */
    max-height: 90vh;
    /* Cap to prevent overflow on very tall screens */
    border: none;
}

/* Optional: Smooth Fade for Modal */
.modal,
.modal-content iframe {
    transition: all 0.3s ease;
}

/* Hide Utility */
.hidden {
    display: none !important;
}

.backer-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* center items horizontally */
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 1200px;
    /* optional container width */
}

.backer-list li {
    flex: 1 1 calc(33.333% - 1rem);
    /* 3 items per row with spacing */
    margin: 0.5rem;
    text-align: center;
    padding: 0.5rem;
    border-radius: 4px;
}

/* Responsive fallback for smaller screens */
@media (max-width: 768px) {
    .backer-list li {
        flex: 1 1 calc(50% - 1rem);
        /* 2 per row on tablets */
    }
}

@media (max-width: 480px) {
    .backer-list li {
        flex: 1 1 100%;
        /* 1 per row on mobile */
    }
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.thumbnail-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Makes square thumbnails */
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.thumbnail-grid img:hover {
    border-color: #fff;
}

.clip iframe {
    width: 100%;
    height: 400px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
    /* Optional: black background if video doesn't fill */
}

.image-lightbox-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 95%;
    max-width: 95%;
    height: 90vh;
    margin: auto;
    position: relative;
    background: #000;
}

#lightboxImage {
    width: 100%;
    height: auto;
    background: #000;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

#lightboxCaption {
    margin-top: 1rem;
    color: #fff;
    text-align: center;
    font-size: 1rem;
    max-width: 80%;
}