/* Gallery Grid */
.gallery-wrapper {
    margin: 2rem 0;
}

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

.gallery-thumb {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    display: block;
    width: 100%;
    overflow: hidden;
    position: relative;
    transition: opacity 0.2s;
}

.gallery-thumb:hover {
    opacity: 0.8;
}

.gallery-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Lightbox Overlay */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-lightbox-bg);
    z-index: 11000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.gallery-lightbox.is-visible {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.gallery-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 0 20px var(--color-overlay);
}

.gallery-caption {
    color: var(--color-text);
    margin-top: 1rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 10000;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.gallery-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}