/* =========================================================
   Gallery page
   ========================================================= */

.gallery-page {
    --gallery-toolbar-top: calc(var(--navbar-height) - 1px);
    --gallery-gap: 12px;

    background: #f4f3ef;
    color: #111111;
}

.gallery-shell {
    width: min(
        calc(100% - 80px),
        1480px
    );

    margin: 0 auto;
}


/* =========================================================
   Hero
   ========================================================= */

.gallery-hero {
    padding:
        clamp(145px, 14vw, 220px)
        0
        clamp(78px, 9vw, 135px);

    background: #111111;
    color: #ffffff;
}

.gallery-kicker {
    display: block;

    margin-bottom: 24px;

    color: #d0a74a;

    font-size: 0.76rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.gallery-hero-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(280px, 0.45fr);

    gap: clamp(
        44px,
        8vw,
        120px
    );

    align-items: end;
}

.gallery-hero h1 {
    max-width: 930px;

    margin: 0;

    font-size: clamp(
        3.5rem,
        7.2vw,
        7.5rem
    );

    line-height: 0.91;
    font-weight: 500;
    letter-spacing: -0.075em;
}

.gallery-hero-copy {
    padding-bottom: 8px;
}

.gallery-hero-copy p {
    margin: 0 0 30px;

    color:
        rgba(
            255,
            255,
            255,
            0.66
        );

    font-size: clamp(
        1rem,
        1.2vw,
        1.18rem
    );

    line-height: 1.65;
}

.gallery-jump {
    display: inline-flex;
    align-items: center;

    gap: 12px;

    color: #ffffff;

    font-weight: 650;
    text-decoration: none;

    transition:
        gap 0.25s ease,
        opacity 0.25s ease;
}

.gallery-jump:hover {
    gap: 18px;
    color: #ffffff;
}


/* =========================================================
   Gallery browser
   ========================================================= */

.gallery-browser {
    padding-bottom: clamp(
        110px,
        11vw,
        170px
    );
}

.gallery-toolbar-region {
    position: sticky;
    z-index: 100;

    top: var(
        --gallery-toolbar-top
    );

    background:
        rgba(
            244,
            243,
            239,
            0.94
        );

    border-bottom:
        1px solid
        rgba(
            17,
            17,
            17,
            0.12
        );

    box-shadow:
        0 10px 30px
        rgba(
            17,
            17,
            17,
            0.035
        );

    -webkit-backdrop-filter:
        blur(18px);

    backdrop-filter:
        blur(18px);
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 88px;

    gap: 30px;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;
}

.gallery-filter {
    appearance: none;

    padding:
        10px
        16px;

    border:
        1px solid
        rgba(
            17,
            17,
            17,
            0.14
        );

    border-radius: 999px;

    background:
        rgba(
            255,
            255,
            255,
            0.28
        );

    color: #5e5e5e;

    font: inherit;
    font-size: 0.81rem;
    line-height: 1;
    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.gallery-filter:hover {
    border-color: #111111;
    color: #111111;

    transform:
        translateY(-1px);
}

.gallery-filter.is-active {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}

.gallery-count {
    flex: 0 0 auto;

    margin: 0;

    color: #777777;

    font-size: 0.82rem;
    white-space: nowrap;
}

.gallery-content {
    padding-top: clamp(
        28px,
        3.5vw,
        50px
    );
}


/* =========================================================
   Gallery flow
   ========================================================= */

.work-grid {
    display: flex;
    flex-direction: column;

    gap: clamp(
        12px,
        1.2vw,
        18px
    );
}


/* =========================================================
   Five-image mosaic cluster
   ========================================================= */

.work-cluster {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: var(--gallery-gap);

    width: 100%;
}

.work-cluster-small {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    grid-template-rows:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: var(--gallery-gap);

    min-width: 0;
}

.work-cluster--incomplete {
    grid-template-columns: 1fr;
}

.work-cluster--incomplete
.work-cluster-small {
    width: 50%;
}


/* =========================================================
   Cards
   ========================================================= */

.work-card {
    min-width: 0;
}

.work-card--standard {
    aspect-ratio: 1 / 1;
}

.work-card--large {
    aspect-ratio: 1 / 1;
}

.work-card--hero {
    width: 100%;

    aspect-ratio: 21 / 8;
}

.work-card-open {
    display: block;

    width: 100%;
    height: 100%;

    padding: 0;

    border: 0;

    background: transparent;
    color: inherit;

    text-align: left;

    cursor: zoom-in;
}

.work-card-media {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    margin: 0;

    background: #d7d6d1;
}

.work-card-media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transform: scale(1.001);

    transition:
        transform
        0.7s
        cubic-bezier(
            0.22,
            1,
            0.36,
            1
        );
}

.work-card-open:hover
.work-card-media img,
.work-card-open:focus-visible
.work-card-media img {
    transform: scale(1.035);
}


/* =========================================================
   Full-width hero row
   ========================================================= */

.work-hero-row {
    width: 100%;

    margin:
        clamp(10px, 1.8vw, 24px)
        0;
}


/* =========================================================
   Image gradient
   ========================================================= */

.work-card-media::after {
    content: "";

    position: absolute;
    z-index: 1;

    inset: 0;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0) 52%,
            rgba(0, 0, 0, 0.08) 70%,
            rgba(0, 0, 0, 0.62) 100%
        );

    opacity: 1;

    pointer-events: none;

    transition:
        opacity 0.25s ease;
}


/* =========================================================
   Card overlay
   ========================================================= */

.work-card-overlay {
    position: absolute;
    z-index: 2;

    inset:
        auto
        0
        0;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 12px;

    padding: 14px;

    color: #ffffff;
}

.work-card-overlay-content {
    min-width: 0;
}

.work-card-title {
    max-width: 92%;

    margin: 0;

    color: #ffffff;

    font-size: clamp(
        0.82rem,
        0.9vw,
        1rem
    );

    line-height: 1.15;
    font-weight: 550;
    letter-spacing: -0.025em;

    text-shadow:
        0 2px 14px
        rgba(
            0,
            0,
            0,
            0.48
        );
}

.work-card-description,
.work-tags {
    display: none;
}


/* =========================================================
   Large square card text
   ========================================================= */

.work-card--large
.work-card-overlay {
    padding: clamp(
        22px,
        3vw,
        44px
    );
}

.work-card--large
.work-card-title {
    max-width: 680px;

    font-size: clamp(
        1.5rem,
        2.7vw,
        3.3rem
    );

    line-height: 0.99;
    letter-spacing: -0.05em;
}

.work-card--large
.work-card-description {
    display: block;

    max-width: 570px;

    margin:
        10px
        0
        0;

    color:
        rgba(
            255,
            255,
            255,
            0.72
        );

    font-size: clamp(
        0.84rem,
        1vw,
        1rem
    );

    line-height: 1.45;
}

.work-card--large
.work-tags {
    display: flex;
}


/* =========================================================
   Full-width hero text
   ========================================================= */

.work-card--hero
.work-card-overlay {
    padding: clamp(
        26px,
        4vw,
        58px
    );
}

.work-card--hero
.work-card-title {
    max-width: 900px;

    font-size: clamp(
        2rem,
        4.5vw,
        5rem
    );

    line-height: 0.94;
    letter-spacing: -0.065em;
}

.work-card--hero
.work-card-description {
    display: block;

    max-width: 720px;

    margin:
        14px
        0
        0;

    color:
        rgba(
            255,
            255,
            255,
            0.74
        );

    font-size: clamp(
        0.9rem,
        1.2vw,
        1.1rem
    );

    line-height: 1.5;
}

.work-card--hero
.work-tags {
    display: flex;
}


/* =========================================================
   Tags
   ========================================================= */

.work-tags {
    flex-wrap: wrap;

    gap: 6px;

    margin-bottom: 10px;
}

.work-tags span {
    padding:
        5px
        8px;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.28
        );

    border-radius: 999px;

    background:
        rgba(
            0,
            0,
            0,
            0.16
        );

    color:
        rgba(
            255,
            255,
            255,
            0.9
        );

    font-size: 0.54rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;

    -webkit-backdrop-filter:
        blur(6px);

    backdrop-filter:
        blur(6px);
}


/* =========================================================
   Open icon
   ========================================================= */

.work-card-icon {
    display: grid;
    flex: 0 0 auto;

    place-items: center;

    width: 31px;
    height: 31px;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.35
        );

    border-radius: 50%;

    background:
        rgba(
            0,
            0,
            0,
            0.14
        );

    color: #ffffff;

    font-size: 0.66rem;

    opacity: 0;

    transform:
        translateY(5px);

    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        background 0.22s ease,
        color 0.22s ease;

    -webkit-backdrop-filter:
        blur(6px);

    backdrop-filter:
        blur(6px);
}

.work-card-open:hover
.work-card-icon,
.work-card-open:focus-visible
.work-card-icon {
    opacity: 1;

    transform:
        translateY(0);

    background: #ffffff;
    color: #111111;
}

.work-card--large
.work-card-icon,
.work-card--hero
.work-card-icon {
    opacity: 1;
    transform: none;
}

/* Small-card text and full-image icon always visible */

.work-card--standard .work-card-overlay {
    opacity: 1;
    transform: none;
}

.work-card--standard .work-card-media::after {
    opacity: 1;
}

.work-card--standard .work-card-icon {
    opacity: 1;
    transform: none;
}

.work-card-open:hover .work-card-icon,
.work-card-open:focus-visible .work-card-icon {
    background: #ffffff;
    color: #111111;
}


/* =========================================================
   Focus
   ========================================================= */

.work-card-open:focus-visible {
    outline:
        3px solid
        #d0a74a;

    outline-offset: 4px;
}


/* =========================================================
   Loading and empty states
   ========================================================= */

.gallery-loading,
.gallery-error,
.gallery-empty {
    padding:
        90px
        0;

    color: #777777;

    text-align: center;
}

.gallery-error {
    color: #8b2f2f;
}


/* =========================================================
   Lightbox
   ========================================================= */

.gallery-lightbox {
    position: fixed;
    z-index: 3000;

    inset: 0;

    display: grid;
    place-items: center;

    padding: 70px;

    background:
        rgba(
            8,
            8,
            8,
            0.95
        );

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.28s ease,
        visibility 0.28s ease;
}

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

.lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(
        100%,
        1500px
    );

    max-height:
        calc(
            100vh - 110px
        );
}

.lightbox-inner img {
    display: block;

    max-width: 100%;

    max-height:
        calc(
            100vh - 190px
        );

    object-fit: contain;
}

.lightbox-caption {
    width: 100%;

    padding-top: 18px;

    color: #ffffff;
}

.lightbox-caption h2 {
    margin:
        0
        0
        4px;

    font-size: 1.15rem;
    font-weight: 550;
}

.lightbox-caption p {
    margin: 0;

    color:
        rgba(
            255,
            255,
            255,
            0.55
        );

    font-size: 0.84rem;
}

.lightbox-close {
    position: absolute;

    top: 24px;
    right: 28px;

    display: grid;
    place-items: center;

    width: 45px;
    height: 45px;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.25
        );

    border-radius: 50%;

    background:
        rgba(
            255,
            255,
            255,
            0.06
        );

    color: #ffffff;

    font-size: 1rem;

    cursor: pointer;
}

body.lightbox-open {
    overflow: hidden;
}


/* =========================================================
   Tablet
   ========================================================= */

@media
(max-width: 991.98px) {

    .gallery-page {
        --gallery-toolbar-top: 64px;
        --gallery-gap: 10px;
    }

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

    .gallery-hero-copy {
        max-width: 520px;
    }

    .gallery-toolbar {
        min-height: 80px;
    }

    .gallery-count {
        display: none;
    }

    .work-card--large
    .work-card-overlay {
        padding: 22px;
    }

    .work-card--large
    .work-card-title {
        font-size: clamp(
            1.35rem,
            3.4vw,
            2.4rem
        );
    }

    .work-card--large
    .work-card-description {
        display: none;
    }

    .work-card--large
    .work-tags {
        display: none;
    }

    .work-card--hero {
        aspect-ratio: 16 / 7;
    }

}


/* =========================================================
   Mobile
   ========================================================= */

@media
(max-width: 767.98px) {

    .gallery-page {
        --gallery-toolbar-top: 60px;
        --gallery-gap: 8px;
    }

    .gallery-shell {
        width: min(
            calc(100% - 30px),
            1480px
        );
    }

    .gallery-hero {
        padding:
            125px
            0
            78px;
    }

    .gallery-hero h1 {
        font-size: clamp(
            3.15rem,
            16vw,
            5.2rem
        );
    }

    .gallery-toolbar {
        min-height: 72px;
    }

    .gallery-filters {
        width: 100%;

        flex-wrap: nowrap;

        overflow-x: auto;
        overscroll-behavior-inline:
            contain;

        padding:
            8px
            0;

        scrollbar-width: none;
    }

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

    .gallery-filter {
        flex: 0 0 auto;

        padding:
            10px
            15px;
    }

    .gallery-content {
        padding-top: 18px;
    }

    /*
     * Keep the 4-small + 1-large concept,
     * but stack the two halves vertically.
     */
    .work-cluster {
        grid-template-columns: 1fr;
    }

    .work-cluster--large-left
    .work-card--large {
        order: 2;
    }

    .work-cluster--large-left
    .work-cluster-small {
        order: 1;
    }

    .work-cluster--incomplete
    .work-cluster-small {
        width: 100%;
    }

    .work-card--large {
        aspect-ratio: 4 / 3;
    }

    .work-card--large
    .work-card-overlay {
        padding: 18px;
    }

    .work-card--large
    .work-card-title {
        font-size: clamp(
            1.3rem,
            5.5vw,
            2rem
        );
    }

    .work-card--hero {
        aspect-ratio: 4 / 3;
    }

    .work-card--hero
    .work-card-overlay {
        padding: 20px;
    }

    .work-card--hero
    .work-card-title {
        font-size: clamp(
            1.55rem,
            7vw,
            2.5rem
        );
    }

    .work-card--hero
    .work-card-description {
        display: none;
    }

    .work-card--hero
    .work-tags {
        display: none;
    }

    .work-card-overlay {
        padding: 10px;
    }

    .work-card-title {
        max-width: 100%;

        font-size: 0.76rem;
        line-height: 1.12;
    }

    .work-card-icon {
        display: none;
    }

    .gallery-lightbox {
        padding:
            60px
            18px
            30px;
    }

    .lightbox-close {
        top: 14px;
        right: 14px;
    }

}


/* =========================================================
   Small phones
   ========================================================= */

@media
(max-width: 479.98px) {

    .gallery-shell {
        width: min(
            calc(100% - 24px),
            1480px
        );
    }

    /*
     * Keep two small images per row.
     * The small text is hidden to prevent clutter.
     */
    .work-card--standard
    .work-card-overlay,

    .work-card--standard
    .work-card-media::after {
        display: none;
    }

    .work-card--large {
        aspect-ratio: 1 / 1;
    }

    .work-card--hero {
        aspect-ratio: 1 / 1;
    }

}


/* =========================================================
   Reduced motion
   ========================================================= */

@media
(prefers-reduced-motion: reduce) {

    .work-card-media img,
    .work-card-media::after,
    .work-card-overlay,
    .gallery-lightbox,
    .gallery-filter,
    .work-card-icon {
        transition: none;
    }

}

/* =========================================================
   Lightbox previous / next buttons
   ========================================================= */

.lightbox-nav {
    position: absolute;
    z-index: 4;

    top: 50%;

    display: grid;
    place-items: center;

    width: 52px;
    height: 52px;

    padding: 0;

    border:
        1px solid
        rgba(255, 255, 255, 0.28);

    border-radius: 50%;

    background:
        rgba(10, 10, 10, 0.42);

    color: #ffffff;

    font-size: 1.25rem;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;

    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.lightbox-nav--previous {
    left: 24px;
}

.lightbox-nav--next {
    right: 24px;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
    color: #111111;
}

.lightbox-nav:focus-visible {
    outline:
        3px solid
        #d0a74a;

    outline-offset: 4px;
}

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


/* =========================================================
   Mobile lightbox navigation
   ========================================================= */

@media
(max-width: 767.98px) {

    .lightbox-nav {
        width: 42px;
        height: 42px;

        font-size: 1rem;

        background:
            rgba(10, 10, 10, 0.58);
    }

    .lightbox-nav--previous {
        left: 8px;
    }

    .lightbox-nav--next {
        right: 8px;
    }

}

/* =========================================================
   Lightbox image transition
   ========================================================= */

.lightbox-image-wrapper {
    position: relative;

    overflow: hidden;
}

#lightbox-image {
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

#lightbox-image.is-changing {
    opacity: 0;
    transform: scale(0.985);
}
/* =========================================================
   Direct JSON-driven gallery grid
   display: standard | large | hero
   ========================================================= */

.work-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: var(--gallery-gap);
    width: 100%;
}

.work-card,
.work-card-open,
.work-card-media {
    width: 100%;
    min-width: 0;
}

.work-card {
    align-self: stretch;
}

.work-card--standard {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1 / 1;
}

.work-card--large {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: 1 / 1;
}

.work-card--hero {
    grid-column: 1 / -1;
    grid-row: span 1;
    width: 100%;
    aspect-ratio: 21 / 8;
}

.work-card-open {
    height: 100%;
}

.work-card-media {
    height: 100%;
}

.work-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 991.98px) {
    .work-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: dense;
    }

    .work-card--standard {
        grid-column: span 1;
        grid-row: span 1;
        aspect-ratio: 1 / 1;
    }

    .work-card--large {
        grid-column: span 2;
        grid-row: span 1;
        aspect-ratio: 16 / 10;
    }

    .work-card--hero {
        grid-column: 1 / -1;
        grid-row: span 1;
        aspect-ratio: 16 / 8;
    }
}

@media (max-width: 575.98px) {
    .work-grid {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
        gap: 12px;
    }

    .work-card--standard,
    .work-card--large,
    .work-card--hero {
        grid-column: 1;
        grid-row: auto;
    }

    .work-card--standard {
        aspect-ratio: 1 / 1;
    }

    .work-card--large {
        aspect-ratio: 4 / 3;
    }

    .work-card--hero {
        aspect-ratio: 16 / 9;
    }
}


/* =========================================================
   Premium cinematic gallery hero
   ========================================================= */

.gallery-hero--premium {
    position: relative;
    isolation: isolate;
    min-height: clamp(620px, 78vh, 900px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding:
        clamp(150px, 15vw, 220px)
        0
        clamp(84px, 8vw, 128px);
    background: #0b0c0d;
}

.gallery-hero-backdrop {
    position: absolute;
    z-index: -2;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 72% 42%,
            rgba(208, 167, 74, 0.14),
            transparent 34%
        ),
        #0b0c0d;
}

.gallery-hero-image {
    position: absolute;
    inset: -3%;
    width: 106%;
    height: 106%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transform: scale(1.035);
    filter:
        saturate(0.74)
        contrast(1.06)
        brightness(0.78);
    transition:
        opacity 1100ms ease,
        transform 10s ease;
}

.gallery-hero-image.is-active {
    opacity: 1;
    transform: scale(1);
}

.gallery-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(5, 6, 7, 0.96) 0%,
            rgba(5, 6, 7, 0.83) 35%,
            rgba(5, 6, 7, 0.42) 63%,
            rgba(5, 6, 7, 0.18) 100%
        ),
        linear-gradient(
            180deg,
            rgba(5, 6, 7, 0.24) 0%,
            rgba(5, 6, 7, 0.04) 42%,
            rgba(5, 6, 7, 0.72) 100%
        );
}

.gallery-hero-grid-texture {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px
        );
    background-size: 72px 72px;
    mask-image:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.9),
            transparent 78%
        );
    pointer-events: none;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
    width: 95%;
}

.gallery-hero--premium .gallery-hero-grid {
    grid-template-columns:
        minmax(0, 1.45fr)
        minmax(280px, 0.55fr);
}

.gallery-hero-heading {
    min-width: 0;
}

.gallery-hero--premium h1 {
    max-width: 860px;
    text-shadow:
        0 10px 40px rgba(0, 0, 0, 0.38);
}

.gallery-hero-feature-label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: clamp(30px, 4vw, 52px);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.76rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-hero-feature-index {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border:
        1px solid
        rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    color: #d0a74a;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
}

.gallery-hero--premium .gallery-hero-copy {
    padding-bottom: 2px;
}

.gallery-hero--premium .gallery-hero-copy p {
    color: rgba(255, 255, 255, 0.76);
    text-shadow:
        0 4px 22px rgba(0, 0, 0, 0.45);
}

@media (max-width: 991.98px) {
    .gallery-hero--premium {
        min-height: 700px;
    }

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

    .gallery-hero-shade {
        background:
            linear-gradient(
                180deg,
                rgba(5, 6, 7, 0.50) 0%,
                rgba(5, 6, 7, 0.58) 42%,
                rgba(5, 6, 7, 0.96) 100%
            );
    }

    .gallery-hero-image {
        object-position: 64% center;
    }
}

@media (max-width: 767.98px) {
    .gallery-hero--premium {
        min-height: 680px;
        padding:
            128px
            0
            72px;
    }

    .gallery-hero--premium h1 {
        font-size: clamp(
            3.2rem,
            15vw,
            5.3rem
        );
    }

    .gallery-hero-image {
        inset: 0;
        width: 100%;
        height: 100%;
        object-position: center;
    }

    .gallery-hero-grid-texture {
        background-size: 48px 48px;
        opacity: 0.08;
    }

    .gallery-hero-feature-label {
        margin-top: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-hero-image {
        transition: none;
        transform: none;
    }
}

/* =========================================================
   Gallery category transition
   ========================================================= */

.work-grid {
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.work-grid.is-filtering-out {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.work-grid.is-filtering-in .work-card {
    opacity: 0;
    transform:
        translateY(18px)
        scale(0.992);

    transition:
        opacity 420ms
        cubic-bezier(0.22, 1, 0.36, 1)
        var(--gallery-card-delay, 0ms),

        transform 420ms
        cubic-bezier(0.22, 1, 0.36, 1)
        var(--gallery-card-delay, 0ms);
}

.work-grid.is-filtering-in.is-filtering-visible
.work-card {
    opacity: 1;
    transform:
        translateY(0)
        scale(1);
}

.gallery-filter:disabled {
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {

    .work-grid,
    .work-grid.is-filtering-in .work-card {
        transition: none;
    }

    .work-grid.is-filtering-out,
    .work-grid.is-filtering-in .work-card {
        opacity: 1;
        transform: none;
    }

}

/* =========================================================
   Portrait phone gallery
   ========================================================= */

@media
(max-width: 575.98px)
and (orientation: portrait) {

    /* -----------------------------------------------------
       Show every category button without horizontal scrolling
       ----------------------------------------------------- */

    .gallery-filters {
        display: flex;
        flex-wrap: wrap;

        width: 100%;
        gap: 7px;

        overflow: visible;
        padding: 10px 0;

        scrollbar-width: auto;
    }

    .gallery-filters::-webkit-scrollbar {
        display: initial;
    }

    .gallery-filter {
        flex: 0 0 auto;

        padding:
            9px
            12px;

        font-size: 0.74rem;
        white-space: nowrap;
    }


    /* -----------------------------------------------------
       Keep every gallery image the same size
       ----------------------------------------------------- */

    .work-card--standard,
    .work-card--large,
    .work-card--hero {
        aspect-ratio: 1 / 1;
    }


    /* -----------------------------------------------------
       Show title overlay on every image
       ----------------------------------------------------- */

    .work-card--standard .work-card-overlay,
    .work-card--large .work-card-overlay,
    .work-card--hero .work-card-overlay {
        display: flex;

        opacity: 1;
        transform: none;

        padding: 16px;
    }

    .work-card--standard .work-card-media::after,
    .work-card--large .work-card-media::after,
    .work-card--hero .work-card-media::after {
        display: block;
        opacity: 1;
    }

    .work-card--standard .work-card-title,
    .work-card--large .work-card-title,
    .work-card--hero .work-card-title {
        display: block;

        max-width: 100%;
        margin: 0;

        font-size: clamp(
            1rem,
            4.5vw,
            1.35rem
        );

        line-height: 1.1;
        letter-spacing: -0.03em;
    }


    /* Keep mobile cards clean */
    
    .work-card-description,
    .work-tags,
    .work-card-icon {
        display: none;
    }

}

