:root {
    --gallery-primary: var(--primary, #313131);
    --gallery-dark: var(--primary-light, #1d1e1f);
    --gallery-accent: var(--secondary, #dcec96);
    --gallery-surface: #ffffff;
    --gallery-soft: #f4f5f1;
    --gallery-border: rgba(30, 31, 31, 0.12);
    --gallery-muted: #636762;
    --gallery-shadow: 0 18px 48px rgba(22, 24, 22, 0.09);
}

.gallery-page {
    padding-bottom: 0 !important;
    background: var(--gallery-soft);
}

.gallery-page h1,
.gallery-page h2,
.gallery-page h3,
.gallery-page p {
    margin-top: 0;
}

.gallery-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(9.5rem, 14vw, 12rem) 0 clamp(3.5rem, 7vw, 6rem);
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(220, 236, 150, 0.2), transparent 28%),
        linear-gradient(120deg, #171817 0%, #2b2d2b 72%, #343734 100%);
}

.gallery-hero::after {
    position: absolute;
    right: -7rem;
    bottom: -12rem;
    width: 32rem;
    height: 32rem;
    border: 1px solid rgba(220, 236, 150, 0.2);
    border-radius: 50%;
    content: "";
}

.gallery-hero .container {
    position: relative;
    z-index: 1;
}

.gallery-kicker,
.gallery-section-kicker {
    margin-bottom: 0.65rem;
    color: var(--gallery-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gallery-hero h1 {
    max-width: 850px;
    margin-bottom: 1.25rem;
    font-size: clamp(2.7rem, 6vw, 5.3rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.gallery-hero-copy {
    max-width: 720px;
    margin-bottom: 1.75rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.7;
}

.gallery-hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.gallery-hero-points span {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    font-weight: 600;
}

.gallery-hero-points i {
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    color: #111;
    background: var(--gallery-accent);
    border-radius: 50%;
    font-size: 0.68rem;
}

.gallery-filter-section {
    position: relative;
    z-index: 2;
    margin-top: -2rem;
    padding-bottom: 3.5rem;
}

.gallery-filter-card {
    padding: clamp(1.35rem, 3vw, 2.5rem);
    background: var(--gallery-surface);
    border: 1px solid var(--gallery-border);
    box-shadow: var(--gallery-shadow);
}

.gallery-section-heading,
.gallery-results-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.gallery-section-heading {
    margin-bottom: 1.75rem;
}

.gallery-section-heading h2,
.gallery-results-heading h2,
.gallery-note-card h2 {
    margin-bottom: 0;
    color: var(--gallery-primary);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.15;
}

.gallery-section-heading .gallery-section-kicker,
.gallery-results-heading .gallery-section-kicker {
    color: #72786e;
}

.gallery-clear-button {
    padding: 0.4rem 0;
    color: var(--gallery-primary);
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--gallery-accent);
    font-weight: 700;
    cursor: pointer;
}

.gallery-clear-button:hover,
.gallery-clear-button:focus-visible {
    color: #000;
    border-color: var(--gallery-primary);
}

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

.gallery-field label,
.gallery-tags legend {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gallery-primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gallery-control,
.gallery-page select.gallery-control {
    width: 100%;
    min-height: 3.15rem;
    margin: 0;
    padding: 0.72rem 2.6rem 0.72rem 0.9rem;
    color: var(--gallery-primary);
    background-color: #fff;
    border: 1px solid #cfd2cc;
    border-radius: 0;
    box-shadow: none;
    font-size: 1rem;
    text-align: left;
}

input.gallery-control {
    padding-right: 0.9rem;
}

.gallery-control:focus {
    outline: 3px solid rgba(220, 236, 150, 0.42);
    border-color: #7e8f35;
}

.gallery-tags {
    margin: 1.5rem 0 0;
    padding: 0;
    border: 0;
}

.gallery-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.gallery-tag {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.gallery-tag input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.gallery-tag span {
    display: inline-flex;
    min-height: 2.45rem;
    align-items: center;
    padding: 0.5rem 0.85rem;
    color: #444842;
    background: #f5f6f3;
    border: 1px solid #dfe2db;
    font-size: 0.86rem;
    font-weight: 650;
    transition: 0.18s ease;
}

.gallery-tag:hover span {
    border-color: #9da78a;
}

.gallery-tag input:focus-visible + span {
    outline: 3px solid rgba(220, 236, 150, 0.55);
    outline-offset: 2px;
}

.gallery-tag input:checked + span {
    color: #111;
    background: var(--gallery-accent);
    border-color: var(--gallery-accent);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.gallery-filter-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gallery-border);
}

.gallery-filter-button,
.gallery-empty-button,
.gallery-card-cta {
    color: #111 !important;
    background: var(--gallery-accent) !important;
    border: 2px solid var(--gallery-accent) !important;
    font-weight: 800;
    text-decoration: none !important;
}

.gallery-filter-button {
    min-width: 12rem;
    padding: 0.8rem 1.2rem;
}

.gallery-filter-button i {
    margin-right: 0.45rem;
}

.gallery-filter-button:hover,
.gallery-empty-button:hover,
.gallery-card-cta:hover {
    color: #fff !important;
    background: var(--gallery-primary) !important;
    border-color: var(--gallery-primary) !important;
}

.gallery-filter-actions p {
    color: var(--gallery-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.gallery-results-section {
    padding: 1rem 0 4.5rem;
}

.gallery-results-heading {
    margin-bottom: 1.75rem;
}

.gallery-result-status {
    color: var(--gallery-muted);
    font-size: 0.9rem;
}

.gallery-type-notice {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border-left: 4px solid var(--gallery-accent);
}

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

.gallery-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--gallery-border);
    box-shadow: 0 12px 34px rgba(22, 24, 22, 0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 46px rgba(22, 24, 22, 0.12);
}

.gallery-card-image-link {
    position: relative;
    display: block;
    overflow: hidden;
    color: #fff;
    background: #1c1d1c;
    text-decoration: none;
}

.gallery-card-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.2s ease;
}

.gallery-card-image-link:hover .gallery-card-image img,
.gallery-card-image-link:focus-visible .gallery-card-image img {
    transform: scale(1.035);
    opacity: 0.82;
}

.gallery-card-view {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.7rem;
    color: #111;
    background: var(--gallery-accent);
    font-size: 0.78rem;
    font-weight: 800;
    opacity: 0;
    transform: translateY(8px);
    transition: 0.2s ease;
}

.gallery-card-image-link:hover .gallery-card-view,
.gallery-card-image-link:focus-visible .gallery-card-view {
    opacity: 1;
    transform: translateY(0);
}

.gallery-card-body {
    padding: 1.25rem;
}

.gallery-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.gallery-card-eyebrow,
.gallery-alt-label {
    margin-bottom: 0.3rem;
    color: #7a806f;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.gallery-card h3 {
    margin-bottom: 0;
    color: var(--gallery-primary);
    font-size: 1.25rem;
    line-height: 1.25;
}

.gallery-photo-ref {
    flex: 0 0 auto;
    padding: 0.35rem 0.5rem;
    color: #555a52;
    background: #f0f1ed;
    font-size: 0.72rem;
    font-weight: 700;
}

.gallery-card-specification {
    margin: 0.75rem 0 0;
    color: #444842;
    font-size: 0.92rem;
    font-weight: 700;
}

.gallery-card-description {
    margin: 0.65rem 0 0;
    color: var(--gallery-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.gallery-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gallery-border);
}

.gallery-card-date {
    color: var(--gallery-muted);
    font-size: 0.78rem;
}

.gallery-card-date i {
    margin-right: 0.35rem;
}

.gallery-card-cta {
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.gallery-alt-section {
    padding: 0 1.25rem 1.25rem;
}

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

.gallery-alt-link {
    position: relative;
    display: block;
    overflow: hidden;
    color: #fff;
    background: #222;
    text-decoration: none;
}

.gallery-alt-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.gallery-alt-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.88;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-alt-link:hover img,
.gallery-alt-link:focus-visible img {
    transform: scale(1.04);
    opacity: 1;
}

.gallery-alt-type {
    position: absolute;
    right: 0.4rem;
    bottom: 0.4rem;
    max-width: calc(100% - 0.8rem);
    padding: 0.28rem 0.4rem;
    overflow: hidden;
    background: rgba(20, 21, 20, 0.82);
    font-size: 0.67rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-pagination-wrap {
    display: flex;
    justify-content: center;
}

.gallery-pagination-top {
    margin-bottom: 1.5rem;
}

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

.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.gallery-page-numbers {
    display: flex;
    gap: 0.35rem;
}

.gallery-page-button {
    display: inline-flex;
    min-width: 2.6rem;
    min-height: 2.6rem;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    color: var(--gallery-primary);
    background: #fff;
    border: 1px solid #d6d9d2;
    font-weight: 750;
    cursor: pointer;
}

.gallery-page-button:hover:not(:disabled),
.gallery-page-button:focus-visible:not(:disabled) {
    background: var(--gallery-accent);
    border-color: var(--gallery-accent);
}

.gallery-page-button.is-current {
    color: #111;
    background: var(--gallery-accent);
    border-color: var(--gallery-accent);
}

.gallery-page-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.gallery-page-direction {
    padding-inline: 0.85rem;
}

.gallery-empty-state {
    padding: clamp(2rem, 6vw, 5rem) 1.5rem;
    text-align: center;
    background: #fff;
    border: 1px solid var(--gallery-border);
}

.gallery-empty-icon {
    display: grid;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    place-items: center;
    color: var(--gallery-primary);
    background: var(--gallery-accent);
    border-radius: 50%;
    font-size: 1.5rem;
}

.gallery-empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--gallery-primary);
}

.gallery-empty-state p {
    margin-bottom: 1.25rem;
    color: var(--gallery-muted);
}

.gallery-empty-button {
    padding: 0.7rem 1rem;
}

.gallery-loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: #fff;
    background: rgba(18, 19, 18, 0.76);
    font-weight: 700;
    backdrop-filter: blur(3px);
}

.gallery-loading[style*="display: block"] {
    display: flex !important;
}

.gallery-loading-spinner,
.gallery-lightbox-loader {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--gallery-accent);
    border-radius: 50%;
    animation: gallery-spin 0.75s linear infinite;
}

.gallery-note-section {
    padding: 0 0 5rem;
}

.gallery-note-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: var(--gallery-primary);
    color: #fff;
}

.gallery-note-card h2 {
    margin-bottom: 0.65rem;
    color: #fff;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.gallery-note-card p {
    max-width: 980px;
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.75;
}

.gallery-note-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    color: #111;
    background: var(--gallery-accent);
    border-radius: 50%;
}

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

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

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    grid-template-columns: minmax(3.5rem, 8vw) minmax(0, 1fr) minmax(3.5rem, 8vw);
    align-items: center;
    padding: 1rem;
    color: #fff;
    background: rgba(8, 9, 8, 0.97);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.gallery-lightbox.is-open {
    opacity: 1;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    z-index: 2;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: 0.18s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:hover,
.gallery-lightbox-nav:focus-visible {
    color: #111;
    background: var(--gallery-accent);
    border-color: var(--gallery-accent);
    outline: none;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    line-height: 1;
}

.gallery-lightbox-nav {
    width: 3.25rem;
    height: 4rem;
    justify-self: center;
    font-size: 1.6rem;
}

.gallery-lightbox-prev {
    grid-column: 1;
}

.gallery-lightbox-next {
    grid-column: 3;
}

.gallery-lightbox-figure {
    grid-column: 2;
    min-width: 0;
    margin: 0;
}

.gallery-lightbox-stage {
    position: relative;
    display: flex;
    height: min(78vh, 880px);
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.15s ease;
}

.gallery-lightbox.is-loading .gallery-lightbox-stage img {
    opacity: 0;
}

.gallery-lightbox-loader {
    position: absolute;
    display: none;
}

.gallery-lightbox.is-loading .gallery-lightbox-loader {
    display: block;
}

.gallery-lightbox-details {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    max-width: 1050px;
    margin: 0.9rem auto 0;
    padding: 0.75rem 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    line-height: 1.5;
}

.gallery-lightbox-count {
    color: var(--gallery-accent);
    font-weight: 800;
    white-space: nowrap;
}

@keyframes gallery-spin {
    to { transform: rotate(360deg); }
}

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

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

@media (max-width: 767px) {
    .gallery-hero {
        padding-top: 8rem;
    }

    .gallery-filter-section {
        margin-top: -1rem;
    }

    .gallery-section-heading,
    .gallery-results-heading,
    .gallery-filter-actions,
    .gallery-card-footer {
        align-items: stretch;
        flex-direction: column;
    }

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

    .gallery-filter-button,
    .gallery-card-cta {
        width: 100%;
        text-align: center;
    }

    .gallery-card-view {
        opacity: 1;
        transform: none;
    }

    .gallery-pagination {
        width: 100%;
        flex-wrap: wrap;
    }

    .gallery-page-direction {
        flex: 1 1 8rem;
    }

    .gallery-page-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
    }

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

    .gallery-lightbox {
        grid-template-columns: 1fr;
        padding: 4.5rem 0.75rem 5.5rem;
    }

    .gallery-lightbox-figure {
        grid-column: 1;
    }

    .gallery-lightbox-stage {
        height: 70vh;
    }

    .gallery-lightbox-nav {
        position: absolute;
        bottom: 1rem;
        width: 4rem;
        height: 3rem;
    }

    .gallery-lightbox-prev {
        left: calc(50% - 4.5rem);
    }

    .gallery-lightbox-next {
        right: calc(50% - 4.5rem);
    }

    .gallery-lightbox-details {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        text-align: center;
    }
}

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

    .gallery-card-body,
    .gallery-alt-section {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .gallery-card-heading {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card,
    .gallery-card-image img,
    .gallery-card-view,
    .gallery-alt-image img,
    .gallery-lightbox {
        transition: none;
    }

    .gallery-loading-spinner,
    .gallery-lightbox-loader {
        animation-duration: 1.5s;
    }
}
