.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Base style for all gallery images */
.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    aspect-ratio: 1 / 1;
    display: block;
}

/* Album Art Gallery: Lighten on hover */
.gallery img:hover {
    transform: scale(1.03);
    opacity: 0.7; 
}

/* Video Gallery: Setup for play button */
.video-thumb {
    position: relative; 
    overflow: hidden; 
}

.video-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Video Gallery: Lighten on hover */
.video-thumb:hover img {
    transform: scale(1.03);
    opacity: 0.7;
}

/* Video Gallery: Play button */
.video-thumb::after {
    content: '▶'; 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    font-size: 32px; 
    color: white;
    opacity: 0; 
    transition: opacity 0.3s ease;
    pointer-events: none; 
    z-index: 2; 
}

.video-thumb:hover::after {
    opacity: 1;
}

/* Overlay after thumbnail click */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

#overlay .overlay-content {
    text-align: center;
    width: 90vw; 
    max-width: 1200px;
}

#overlay img {
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* Video Overlay */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; 
    height: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#overlay #caption {
    margin-top: 20px;
    color: white;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
}

/* Overlay nav arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
    padding: 20px;
}

#prev { left: 10px; }
#next { right: 10px; }
