.gallery-page-hero {
    position: relative;
    display: flex;
    min-height: 590px;
    align-items: center;
    overflow: hidden;
    color: var(--white);
}

.gallery-page-hero-image,
.gallery-page-hero-overlay {
    position: absolute;
    inset: 0;
}

.gallery-page-hero-image {
    height: 100%;
    object-fit: cover;
    object-position: center 58%;
}

.gallery-page-hero-overlay {
    background:
        linear-gradient(
            90deg,
            rgba(14, 16, 15, 0.96) 0%,
            rgba(14, 16, 15, 0.84) 43%,
            rgba(14, 16, 15, 0.32) 78%,
            rgba(14, 16, 15, 0.15) 100%
        ),
        linear-gradient(0deg, rgba(14, 16, 15, 0.34), transparent 50%);
}

.gallery-page-hero-content {
    position: relative;
    z-index: 2;
    padding-top: 135px;
    padding-bottom: 70px;
}

.gallery-page-hero h1 {
    max-width: 820px;
    margin: 18px 0 23px;
    font-size: clamp(3.6rem, 6.5vw, 6.4rem);
    font-weight: 950;
    letter-spacing: -0.075em;
    line-height: 0.93;
}

.gallery-page-hero h1 span {
    display: block;
    color: var(--gold-light);
}

.gallery-page-hero p {
    max-width: 700px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.02rem;
    line-height: 1.8;
}

.gallery-page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 32px;
}

.gallery-trust-strip {
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

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

.gallery-trust-grid span {
    padding: 19px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
}

.gallery-trust-grid span + span {
    border-left: 1px solid var(--border);
}

.project-gallery-section {
    padding: 90px 0 105px;
    background: var(--off-white);
}

.project-gallery-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.65fr);
    align-items: end;
    gap: 70px;
}

.project-gallery-heading h2 {
    max-width: 760px;
    margin: 11px 0 0;
    font-size: clamp(2.55rem, 4.4vw, 4.3rem);
    font-weight: 950;
    letter-spacing: -0.065em;
    line-height: 0.98;
}

.project-gallery-heading-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.75;
}

.project-gallery-heading-copy strong {
    display: block;
    margin-top: 14px;
    color: #936918;
    font-size: 0.74rem;
    font-weight: 900;
}

.gallery-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 38px 0 25px;
}

.gallery-filter {
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 850;
    cursor: pointer;
    transition:
        border-color 150ms ease,
        background-color 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.gallery-filter:hover,
.gallery-filter:focus-visible {
    border-color: var(--gold);
    color: var(--text);
    transform: translateY(-1px);
}

.gallery-filter.active {
    border-color: var(--charcoal);
    background: var(--charcoal);
    color: var(--white);
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: dense;
    grid-auto-rows: 180px;
    gap: 14px;
}

.project-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 11px;
    background: var(--charcoal);
    box-shadow: 0 10px 28px rgba(17, 19, 18, 0.08);
    cursor: pointer;
    text-align: left;
}

.project-card-wide {
    grid-column: span 2;
}

.project-card-tall {
    grid-row: span 2;
}

.project-card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        filter 220ms ease,
        transform 250ms ease;
}

.project-card::after {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to top,
            rgba(9, 11, 10, 0.88) 0%,
            rgba(9, 11, 10, 0.15) 58%,
            transparent 100%
        );
    content: "";
    transition: background-color 180ms ease;
}

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

.project-card:hover::after,
.project-card:focus-visible::after {
    background-color: rgba(0, 0, 0, 0.09);
}

.project-card-overlay {
    position: absolute;
    z-index: 2;
    right: 18px;
    bottom: 17px;
    left: 18px;
    display: flex;
    flex-direction: column;
    color: var(--white);
}

.project-card-overlay small {
    color: var(--gold-light);
    font-size: 0.63rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-card-overlay strong {
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 950;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.project-card[hidden] {
    display: none;
}

.gallery-lightbox {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 70px;
    align-items: center;
    padding: 35px;
    background: rgba(8, 10, 9, 0.96);
    backdrop-filter: blur(12px);
}

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

.lightbox-content {
    width: min(100%, 1180px);
    max-height: calc(100vh - 70px);
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: var(--black);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.lightbox-image-wrapper {
    display: flex;
    height: min(72vh, 760px);
    align-items: center;
    justify-content: center;
    background: #080a09;
}

.lightbox-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-caption {
    padding: 21px 24px 23px;
    color: var(--white);
}

.lightbox-caption h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 950;
    letter-spacing: -0.035em;
}

.lightbox-caption p {
    margin: 7px 0 0;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.75rem;
    line-height: 1.65;
}

.lightbox-close,
.lightbox-navigation {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
    color: var(--white);
    cursor: pointer;
    transition:
        background-color 150ms ease,
        border-color 150ms ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-navigation:hover,
.lightbox-navigation:focus-visible {
    border-color: var(--gold-light);
    background: rgba(255, 255, 255, 0.13);
}

.lightbox-close {
    position: fixed;
    z-index: 2;
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.7rem;
    line-height: 1;
}

.lightbox-navigation {
    width: 50px;
    height: 70px;
    border-radius: 9px;
    font-size: 2.2rem;
    line-height: 1;
}

.lightbox-previous {
    justify-self: start;
}

.lightbox-next {
    justify-self: end;
}

body.lightbox-open {
    overflow: hidden;
}

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

@media (max-width: 820px) {
    .gallery-page-hero {
        min-height: 570px;
    }

    .gallery-page-hero-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(14, 16, 15, 0.94),
                rgba(14, 16, 15, 0.66)
            ),
            linear-gradient(0deg, rgba(14, 16, 15, 0.4), transparent);
    }

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

    .gallery-trust-grid span:nth-child(3),
    .gallery-trust-grid span:nth-child(4) {
        border-top: 1px solid var(--border);
    }

    .gallery-trust-grid span:nth-child(3) {
        border-left: 0;
    }

    .project-gallery-heading {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .project-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 210px;
    }

    .gallery-lightbox {
        grid-template-columns: 52px minmax(0, 1fr) 52px;
        padding: 22px 12px;
    }

    .lightbox-navigation {
        width: 42px;
        height: 60px;
    }
}

@media (max-width: 580px) {
    .gallery-page-hero {
        min-height: 610px;
    }

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

    .gallery-page-hero-content {
        padding-top: 120px;
        padding-bottom: 55px;
    }

    .gallery-page-hero h1 {
        font-size: clamp(3.1rem, 15vw, 4.35rem);
    }

    .gallery-page-hero p {
        font-size: 0.91rem;
    }

    .gallery-page-hero-actions {
        flex-direction: column;
    }

    .gallery-page-hero-actions .button {
        width: 100%;
    }

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

    .gallery-trust-grid span {
        padding: 14px;
    }

    .gallery-trust-grid span + span,
    .gallery-trust-grid span:nth-child(3),
    .gallery-trust-grid span:nth-child(4) {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .project-gallery-section {
        padding: 68px 0 82px;
    }

    .project-gallery-heading h2 {
        font-size: clamp(2.3rem, 11vw, 3.15rem);
    }

    .gallery-filter-bar {
        flex-wrap: nowrap;
        margin-right: -14px;
        padding-right: 14px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .gallery-filter-bar::-webkit-scrollbar {
        display: none;
    }

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

    .project-gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: 270px;
    }

    .project-card,
    .project-card-wide,
    .project-card-tall,
    .project-card-large {
        grid-column: auto;
        grid-row: auto;
    }

    .gallery-lightbox {
        display: flex;
        align-items: center;
        padding: 64px 12px 82px;
    }

    .lightbox-content {
        max-height: calc(100vh - 146px);
    }

    .lightbox-image-wrapper {
        height: min(63vh, 560px);
    }

    .lightbox-navigation {
        position: fixed;
        bottom: 15px;
        width: calc(50% - 21px);
        height: 52px;
    }

    .lightbox-previous {
        left: 14px;
    }

    .lightbox-next {
        right: 14px;
    }

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