/* Gallery page styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
    grid-auto-flow: row dense;
    gap: 18px;
    padding: 20px 2px;
    max-width: 1240px;
    margin: 0 auto;
    box-sizing: border-box;
}

.gallery-item {
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    position: relative;
}

.gallery-item--hero-left {
    grid-column: 1 / span 2;
    grid-row: span 2;
}

.gallery-item--stack-right-top,
.gallery-item--stack-right-bottom {
    grid-column: 3;
    grid-row: span 1;
}

.gallery-item--stack-left-top,
.gallery-item--stack-left-bottom {
    grid-column: 1;
    grid-row: span 1;
}

.gallery-item--hero-right {
    grid-column: 2 / span 2;
    grid-row: span 2;
}

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

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.38s ease;
    border-radius: var(--radius-md);
}

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

.gallery-item:hover::after {
    background: rgba(0, 0, 0, 0.1);
}

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    text-align: center;
}

.lightbox-inner img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.3rem;
    line-height: 34px;
    cursor: pointer;
    color: #111;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 2.4rem;
    width: 52px;
    height: 52px;
    line-height: 52px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 1001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.28);
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.gallery-empty {
    text-align: center;
    color: #6b7280;
    padding: 40px 0;
    font-size: 1rem;
}

.gallery-empty.is-hidden {
    display: none;
}

#gallery .mission-copy h2 {
    font-size: 22px;
    font-weight: normal;
}

@media (max-width: 700px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
        gap: 8px;
    }

    .gallery-item {
        grid-column: auto;
        grid-row: auto;
    }

    .gallery-item--hero-left,
    .gallery-item--hero-right {
        grid-column: span 2;
        grid-row: span 1;
    }

    .lightbox-nav {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 1.6rem;
    }
}
