.gallery-page {
    --gallery-border: color-mix(in srgb, var(--site-primary-dark) 14%, #ffffff);
    --public-page-border: var(--gallery-border);
    --public-page-hero-background: #092d50;
}

.gallery-page .page-hero--gallery .page-hero__image {
    object-position: center 42%;
}

.gallery-filters {
    margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
    padding: clamp(1.25rem, 3vw, 2rem);
    background: color-mix(in srgb, var(--site-sage, #e8efe4) 58%, #ffffff);
}

#site-shell #main-content .page-content.gallery-page .gallery-filters {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding-inline: max(1rem, calc((100vw - var(--site-container)) / 2));
}

.gallery-filters__heading {
    margin-bottom: 1.35rem;
}

.gallery-filters__form {
    display: grid;
    gap: 1rem;
    align-items: end;
}

.gallery-field {
    display: grid;
    min-width: 0;
    gap: 0.4rem;
}

.gallery-field label {
    color: var(--site-primary-dark);
    font-size: calc(0.88rem * var(--a11y-text-scale));
    font-weight: 750;
    line-height: 1.4;
}

.gallery-field input,
.gallery-field select {
    width: 100%;
    min-height: 3rem;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-small);
    padding: 0.65rem 0.8rem;
    background: var(--site-white);
    color: var(--site-text);
    font: inherit;
}

#site-shell #main-content .page-content.gallery-page .gallery-field select {
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23123A5A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 0.75rem 0.5rem;
}

.gallery-field input:hover,
.gallery-field select:hover {
    border-color: var(--site-primary);
}

.gallery-field input:focus,
.gallery-field select:focus {
    border-color: var(--site-primary);
    outline: 3px solid color-mix(in srgb, var(--site-focus) 68%, transparent);
    outline-offset: 2px;
}

.gallery-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.gallery-filters .button,
.gallery-empty .button {
    border-radius: var(--site-radius);
    padding-inline: 1.1rem;
}

#site-shell .gallery-filters .button {
    height: var(--control-height-compact);
    min-height: var(--control-height-compact);
}

#site-shell .gallery-filters .button--primary {
    cursor: pointer;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

#site-shell .gallery-filters .button--primary:hover {
    border-color: var(--site-primary-dark);
    background: color-mix(in srgb, var(--editorial-blue) 76%, var(--site-primary-dark));
    box-shadow: 0 0.55rem 1.2rem rgb(7 52 84 / 0.16);
    transform: translateY(-0.08rem);
}

#site-shell .gallery-filters .button--primary:active {
    box-shadow: 0 0.2rem 0.5rem rgb(7 52 84 / 0.14);
    transform: translateY(0);
}

.gallery-empty .button {
    min-height: 3rem;
}

.gallery-results__heading {
    margin-bottom: clamp(1.5rem, 3vw, 2.1rem);
}

.gallery-results {
    scroll-margin-top: 1.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.1rem, 3vw, 1.6rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-grid > li {
    min-width: 0;
    margin: 0;
}

.gallery-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--gallery-border);
    background: var(--site-white);
    box-shadow: var(--site-shadow-small);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.gallery-card:hover {
    border-color: color-mix(in srgb, var(--site-primary) 42%, var(--site-border));
    box-shadow: 0 1.2rem 2.8rem rgb(22 50 83 / 0.14);
    transform: translateY(-0.2rem);
}

.gallery-card__link {
    display: grid;
    height: 100%;
    grid-template-rows: auto 1fr;
    color: inherit;
    text-decoration: none;
}

.gallery-card__link:focus-visible {
    outline: 3px solid var(--site-focus);
    outline-offset: -4px;
}

.gallery-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #dfeaf1;
}

.gallery-card__media img,
.gallery-card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-card__media img {
    object-fit: cover;
    transition: transform 260ms ease;
}

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

.gallery-card__placeholder {
    display: grid;
    place-items: center;
    color: var(--site-primary);
}

.gallery-card__placeholder svg,
.gallery-empty__icon svg {
    width: 3rem;
    height: 3rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

#site-shell .page-content.gallery-page .gallery-card__count {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.32rem 0.55rem;
    border: 1px solid rgb(255 255 255 / 0.28);
    border-radius: 999px;
    background: rgb(6 31 58 / 0.62);
    color: var(--site-white);
    font-size: calc(0.72rem * var(--a11y-text-scale));
    font-weight: 700;
    line-height: 1.2;
}

.gallery-card__content {
    display: grid;
    gap: 0.65rem;
    align-content: start;
    padding: 1.15rem;
}

.gallery-card__category {
    justify-self: start;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    background: color-mix(in srgb, var(--site-primary) 9%, #ffffff);
    color: var(--site-primary);
    font-size: calc(0.72rem * var(--a11y-text-scale));
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.gallery-card__content h3 {
    margin: 0;
    color: var(--site-primary-dark);
    line-height: 1.3;
}

.gallery-card:hover .gallery-card__content h3 {
    color: var(--site-link);
}

.gallery-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.35rem;
    color: var(--site-text-muted);
    font-size: calc(0.84rem * var(--a11y-text-scale));
    line-height: 1.45;
}

.gallery-card__action {
    color: var(--site-primary);
    font-weight: 750;
}

.gallery-card__action::after {
    margin-left: 0.35rem;
    content: "\2192";
}

.gallery-empty {
    display: grid;
    min-height: 13rem;
    gap: 1rem 1.5rem;
    align-items: center;
    padding: clamp(1.35rem, 4vw, 2rem);
}

.gallery-empty__icon {
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--site-primary) 10%, #ffffff);
    color: var(--site-primary);
}

.gallery-empty h3,
.gallery-empty p {
    margin: 0;
}

.gallery-empty p {
    margin-top: 0.35rem;
    color: var(--site-text-muted);
}

.gallery-album-page {
    --gallery-border: color-mix(in srgb, var(--site-primary-dark) 14%, #ffffff);
    --public-page-border: var(--gallery-border);
    --public-page-hero-background: #092d50;
}

.gallery-album-page .page-hero--gallery-album .page-hero__image {
    object-position: center 45%;
}

.gallery-album-summary {
    display: grid;
    gap: 1rem 1.5rem;
    align-items: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    padding-block: clamp(1rem, 2vw, 1.35rem);
    border-top: 1px solid var(--gallery-border);
    border-bottom: 1px solid var(--site-primary-accent);
}

.gallery-album-photos__heading h2 {
    margin: 0;
    color: var(--site-primary-dark);
}

.gallery-album-summary__category {
    width: fit-content;
    margin: 0;
    border-radius: 0;
    padding: 0.3rem 0.65rem;
    background: color-mix(in srgb, var(--site-primary) 9%, #ffffff);
    color: var(--site-primary);
    font-size: calc(0.74rem * var(--a11y-text-scale));
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gallery-album-summary__description {
    max-width: 52rem;
    margin: 0.75rem 0 0;
    color: var(--site-text);
    line-height: 1.7;
}

.gallery-album-summary__description:first-child {
    margin-top: 0;
}

.gallery-album-summary__action {
    justify-self: start;
}

.gallery-album-summary__action .button {
    min-height: 3rem;
    border-radius: var(--site-radius);
    padding-inline: 1.15rem;
}

.gallery-album-photos {
    scroll-margin-top: 1.5rem;
}

.gallery-album-photos__heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 2rem;
    align-items: end;
    justify-content: space-between;
    margin-bottom: clamp(1.5rem, 3vw, 2.1rem);
}

.gallery-album-photos__heading > p {
    max-width: 32rem;
    margin: 0;
    color: var(--site-text-muted);
    line-height: 1.55;
}

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

.gallery-photo-card {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--gallery-border);
    background: var(--site-white);
    box-shadow: var(--site-shadow-small);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.gallery-photo-card:hover {
    border-color: color-mix(in srgb, var(--site-primary) 42%, var(--site-border));
    box-shadow: 0 1.2rem 2.8rem rgb(22 50 83 / 0.14);
    transform: translateY(-0.2rem);
}

.gallery-photo-card__link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #dfeaf1;
}

.gallery-photo-card__link:focus-visible {
    outline: 3px solid var(--site-focus);
    outline-offset: -4px;
}

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

.gallery-photo-card:hover .gallery-photo-card__link img {
    transform: scale(1.03);
}

.gallery-photo-card__zoom {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    color: var(--site-white);
    filter: drop-shadow(0 1px 2px rgb(6 31 58 / 0.95));
    transition: opacity 180ms ease, transform 180ms ease;
}

.gallery-photo-card__zoom svg {
    width: 1.7rem;
    height: 1.7rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.gallery-photo-card__link:hover .gallery-photo-card__zoom,
.gallery-photo-card__link:focus-visible .gallery-photo-card__zoom {
    transform: scale(1.08);
}

.gallery-photo-card figcaption {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--site-text-muted);
    font-size: calc(0.86rem * var(--a11y-text-scale));
    line-height: 1.5;
}

@media (min-width: 40rem) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-empty {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
}

@media (min-width: 52rem) {
    .gallery-filters__form {
        grid-template-columns: minmax(14rem, 1.5fr) minmax(11rem, 1fr) minmax(8rem, 0.65fr);
    }

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

@media (min-width: 68rem) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .gallery-album-summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .gallery-album-summary__action {
        justify-self: end;
    }

    .gallery-filters__form {
        grid-template-columns: minmax(14rem, 1.5fr) minmax(11rem, 1fr) minmax(8rem, 0.65fr) auto;
    }

    .gallery-filters__actions {
        grid-column: auto;
        flex-wrap: nowrap;
    }
}

@media (max-width: 30rem) {
    .gallery-filters__heading,
    .gallery-results__heading {
        display: grid;
        align-items: start;
    }

    .gallery-filters__actions .button,
    .gallery-empty .button {
        width: 100%;
    }

    .gallery-album-photos__heading {
        display: grid;
        align-items: start;
    }
}

@media (forced-colors: active) {
    #site-shell #main-content .page-content.gallery-page .gallery-field select {
        appearance: auto;
        padding-right: 0.8rem;
        background-image: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #site-shell .gallery-filters .button--primary,
    .gallery-card,
    .gallery-card__media img,
    .gallery-photo-card,
    .gallery-photo-card__link img,
    .gallery-photo-card__zoom {
        transition: none;
    }

    #site-shell .gallery-filters .button--primary:hover,
    #site-shell .gallery-filters .button--primary:active,
    .gallery-card:hover,
    .gallery-card:hover .gallery-card__media img,
    .gallery-photo-card:hover,
    .gallery-photo-card:hover .gallery-photo-card__link img,
    .gallery-photo-card__link:hover .gallery-photo-card__zoom,
    .gallery-photo-card__link:focus-visible .gallery-photo-card__zoom {
        transform: none;
    }
}
