.gallery-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.gallery-filter {
    padding: 0.5rem 1.25rem;
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    background: transparent;
    transition: all var(--transition);
    cursor: pointer;
}

.gallery-filter:hover {
    border-color: var(--accent);
    color: var(--text-light);
}

.gallery-filter.is-active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--text-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.gallery-item {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

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

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

.gallery-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.gallery-item:hover .gallery-item__overlay {
    background: rgba(0, 0, 0, 0.3);
}

.gallery-item__overlay svg {
    width: 32px;
    height: 32px;
    color: var(--text-light);
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition);
}

.gallery-item:hover .gallery-item__overlay svg {
    opacity: 1;
    transform: scale(1);
}

.gallery-item[data-hidden="true"] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

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

.lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lightbox__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    z-index: 1;
    transition: color var(--transition);
}

.lightbox__close:hover {
    color: var(--accent);
}

.lightbox__close svg {
    width: 28px;
    height: 28px;
}

.lightbox__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: color var(--transition);
    z-index: 1;
}

.lightbox__arrow:hover {
    color: var(--accent);
}

.lightbox__arrow svg {
    width: 32px;
    height: 32px;
}

.lightbox__arrow--prev {
    left: 1rem;
}

.lightbox__arrow--next {
    right: 1rem;
}

.lightbox__caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    text-align: center;
    max-width: 80%;
}

.lightbox__counter {
    position: absolute;
    top: 2rem;
    left: 2rem;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }
}
