.gallery-hero {
    position: relative;
    min-height: 430px;
    overflow: hidden;
    color: #fff;
    background: #03101e;
    isolation: isolate;
}

.gallery-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(2,13,24,.82), rgba(2,13,24,.34));
}

.gallery-hero-copy {
    width: min(1160px, calc(100% - 48px));
    margin: 0 auto;
    padding: 150px 0 86px;
}

.gallery-hero-copy p,
.gallery-section-head p {
    margin: 0 0 8px;
    color: var(--gold);
    font-weight: 800;
}

.gallery-hero-copy h1 {
    max-width: 760px;
    margin: 0 0 14px;
    font-size: clamp(42px, 6vw, 74px);
    line-height: 1.05;
}

.gallery-hero-copy span {
    display: block;
    max-width: 620px;
    color: rgba(255,255,255,.9);
    font-size: 19px;
    line-height: 1.75;
}

.gallery-page {
    padding: 48px 0 68px;
}

.gallery-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.gallery-section-head span {
    color: var(--muted);
    font-weight: 800;
}

.folder-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.folder-gallery-masonry {
    grid-template-columns: repeat(3, 1fr);
}

.folder-gallery-item {
    position: relative;
    min-height: 238px;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #eaf1f2;
    box-shadow: 0 12px 28px rgba(21,42,65,.1);
    cursor: pointer;
}

.folder-gallery-masonry .folder-gallery-item:nth-child(3n + 2) {
    min-height: 310px;
}

.folder-gallery-masonry .folder-gallery-item:nth-child(5n + 1) {
    min-height: 280px;
}

.folder-gallery-item img {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    transition: transform 220ms ease, filter 220ms ease;
}

.folder-gallery-item:hover img,
.folder-gallery-item:focus-visible img {
    transform: scale(1.045);
    filter: saturate(1.08);
}

.folder-gallery-item:focus-visible {
    outline: 3px solid rgba(199,149,74,.78);
    outline-offset: 4px;
}

.gallery-empty {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
    text-align: center;
}

.gallery-lightbox[hidden] {
    display: none;
}

body.gallery-lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3,16,30,.88);
    backdrop-filter: blur(6px);
}

.gallery-lightbox-panel {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: min(1080px, 100%);
    max-height: calc(100vh - 48px);
    animation: lightboxIn 180ms ease both;
}

.gallery-lightbox-panel img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 116px);
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 26px 70px rgba(0,0,0,.42);
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    background: rgba(3,16,30,.76);
    box-shadow: 0 12px 26px rgba(0,0,0,.24);
    cursor: pointer;
}

.gallery-lightbox-close {
    top: -4px;
    right: -4px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 30px;
}

.gallery-lightbox-nav {
    top: 50%;
    width: 52px;
    height: 64px;
    border-radius: 8px;
    font-size: 44px;
    transform: translateY(-50%);
}

.gallery-lightbox-prev {
    left: -72px;
}

.gallery-lightbox-next {
    right: -72px;
}

.gallery-lightbox-nav:disabled {
    display: none;
}

.gallery-lightbox-counter {
    margin: 14px 0 0;
    padding: 6px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(3,16,30,.68);
    font-weight: 800;
}

@keyframes lightboxIn {
    from {
        opacity: 0;
        transform: scale(.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 960px) {
    .folder-gallery,
    .folder-gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-lightbox-prev {
        left: 10px;
    }

    .gallery-lightbox-next {
        right: 10px;
    }
}

@media (max-width: 640px) {
    .gallery-hero-copy {
        width: min(100% - 28px, 1160px);
        padding: 136px 0 64px;
    }

    .gallery-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .folder-gallery,
    .folder-gallery-masonry {
        grid-template-columns: 1fr;
    }

    .folder-gallery-item,
    .folder-gallery-masonry .folder-gallery-item:nth-child(n) {
        min-height: 260px;
    }

    .gallery-lightbox {
        padding: 14px;
    }

    .gallery-lightbox-panel img {
        max-height: calc(100vh - 132px);
    }

    .gallery-lightbox-close {
        top: 6px;
        right: 6px;
    }

    .gallery-lightbox-nav {
        width: 46px;
        height: 56px;
        font-size: 38px;
    }
}
