.gallery-hero,
.gallery-album-hero {
    background:
        radial-gradient(circle at 86% 18%, rgba(229, 175, 40, .24), transparent 28%),
        linear-gradient(130deg, var(--uap-deep), var(--uap-bright));
    background:
        radial-gradient(circle at 86% 18%, color-mix(in srgb, var(--uap-gold) 24%, transparent), transparent 28%),
        linear-gradient(130deg, var(--uap-deep), var(--uap-bright));
}

.gallery-hero h1,
.gallery-album-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.8rem);
    letter-spacing: -.04em;
    line-height: 1.02;
    margin: .35rem 0 .9rem;
}

.gallery-section-heading {
    align-items: end;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.gallery-section-heading h2 {
    color: var(--uap-blue);
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    letter-spacing: -.025em;
    margin: 0;
}

.gallery-section-heading > p {
    color: var(--uap-muted);
    line-height: 1.6;
    margin: 0;
}

.gallery-album-grid {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-album-card {
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 8px 26px rgba(11, 71, 116, .12);
    color: inherit;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease;
}

.gallery-album-card:hover {
    box-shadow: 0 16px 36px var(--uap-shadow);
    color: inherit;
    transform: translateY(-5px);
}

.gallery-album-card:focus-visible {
    outline: 3px solid var(--uap-gold);
    outline-offset: 4px;
}

.gallery-album-cover {
    aspect-ratio: 4 / 3;
    background: #dceaf5;
    overflow: hidden;
    position: relative;
}

.gallery-album-cover::after {
    background: linear-gradient(180deg, transparent 55%, rgba(0, 31, 59, .72));
    content: '';
    inset: 0;
    position: absolute;
}

.gallery-album-cover img {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    width: 100%;
}

.gallery-album-card:hover .gallery-album-cover img {
    transform: scale(1.035);
}

.gallery-photo-count {
    background: rgba(255, 255, 255, .94);
    border-radius: 999px;
    bottom: .85rem;
    color: var(--uap-blue);
    font-size: .73rem;
    font-weight: 800;
    padding: .42rem .68rem;
    position: absolute;
    right: .85rem;
    z-index: 1;
}

.gallery-album-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem 1.3rem 1.35rem;
}

.gallery-album-copy h3 {
    color: var(--uap-blue);
    font-size: 1.22rem;
    line-height: 1.3;
    margin: 0 0 .5rem;
}

.gallery-album-copy p {
    color: var(--uap-muted);
    line-height: 1.6;
    margin: 0 0 1rem;
}

.gallery-open-label {
    align-items: center;
    color: var(--uap-blue);
    display: inline-flex;
    font-size: .88rem;
    font-weight: 800;
    gap: .35rem;
    margin-top: auto;
}

.gallery-open-label .public-arrow-icon {
    height: 1rem;
    width: 1rem;
}

.gallery-empty {
    grid-column: 1 / -1;
}

.gallery-pagination {
    margin-top: 2rem;
}

.gallery-back-link {
    align-items: center;
    color: #fff;
    display: inline-flex;
    font-weight: 750;
    gap: .45rem;
    margin-bottom: 2rem;
    text-decoration: none;
}

.gallery-back-link:hover,
.gallery-back-link:focus-visible {
    color: var(--uap-gold);
    text-decoration: underline;
}

.gallery-back-link svg {
    height: 1.1rem;
    width: 1.1rem;
}

.gallery-album-caption {
    color: #e5f1fb;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
    margin: 0;
    max-width: 760px;
    white-space: pre-line;
}

.gallery-album-total {
    color: var(--uap-gold);
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .1em;
    margin: 1.25rem 0 0;
    text-transform: uppercase;
}

.gallery-photo-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-photo {
    aspect-ratio: 4 / 3;
    background: #dceaf5;
    border-radius: .9rem;
    box-shadow: 0 5px 20px rgba(11, 71, 116, .1);
    overflow: hidden;
    position: relative;
}

.gallery-photo img {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
    width: 100%;
}

.gallery-photo-expand {
    background: var(--uap-deep);
    border-radius: 999px;
    bottom: .75rem;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    opacity: 0;
    padding: .42rem .65rem;
    position: absolute;
    right: .75rem;
    transform: translateY(.35rem);
    transition: opacity .2s ease, transform .2s ease;
}

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

.gallery-photo:hover .gallery-photo-expand,
.gallery-photo:focus-visible .gallery-photo-expand {
    opacity: 1;
    transform: translateY(0);
}

.gallery-photo:focus-visible {
    outline: 3px solid var(--uap-gold);
    outline-offset: 3px;
}

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

.gallery-lightbox {
    background: #031b2e;
    border: 0;
    border-radius: 1.15rem;
    box-shadow: 0 24px 80px rgba(0, 20, 38, .45);
    color: #fff;
    height: min(860px, calc(100dvh - 2rem));
    margin: auto;
    max-height: none;
    max-width: none;
    overflow: hidden;
    padding: 0;
    width: min(1120px, calc(100% - 2rem));
}

.gallery-lightbox::backdrop {
    background: rgba(0, 18, 34, .88);
    backdrop-filter: blur(4px);
}

.gallery-lightbox-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
}

.gallery-lightbox-header,
.gallery-lightbox-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.gallery-lightbox-header {
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.gallery-lightbox-eyebrow {
    color: var(--uap-gold);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .16em;
    margin: 0 0 .3rem;
}

.gallery-lightbox-header h2 {
    color: #fff;
    font-size: clamp(1.15rem, 2.3vw, 1.6rem);
    line-height: 1.25;
    margin: 0;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .42);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.gallery-lightbox-close {
    border-radius: 999px;
    font-size: 1.55rem;
    height: 2.75rem;
    line-height: 1;
    width: 2.75rem;
}

.gallery-lightbox-nav {
    border-radius: 999px;
    height: 3.25rem;
    margin: 1rem;
    width: 3.25rem;
    z-index: 1;
}

.gallery-lightbox-nav svg {
    height: 1.4rem;
    width: 1.4rem;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    background: rgba(255, 255, 255, .24);
    border-color: #fff;
}

.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:focus-visible {
    outline: 3px solid var(--uap-gold);
    outline-offset: 3px;
}

.gallery-lightbox-nav:active {
    transform: scale(.96);
}

.gallery-lightbox-stage {
    align-items: center;
    background: #001322;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 0;
}

.gallery-lightbox-figure {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    margin: 0;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding: 1rem;
}

.gallery-lightbox-figure img {
    display: block;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.gallery-lightbox-footer {
    border-top: 1px solid rgba(255, 255, 255, .14);
    min-height: 4.25rem;
}

.gallery-lightbox-footer p {
    color: #dceaf5;
    line-height: 1.5;
    margin: 0;
}

.gallery-lightbox-counter {
    color: var(--uap-gold) !important;
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.gallery-lightbox-nav[hidden],
.gallery-lightbox-footer p[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .gallery-album-grid,
    .gallery-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .gallery-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: .65rem;
    }

    .gallery-album-grid {
        grid-template-columns: 1fr;
    }

    .gallery-photo-grid {
        gap: .65rem;
    }

    .gallery-detail-heading > p {
        display: none;
    }

    .gallery-lightbox {
        border-radius: .85rem;
        height: calc(100dvh - 1rem);
        width: calc(100% - 1rem);
    }

    .gallery-lightbox-header,
    .gallery-lightbox-footer {
        padding: .8rem .9rem;
    }

    .gallery-lightbox-stage {
        display: block;
        position: relative;
    }

    .gallery-lightbox-figure {
        padding: .55rem;
    }

    .gallery-lightbox-nav {
        margin: 0;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .gallery-lightbox-nav:active {
        transform: translateY(-50%) scale(.96);
    }

    .gallery-lightbox-previous {
        left: .65rem;
    }

    .gallery-lightbox-next {
        right: .65rem;
    }

    .gallery-lightbox-footer {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .gallery-photo-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-album-card,
    .gallery-album-cover img,
    .gallery-photo img,
    .gallery-photo-expand,
    .gallery-lightbox-close,
    .gallery-lightbox-nav {
        transition: none;
    }
}
