/* =========================================================
   GALLERY.CSS â€” gallery.html only
   Load AFTER base.css.
   ========================================================= */

#media {
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
    background: var(--color-text-light);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

    margin-top: -10px;  /* push the section up slightly to offset navbar */
    margin-bottom: 10px;  /* push the section down slightly to offset navbar */
}

/* ===== WRAPPER / TRACK / GRID (auto-scrolling gallery) ===== */
.media-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.media-track {
    display: flex;
    width: max-content;
    animation: scrollGallery 60s linear infinite;
    will-change: transform;
    pointer-events: auto;
}

.media-grid {
    display: grid;
    grid-template-rows: repeat(2, 200px);
    grid-auto-flow: column;
    grid-auto-columns: 200px;
    gap: 15px;
    padding-right: 15px;
    pointer-events: auto;
}

.media-grid img,
.gallery-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    z-index: 5;
    pointer-events: auto;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.media-grid img:hover,
.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.media-track:hover {
    animation-play-state: paused;
}

.gallery-item img {
    width: 100%;
    height: 100%;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: var(--color-text-light);
    background: rgba(0, 0, 0, 0.5);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 6;
}

@keyframes scrollGallery {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.media-track.paused {
    animation-play-state: paused;
}

/* ===== LIGHTBOX ===== */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#lightbox img,
#lightbox iframe {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: var(--color-text-light);
    cursor: pointer;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: var(--color-text-light);
    cursor: pointer;
    z-index: 2100;
}

.nav-arrow.prev { left: 20px; }
.nav-arrow.next { right: 20px; }

/* ===== MOBILE ===== */
@media (max-width: 600px) {
    .media-grid {
        grid-template-rows: repeat(2, 110px);
        grid-auto-columns: 110px;
        gap: 8px;
    }

    .play-button {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
}