/* Gallery page */
.gallery-page {
    padding: 48px 0 100px;
    min-height: 70vh;
}

.gallery-intro {
    max-width: 680px;
    margin-bottom: 32px;
}

.gallery-intro h1 {
    font-size: 40px;
    color: var(--ink);
    margin: 12px 0 16px;
}

.gallery-intro p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
}

/* Filters */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.gal-filter {
    border: 2px solid transparent;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 999px;
    padding: 10px 22px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gal-filter:hover { color: var(--green-dark); }

.gal-filter.is-active {
    background: var(--green);
    color: var(--white);
}

/* Masonry grid */
.gallery-grid {
    columns: 3;
    column-gap: 20px;
}

.gal-item {
    break-inside: avoid;
    margin: 0 0 20px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
    background: var(--green-light);
}

.gal-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

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

.gal-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 18px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(to top, rgba(20, 18, 14, 0.7), rgba(20, 18, 14, 0));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gal-item:hover figcaption { opacity: 1; }

.gal-item.is-hidden { display: none; }

.gallery-empty {
    display: none;
    text-align: center;
    color: var(--ink-soft);
    font-size: 16px;
    padding: 40px 0;
}

.gallery-empty.is-visible { display: block; }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(20, 18, 14, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.lb-stage {
    max-width: 88vw;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.lb-stage img {
    max-width: 88vw;
    max-height: 76vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.lb-stage figcaption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 600;
}

.lb-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lb-close:hover { background: rgba(255, 255, 255, 0.25); }
.lb-close svg { width: 24px; height: 24px; stroke: #fff; }

.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lb-arrow:hover { background: rgba(255, 255, 255, 0.25); }
.lb-arrow svg { width: 26px; height: 26px; stroke: #fff; }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }

/* Responsive */
@media (max-width: 900px) {
    .gallery-intro h1 { font-size: 32px; }
    .gallery-grid { columns: 2; }
}

@media (max-width: 560px) {
    .gallery-grid { columns: 1; }
    .gal-item figcaption { opacity: 1; }
    .lb-prev { left: 10px; }
    .lb-next { right: 10px; }
    .lb-arrow { width: 44px; height: 44px; }
}
