.gallery-page-hero,
.gallery-page-content {
    padding: clamp(58px, 8vh, 90px) 0;
}

.gallery-page-hero h1 {
    margin: 8px 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
}

.gallery-page-hero p {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
}

.gallery-filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.gallery-filter-btn {
    border: 1px solid rgba(24, 21, 19, 0.12);
    background: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'Space Grotesk', sans-serif;
}

.gallery-filter-btn.active,
.gallery-filter-btn:hover {
    background: linear-gradient(90deg, var(--red), #d13a48);
    color: #fff;
    border-color: transparent;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.03);
}

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

.gallery-card:hover img {
    transform: scale(1.04);
}

.gallery-card-overlay {
    position: absolute;
    inset: auto 0 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
    color: #fff;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-empty-note {
    color: var(--muted);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1700;
    padding: 16px;
}

.gallery-lightbox.open {
    display: flex;
}

.gallery-lightbox button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.gallery-lightbox img {
    max-width: min(1200px, 92vw);
    max-height: 82vh;
    border-radius: 12px;
    object-fit: contain;
}

.gallery-lightbox p {
    color: #fff;
    margin-top: 10px;
}

.gallery-card.hidden {
    display: none;
}

@media (max-width: 1100px) {
    .masonry-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .masonry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 500px) {
    .masonry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
