/* Thumbnail Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 30px;
}

.gallery-item {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f4f4f4;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Lightbox Overlay */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(10, 10, 10, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Content */
#lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#lightbox.active #lightbox-img {
    transform: scale(1);
}

/* Controls */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.lightbox-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

#lightbox-prev {
    left: 30px;
}

#lightbox-next {
    right: 30px;
}

#lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    transform: none;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
}

#lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Mobile responsivity for arrows */
@media (max-width: 768px) {
    #lightbox-prev { left: 10px; width: 40px; height: 40px; }
    #lightbox-next { right: 10px; width: 40px; height: 40px; }
    #lightbox-img { max-width: 100vw; border-radius: 0; }
}
