body.gallery-page {
    --gallery-red: #c8102e;
    --gallery-red-dark: #9f0c25;
    --gallery-ink: #171717;
    --gallery-muted: #676767;
    --gallery-line: #e7e4df;
    --gallery-yellow: #ffd84d;
    background: #f7f7f4;
    color: var(--gallery-ink);
}

body.gallery-page .container,
body.gallery-page main.container.gallery-content {
    width: min(1440px, calc(100% - 64px));
}

body.gallery-page .gallery-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    background: var(--gallery-red-dark);
    color: #ffffff;
}

body.gallery-page .gallery-hero__image,
body.gallery-page .gallery-hero__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

body.gallery-page .gallery-hero__image {
    display: block;
    object-fit: cover;
    object-position: center 42%;
}

body.gallery-page .gallery-hero__overlay {
    background:
        linear-gradient(90deg, rgba(18, 8, 10, 0.9) 0%, rgba(18, 8, 10, 0.72) 44%, rgba(18, 8, 10, 0.25) 78%, rgba(18, 8, 10, 0.12) 100%),
        linear-gradient(0deg, rgba(18, 8, 10, 0.36), transparent 55%);
}

body.gallery-page .gallery-hero__inner {
    position: relative;
    z-index: 1;
    min-height: 420px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 20px 32px;
    align-items: end;
    padding-top: 34px;
    padding-bottom: 38px;
}

body.gallery-page .gallery-back {
    grid-column: 1 / -1;
    width: fit-content;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 7px 11px 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 6px;
    background: rgba(20, 10, 12, 0.28);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background 0.18s ease, border-color 0.18s ease;
}

body.gallery-page .gallery-back svg,
body.gallery-page .gallery-kicker svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.gallery-page .gallery-back:hover,
body.gallery-page .gallery-back:focus-visible {
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(20, 10, 12, 0.56);
    color: #ffffff;
    outline: none;
}

body.gallery-page .gallery-hero__content {
    max-width: 760px;
    align-self: end;
}

body.gallery-page .gallery-hero p.gallery-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 216, 77, 0.5);
    border-radius: 6px;
    background: rgba(255, 216, 77, 0.14);
    color: #ffe995;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
}

body.gallery-page .gallery-kicker svg {
    width: 16px;
    height: 16px;
}

body.gallery-page .gallery-hero h1 {
    max-width: 720px;
    margin: 0;
    color: #ffffff;
    font-family: 'Google Sans Flex', 'Nunito Sans', system-ui, sans-serif;
    font-size: 56px;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.04;
    text-wrap: balance;
}

body.gallery-page .gallery-hero p.gallery-hero__intro {
    max-width: 610px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.6;
}

body.gallery-page .gallery-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 24px 0 0;
}

body.gallery-page .gallery-stat {
    min-width: 112px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 8px;
    padding: 0 22px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    background: transparent;
}

body.gallery-page .gallery-stat:first-child {
    padding-left: 0;
    border-left: 0;
}

body.gallery-page .gallery-stat dt {
    grid-column: 2;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
}

body.gallery-page .gallery-stat dd {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    color: var(--gallery-yellow);
    font-size: 1.5rem;
    font-weight: 950;
    line-height: 1;
}

body.gallery-page .gallery-content {
    padding-top: 54px;
    padding-bottom: 72px;
}

body.gallery-page .gallery-collection {
    scroll-margin-top: 16px;
}

body.gallery-page .gallery-collection__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

body.gallery-page .gallery-collection__eyebrow {
    margin: 0 0 5px;
    color: var(--gallery-red);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.gallery-page .gallery-collection__heading h2 {
    margin: 0;
    color: var(--gallery-ink);
    font-family: 'Google Sans Flex', 'Nunito Sans', system-ui, sans-serif;
    font-size: 32px;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.18;
}

body.gallery-page .gallery-status {
    margin: 0;
    padding: 0;
    color: var(--gallery-muted);
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

body.gallery-page .gallery-toolbar {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin: 0 0 22px;
    padding: 10px;
    border: 1px solid var(--gallery-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 28px rgba(23, 23, 23, 0.08);
    backdrop-filter: blur(12px);
}

body.gallery-page .gallery-toolbar__label {
    flex: 0 0 auto;
    padding-left: 4px;
    color: #77716a;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

body.gallery-page .gallery-filters {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.gallery-page .gallery-filter {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 9px 7px 12px;
    border: 1px solid #ddd8d2;
    border-radius: 6px;
    background: #ffffff;
    color: #302e2b;
    font-size: 0.88rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

body.gallery-page .gallery-filter span {
    min-width: 25px;
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 5px;
    background: #fff2bb;
    color: #6a5200;
    font-size: 0.74rem;
    font-weight: 950;
}

body.gallery-page .gallery-filter:hover,
body.gallery-page .gallery-filter:focus-visible {
    border-color: rgba(200, 16, 46, 0.38);
    background: #fff8f8;
    color: var(--gallery-red);
    transform: none;
    outline: none;
}

body.gallery-page .gallery-filter.is-active {
    border-color: var(--gallery-red) !important;
    background: var(--gallery-red) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(200, 16, 46, 0.2) !important;
}

body.gallery-page .gallery-filter.is-active span {
    background: #ffffff !important;
    color: var(--gallery-red) !important;
    -webkit-text-fill-color: var(--gallery-red) !important;
}

body.gallery-page .gallery-shell {
    min-width: 0;
}

body.gallery-page .gallery-masonry {
    display: block;
    columns: 4 250px;
    column-gap: 16px;
}

body.gallery-page .gallery-card {
    width: 100%;
    display: inline-block;
    break-inside: avoid;
    margin: 0 0 16px;
    vertical-align: top;
}

body.gallery-page .gallery-card__link {
    display: block;
    height: auto;
    color: inherit;
    text-decoration: none;
    outline: none;
}

body.gallery-page .gallery-card__figure {
    position: relative;
    height: auto;
    margin: 0;
    overflow: hidden;
    border: 1px solid #dedbd6;
    border-radius: 8px;
    background: #ecebe7;
    box-shadow: 0 8px 24px rgba(23, 23, 23, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.gallery-page .gallery-card__media {
    aspect-ratio: auto;
    min-height: 0;
    background: #ecebe7;
    line-height: 0;
    overflow: hidden;
}

body.gallery-page .gallery-card__media.is-loading {
    aspect-ratio: 4 / 3;
}

body.gallery-page .gallery-card__media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.35s ease;
}

body.gallery-page .gallery-card__media.is-loading img {
    height: 100%;
    object-fit: cover;
}

body.gallery-page .gallery-card__caption {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    display: grid;
    gap: 3px;
    padding: 42px 14px 13px;
    background: linear-gradient(0deg, rgba(15, 12, 12, 0.86) 0%, rgba(15, 12, 12, 0.52) 52%, transparent 100%);
    color: #ffffff;
    pointer-events: none;
}

body.gallery-page .gallery-card__caption:empty {
    display: none;
}

body.gallery-page .gallery-card__caption span {
    color: #ffe27a;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

body.gallery-page .gallery-card__caption strong {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.3;
}

body.gallery-page .gallery-card__open {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 6px;
    background: rgba(15, 12, 12, 0.52);
    color: #ffffff;
    opacity: 0;
    transform: translateY(-4px);
    backdrop-filter: blur(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

body.gallery-page .gallery-card__open svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.gallery-page .gallery-card__link:hover .gallery-card__figure,
body.gallery-page .gallery-card__link:focus-visible .gallery-card__figure {
    border-color: rgba(200, 16, 46, 0.44);
    box-shadow: 0 16px 34px rgba(23, 23, 23, 0.16);
    transform: translateY(-3px);
}

body.gallery-page .gallery-card__link:hover .gallery-card__media img,
body.gallery-page .gallery-card__link:focus-visible .gallery-card__media img {
    transform: scale(1.025);
}

body.gallery-page .gallery-card__link:hover .gallery-card__open,
body.gallery-page .gallery-card__link:focus-visible .gallery-card__open {
    opacity: 1;
    transform: translateY(0);
}

body.gallery-page .gallery-empty {
    display: none;
    margin: 0;
    padding: 36px 20px;
    border: 1px dashed #d6d1ca;
    border-radius: 8px;
    background: #ffffff;
    color: var(--gallery-muted);
    font-weight: 750;
    text-align: center;
}

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

body.gallery-page .gallery-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
}

body.gallery-page .gallery-load-more__button {
    min-width: 180px;
    min-height: 44px;
    border: 1px solid var(--gallery-red);
    border-radius: 6px;
    background: #ffffff;
    color: var(--gallery-red);
    font-weight: 900;
}

body.gallery-page .gallery-load-more__button:hover,
body.gallery-page .gallery-load-more__button:focus-visible {
    background: var(--gallery-red);
    color: #ffffff;
    outline: none;
}

body.gallery-page .gallery-load-more__hint {
    margin: 0;
    color: #837d75;
    font-size: 0.82rem;
}

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

body.gallery-page .gallery-lightbox[hidden] {
    display: none !important;
}

body.gallery-page .gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(10, 9, 9, 0.92);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

body.gallery-page .gallery-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

body.gallery-page .gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
}

body.gallery-page .gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(1200px, 94vw);
    max-height: calc(100dvh - 40px);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "image image"
        "caption status";
    align-items: center;
    gap: 10px 18px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translateY(10px);
    transition: transform 0.18s ease;
}

body.gallery-page .gallery-lightbox.is-open .gallery-lightbox__dialog {
    transform: translateY(0);
}

body.gallery-page .gallery-lightbox__image-wrap {
    grid-area: image;
    position: relative;
    min-height: 60vh;
    max-height: calc(100dvh - 100px);
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    background: #171515;
}

body.gallery-page .gallery-lightbox__image-wrap img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 100px);
    object-fit: contain;
}

body.gallery-page .gallery-lightbox__nav,
body.gallery-page .gallery-lightbox__close {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 6px;
    background: rgba(15, 12, 12, 0.66);
    color: #ffffff;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

body.gallery-page .gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
}

body.gallery-page .gallery-lightbox__nav--prev {
    left: 14px;
}

body.gallery-page .gallery-lightbox__nav--next {
    right: 14px;
}

body.gallery-page .gallery-lightbox__nav svg,
body.gallery-page .gallery-lightbox__close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.gallery-page .gallery-lightbox__nav:hover,
body.gallery-page .gallery-lightbox__nav:focus-visible,
body.gallery-page .gallery-lightbox__close:hover,
body.gallery-page .gallery-lightbox__close:focus-visible {
    border-color: var(--gallery-yellow);
    background: var(--gallery-yellow);
    color: #1d1805;
    outline: none;
}

body.gallery-page .gallery-lightbox__nav:disabled {
    cursor: default;
    opacity: 0.28;
}

body.gallery-page .gallery-lightbox__close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3;
    width: 44px;
    height: 44px;
    box-shadow: none;
}

body.gallery-page .gallery-lightbox__caption {
    grid-area: caption;
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    text-align: left;
}

body.gallery-page .gallery-lightbox__status {
    grid-area: status;
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.86rem;
    font-weight: 800;
    text-align: right;
}

@media (max-width: 1000px) {
    body.gallery-page .gallery-hero h1 {
        font-size: 48px;
    }

    body.gallery-page .gallery-masonry {
        columns: 3 220px;
    }
}

@media (max-width: 760px) {
    body.gallery-page .container,
    body.gallery-page main.container.gallery-content {
        width: min(100% - 32px, 680px);
    }

    body.gallery-page .gallery-hero,
    body.gallery-page .gallery-hero__inner {
        min-height: 390px;
    }

    body.gallery-page .gallery-hero__overlay {
        background: linear-gradient(0deg, rgba(18, 8, 10, 0.9) 0%, rgba(18, 8, 10, 0.7) 58%, rgba(18, 8, 10, 0.28) 100%);
    }

    body.gallery-page .gallery-hero__inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 16px;
        padding-top: 22px;
        padding-bottom: 24px;
    }

    body.gallery-page .gallery-back {
        grid-column: 1;
    }

    body.gallery-page .gallery-hero__content {
        align-self: end;
    }

    body.gallery-page .gallery-hero h1 {
        font-size: 40px;
    }

    body.gallery-page .gallery-hero p.gallery-hero__intro {
        margin-top: 10px;
        font-size: 0.92rem;
    }

    body.gallery-page .gallery-hero__stats {
        margin-top: 18px;
    }

    body.gallery-page .gallery-content {
        padding-top: 38px;
        padding-bottom: 54px;
    }

    body.gallery-page .gallery-collection__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    body.gallery-page .gallery-collection__heading h2 {
        font-size: 28px;
    }

    body.gallery-page .gallery-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        overflow: hidden;
    }

    body.gallery-page .gallery-toolbar__label {
        padding-left: 2px;
    }

    body.gallery-page .gallery-filters {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    body.gallery-page .gallery-filters::-webkit-scrollbar {
        display: none;
    }

    body.gallery-page .gallery-filter {
        flex: 0 0 auto;
    }

    body.gallery-page .gallery-masonry {
        columns: 2 150px;
        column-gap: 10px;
    }

    body.gallery-page .gallery-card {
        margin-bottom: 10px;
    }

    body.gallery-page .gallery-card__caption {
        padding: 32px 10px 9px;
    }

    body.gallery-page .gallery-card__caption strong {
        font-size: 0.8rem;
    }

    body.gallery-page .gallery-card__open {
        width: 32px;
        height: 32px;
        opacity: 1;
        transform: none;
    }

    body.gallery-page .gallery-lightbox {
        padding: 12px;
    }

    body.gallery-page .gallery-lightbox__dialog {
        width: 100%;
        max-height: calc(100dvh - 24px);
    }

    body.gallery-page .gallery-lightbox__image-wrap {
        min-height: 52vh;
        max-height: calc(100dvh - 92px);
    }

    body.gallery-page .gallery-lightbox__image-wrap img {
        max-height: calc(100dvh - 92px);
    }

    body.gallery-page .gallery-lightbox__nav {
        width: 40px;
        height: 40px;
    }

    body.gallery-page .gallery-lightbox__close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    body.gallery-page .gallery-hero,
    body.gallery-page .gallery-hero__inner {
        min-height: 410px;
    }

    body.gallery-page .gallery-hero h1 {
        font-size: 34px;
    }

    body.gallery-page .gallery-kicker {
        margin-bottom: 9px;
    }

    body.gallery-page .gallery-stat {
        min-width: auto;
        padding: 0 12px;
    }

    body.gallery-page .gallery-stat dd {
        font-size: 1.25rem;
    }

    body.gallery-page .gallery-stat dt {
        font-size: 0.7rem;
    }

    body.gallery-page .gallery-collection__heading h2 {
        font-size: 25px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.gallery-page .gallery-card__figure,
    body.gallery-page .gallery-card__media img,
    body.gallery-page .gallery-card__open,
    body.gallery-page .gallery-lightbox,
    body.gallery-page .gallery-lightbox__dialog {
        transition: none;
    }
}
