.gallery-page {
    --gallery-navy: var(--navy, #0a2e5c);
    --gallery-gold: var(--gold, #d4a017);
    --gallery-light: #f7f9fc;
    --gallery-border: #e1e6ef;
    --gallery-text: #374151;
    --gallery-muted: #647084;
    --gallery-shadow: 0 14px 35px rgba(0, 31, 91, .11);
    color: var(--gallery-text);
}

.gallery-page *,
.gallery-page *::before,
.gallery-page *::after {
    box-sizing: border-box;
}

.gallery-hero {
    position: relative;
    min-height: 480px;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.25fr);
    overflow: hidden;
    background: var(--gallery-navy);
    border-bottom: 4px solid var(--gallery-gold);
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
    padding: 70px 7vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background: linear-gradient(115deg, rgba(0, 31, 91, 1), rgba(0, 31, 91, .78));
}

.gallery-hero-label,
.gallery-eyebrow,
.featured-story-eyebrow,
.gallery-clients-heading span,
.gallery-cta-inner > div > span {
    color: var(--gallery-gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.gallery-hero h1 {
    max-width: 620px;
    margin: 14px 0 20px;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 5vw, 4.6rem);
    line-height: 1.08;
}

.gallery-hero-line {
    width: 82px;
    height: 4px;
    margin-bottom: 24px;
    background: var(--gallery-gold);
    border-radius: 999px;
}

.gallery-hero p {
    max-width: 650px;
    margin: 0;
    color: #eef3ff;
    font-size: 17px;
    line-height: 1.85;
}

.gallery-hero-collage {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    grid-template-rows: 1fr 1fr;
    min-width: 0;
    min-height: 480px;
    background: #071b43;
}

.gallery-hero-image {
    position: relative;
    min-width: 0;
    margin: 0;
    overflow: hidden;
}

.gallery-hero-image-main {
    grid-row: 1 / 3;
}

.gallery-hero-image img,
.featured-story-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .7s ease;
}

.gallery-hero-image:hover img,
.featured-story-inner:hover .featured-story-image img {
    transform: scale(1.045);
}

.gallery-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 31, 91, .04), rgba(0, 31, 91, .25));
}

.featured-story {
    position: relative;
    padding: 85px 7%;
    overflow: hidden;
    background: #fff;
}

.featured-story::before {
    content: "";
    position: absolute;
    top: -170px;
    right: -170px;
    width: 390px;
    height: 390px;
    border: 65px solid rgba(212, 160, 23, .08);
    border-radius: 50%;
}

.featured-story-inner {
    position: relative;
    z-index: 1;
    width: min(100%, 1400px);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    overflow: hidden;
    background: var(--gallery-navy);
    border-radius: 20px;
    box-shadow: 0 22px 55px rgba(0, 31, 91, .18);
}

.featured-story-image {
    position: relative;
    min-height: 540px;
    overflow: hidden;
}

.featured-story-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 31, 91, .05) 45%, rgba(0, 31, 91, .48));
}

.featured-story-badge {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 2;
    padding: 9px 14px;
    color: #fff;
    background: var(--gallery-gold);
    border-radius: 25px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.featured-story-content {
    position: relative;
    padding: 65px 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.featured-story-content::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--gallery-gold);
}

.featured-story-client {
    margin: 14px 0 13px;
    color: #dce5f5;
    font-size: 15px;
    font-weight: 700;
}

.featured-story-content h2 {
    margin: 0 0 21px;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 3.3vw, 3.25rem);
    line-height: 1.18;
}

.featured-story-description {
    margin: 0 0 28px;
    color: #e8edf6;
    font-size: 15px;
    line-height: 1.85;
}

.featured-story-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, .16);
    border-left: 1px solid rgba(255, 255, 255, .16);
}

.featured-story-details li {
    padding: 17px 18px;
    border-right: 1px solid rgba(255, 255, 255, .16);
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.featured-story-details strong,
.gallery-lightbox-details strong {
    display: block;
    margin-bottom: 5px;
    color: var(--gallery-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.featured-story-details span {
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
}

.featured-story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.featured-story-button,
.featured-story-secondary,
.gallery-lightbox-project-link,
.gallery-cta-button {
    min-height: 48px;
    padding: 13px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}

.featured-story-button {
    color: #fff;
    background: var(--gallery-gold);
    border: 2px solid var(--gallery-gold);
}

.featured-story-secondary {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .45);
}

.featured-story-button:hover,
.featured-story-secondary:hover,
.gallery-lightbox-project-link:hover,
.gallery-cta-button:hover {
    transform: translateY(-2px);
}

.featured-story-button:hover {
    color: var(--gallery-navy);
    background: #fff;
    border-color: #fff;
}

.featured-story-secondary:hover {
    background: rgba(255, 255, 255, .11);
    border-color: #fff;
}

.gallery-stats {
    padding: 42px 7%;
    background: #fff;
    border-bottom: 1px solid var(--gallery-border);
}

.gallery-stats-grid {
    width: min(100%, 1400px);
    margin: auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gallery-stat {
    min-width: 0;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-right: 1px solid #dfe4ec;
}

.gallery-stat:last-child {
    border-right: 0;
}

.gallery-stat-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    color: var(--gallery-gold);
    border: 2px solid var(--gallery-gold);
    border-radius: 50%;
    font-size: 15px;
    font-weight: 800;
}

.gallery-stat strong {
    display: block;
    margin-bottom: 4px;
    color: var(--gallery-navy);
    font-size: 27px;
    line-height: 1;
}

.gallery-stat div span {
    color: #596273;
    font-size: 13px;
    line-height: 1.5;
}

.gallery-main {
    padding: 70px 7% 85px;
    background: var(--gallery-light);
}

.gallery-main-inner {
    width: min(100%, 1400px);
    margin: auto;
}

.gallery-section-header {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

.gallery-section-heading {
    max-width: 680px;
}

.gallery-section-heading h2,
.gallery-clients-heading h2,
.gallery-cta-inner h2 {
    margin: 10px 0 12px;
    color: var(--gallery-navy);
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.2;
}

.gallery-section-heading p {
    margin: 0;
    color: #566173;
    font-size: 15px;
    line-height: 1.75;
}

.gallery-result-count {
    flex-shrink: 0;
    margin: 0;
    color: #687386;
    font-size: 14px;
    font-weight: 700;
}

.gallery-filter-wrapper {
    margin-bottom: 35px;
}

.gallery-filter-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-filter-button {
    min-height: 43px;
    padding: 9px 12px 9px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--gallery-navy);
    background: #fff;
    border: 1px solid #d8dee8;
    border-radius: 24px;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .25s ease, background .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease;
}

.gallery-filter-count {
    min-width: 25px;
    height: 25px;
    padding: 0 7px;
    display: inline-grid;
    place-items: center;
    background: #eff3f8;
    border-radius: 999px;
    font-size: 11px;
}

.gallery-filter-button:hover {
    color: var(--gallery-gold);
    border-color: var(--gallery-gold);
    transform: translateY(-2px);
}

.gallery-filter-button.active {
    color: #fff;
    background: var(--gallery-navy);
    border-color: var(--gallery-navy);
    box-shadow: 0 8px 18px rgba(0, 31, 91, .2);
}

.gallery-filter-button.active .gallery-filter-count {
    color: var(--gallery-navy);
    background: #fff;
}

.gallery-grid {
    --gallery-gap: 22px;
    --gallery-row-height: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: var(--gallery-row-height);
    gap: var(--gallery-gap);
    align-items: start;
}

.gallery-card {
    position: relative;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    background: #dfe4eb;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(5, 24, 61, .10);
    cursor: pointer;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity .35s ease, visibility .35s ease, transform .35s ease, box-shadow .35s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(5, 24, 61, .18);
}

.gallery-card.is-hidden,
.gallery-card.is-load-hidden {
    display: none;
}

.gallery-card.is-entering {
    opacity: 0;
    transform: translateY(18px) scale(.985);
}

.gallery-card-standard .gallery-card-image { aspect-ratio: 4 / 3; }
.gallery-card-wide .gallery-card-image { aspect-ratio: 16 / 10; }
.gallery-card-tall .gallery-card-image { aspect-ratio: 4 / 5; }
.gallery-card-portrait .gallery-card-image { aspect-ratio: 3 / 4; }

.gallery-card-image {
    position: relative;
    width: 100%;
    min-height: 230px;
    overflow: hidden;
    background: linear-gradient(110deg, #e3e8ef 8%, #f4f6f9 18%, #e3e8ef 33%);
    background-size: 200% 100%;
    animation: gallerySkeleton 1.4s linear infinite;
}

.gallery-card-image.is-ready {
    animation: none;
    background: #dce2eb;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0;
    transition: opacity .45s ease, transform .55s ease;
}

.gallery-card-image img.is-loaded {
    opacity: 1;
}

.gallery-card:hover .gallery-card-image img,
.gallery-card:focus-visible .gallery-card-image img {
    transform: scale(1.07);
}

.gallery-card-overlay {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    padding: 65px 22px 21px;
    color: #fff;
    background: linear-gradient(to top, rgba(2, 18, 60, .96), rgba(2, 18, 60, .73) 53%, transparent);
    transform: translateY(7px);
    transition: transform .35s ease;
}

.gallery-card:hover .gallery-card-overlay,
.gallery-card:focus-visible .gallery-card-overlay {
    transform: translateY(0);
}

.gallery-card-category {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 9px;
    color: #fff;
    background: rgba(212, 160, 23, .94);
    border-radius: 20px;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.gallery-card h3 {
    margin: 0 0 6px;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 1.25;
}

.gallery-card-client {
    margin: 0 0 8px;
    color: #f0c75e;
    font-size: 12px;
    font-weight: 800;
}

.gallery-card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 5px 12px;
    color: rgba(255, 255, 255, .84);
    font-size: 10px;
}

.gallery-card-view {
    position: absolute;
    top: 17px;
    right: 17px;
    z-index: 3;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--gallery-navy);
    background: rgba(255, 255, 255, .94);
    border-radius: 50%;
    font-size: 24px;
    opacity: 0;
    transform: scale(.78) rotate(-8deg);
    box-shadow: 0 7px 20px rgba(0, 0, 0, .18);
    transition: opacity .3s ease, transform .3s ease, background .3s ease, color .3s ease;
}

.gallery-card:hover .gallery-card-view,
.gallery-card:focus-visible .gallery-card-view {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.gallery-empty-message {
    padding: 55px 25px;
    text-align: center;
    color: #657083;
    background: #fff;
    border: 1px solid var(--gallery-border);
    border-radius: 14px;
}

.gallery-empty-message h3 {
    margin: 0 0 8px;
    color: var(--gallery-navy);
}

.gallery-empty-message p {
    margin: 0;
}

.gallery-load-more-wrapper {
    margin-top: 38px;
    text-align: center;
}

.gallery-load-more-wrapper[hidden] {
    display: none;
}

.gallery-load-more {
    min-height: 50px;
    padding: 13px 24px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    background: var(--gallery-navy);
    border: 2px solid var(--gallery-navy);
    border-radius: 7px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.gallery-load-more:hover {
    background: var(--gallery-gold);
    border-color: var(--gallery-gold);
    transform: translateY(-2px);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gallery-text);
    background: rgba(1, 13, 39, .92);
    backdrop-filter: blur(9px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease;
}

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

.gallery-lightbox-dialog {
    position: relative;
    width: min(1180px, 100%);
    max-height: calc(100vh - 56px);
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, .72fr);
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
    opacity: 0;
    transform: translateY(25px) scale(.975);
    transition: opacity .32s ease, transform .32s ease;
}

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

.gallery-lightbox-media {
    position: relative;
    min-width: 0;
    min-height: 610px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #06183d;
}

.gallery-lightbox-image {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 56px);
    display: block;
    object-fit: contain;
    opacity: 0;
    transform: scale(.985);
    transition: opacity .35s ease, transform .35s ease;
}

.gallery-lightbox-image.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.gallery-lightbox-loader {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    background: #06183d;
    transition: opacity .25s ease, visibility .25s ease;
}

.gallery-lightbox-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.gallery-lightbox-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, .23);
    border-top-color: var(--gallery-gold);
    border-radius: 50%;
    animation: galleryLightboxSpin .8s linear infinite;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
    position: absolute;
    z-index: 8;
    display: grid;
    place-items: center;
    color: var(--gallery-navy);
    background: rgba(255, 255, 255, .94);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.gallery-lightbox-close {
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    font-size: 29px;
}

.gallery-lightbox-arrow {
    top: 50%;
    width: 50px;
    height: 50px;
    font-size: 25px;
    transform: translateY(-50%);
}

.gallery-lightbox-arrow.previous { left: 20px; }
.gallery-lightbox-arrow.next { right: 20px; }

.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:hover {
    color: #fff;
    background: var(--gallery-gold);
}

.gallery-lightbox-arrow:disabled,
.gallery-lightbox-mobile-button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.gallery-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 7;
    min-width: 72px;
    padding: 8px 13px;
    color: #fff;
    background: rgba(0, 31, 91, .86);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 25px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.gallery-lightbox-content {
    min-width: 0;
    padding: 65px 42px 38px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #fff;
}

.gallery-lightbox-category {
    width: max-content;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 7px 12px;
    color: #9b7100;
    background: rgba(212, 160, 23, .13);
    border: 1px solid rgba(212, 160, 23, .35);
    border-radius: 22px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.gallery-lightbox-title {
    margin: 0 0 12px;
    color: var(--gallery-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    line-height: 1.18;
}

.gallery-lightbox-client {
    margin: 0 0 6px;
    color: var(--gallery-gold);
    font-size: 15px;
    font-weight: 800;
}

.gallery-lightbox-project {
    margin: 0 0 20px;
    color: #536075;
    font-size: 14px;
    font-weight: 700;
}

.gallery-lightbox-divider {
    width: 62px;
    height: 3px;
    margin-bottom: 21px;
    background: var(--gallery-gold);
    border-radius: 10px;
}

.gallery-lightbox-description {
    margin: 0 0 24px;
    color: #505c6e;
    font-size: 14px;
    line-height: 1.8;
}

.gallery-lightbox-details {
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
    border-top: 1px solid #e0e5ed;
}

.gallery-lightbox-details li {
    padding: 13px 0;
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 14px;
    border-bottom: 1px solid #e0e5ed;
}

.gallery-lightbox-details span {
    color: #596578;
    font-size: 13px;
    line-height: 1.55;
}

.gallery-lightbox-actions {
    margin-top: auto;
}

.gallery-lightbox-project-link {
    width: 100%;
    color: #fff;
    background: var(--gallery-navy);
    border: 2px solid var(--gallery-navy);
}

.gallery-lightbox-project-link:hover {
    background: var(--gallery-gold);
    border-color: var(--gallery-gold);
}

.gallery-lightbox-mobile-navigation {
    display: none;
}

.gallery-clients {
    padding: 65px 7%;
    background: #fff;
    border-top: 1px solid var(--gallery-border);
}

.gallery-clients-inner,
.gallery-cta-inner {
    width: min(100%, 1400px);
    margin: auto;
}

.gallery-clients-heading {
    margin-bottom: 28px;
    text-align: center;
}

.gallery-client-placeholder {
    min-height: 120px;
    padding: 25px;
    display: grid;
    place-items: center;
    color: #667085;
    background: var(--gallery-light);
    border: 1px dashed #b9c2d1;
    border-radius: 14px;
    text-align: center;
}

.gallery-cta {
    padding: 65px 7%;
    color: #fff;
    background: var(--gallery-navy);
}

.gallery-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;
}

.gallery-cta-inner h2 {
    max-width: 820px;
    margin-bottom: 0;
    color: #fff;
}

.gallery-cta-button {
    flex-shrink: 0;
    color: var(--gallery-navy);
    background: #fff;
    border: 2px solid #fff;
}

.gallery-cta-button:hover {
    color: #fff;
    background: var(--gallery-gold);
    border-color: var(--gallery-gold);
}

.gallery-filter-button:focus-visible,
.gallery-card:focus-visible,
.gallery-load-more:focus-visible,
.gallery-lightbox button:focus-visible,
.gallery-lightbox a:focus-visible,
.gallery-cta-button:focus-visible {
    outline: 3px solid var(--gallery-gold);
    outline-offset: 4px;
}

@keyframes gallerySkeleton {
    to { background-position-x: -200%; }
}

@keyframes galleryLightboxSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
    .gallery-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gallery-stat:nth-child(3) { border-right: 0; }
    .gallery-stat:nth-child(-n+3) { border-bottom: 1px solid #dfe4ec; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .gallery-hero { grid-template-columns: 1fr; }
    .gallery-hero-content { min-height: 420px; text-align: center; align-items: center; }
    .gallery-hero-collage { min-height: 360px; }
    .featured-story-inner { grid-template-columns: 1fr; }
    .featured-story-image { min-height: 420px; }
    .gallery-lightbox { padding: 20px; }
    .gallery-lightbox-dialog { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); max-height: calc(100vh - 40px); }
    .gallery-lightbox-content { padding: 60px 30px 32px; }
}

@media (max-width: 768px) {
    .featured-story,
    .gallery-main,
    .gallery-clients,
    .gallery-cta { padding-left: 6%; padding-right: 6%; }

    .featured-story-content { padding: 42px 28px 45px; }
    .featured-story-content::before { inset: 0 0 auto; width: 100%; height: 4px; }
    .gallery-stats { padding: 30px 6%; }
    .gallery-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-stat { justify-content: flex-start; padding: 18px 12px; border-right: 0; border-bottom: 1px solid #dfe4ec; }
    .gallery-stat:nth-child(odd) { border-right: 1px solid #dfe4ec; }
    .gallery-stat:last-child { grid-column: 1 / -1; justify-content: center; border-right: 0; border-bottom: 0; }
    .gallery-section-header { display: block; }
    .gallery-result-count { margin-top: 14px; }
    .gallery-filter-list { flex-wrap: nowrap; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
    .gallery-filter-list::-webkit-scrollbar { display: none; }
    .gallery-filter-button { flex: 0 0 auto; }
    .gallery-grid { grid-template-columns: 1fr; --gallery-gap: 17px; }
    .gallery-card-view { opacity: 1; transform: none; }

    .gallery-lightbox { align-items: flex-start; padding: 0; background: rgba(1, 13, 39, .97); }
    .gallery-lightbox-dialog { width: 100%; min-height: 100dvh; max-height: none; display: flex; flex-direction: column; overflow-y: auto; border-radius: 0; }
    .gallery-lightbox-media { min-height: 52vh; height: 52vh; flex: 0 0 52vh; }
    .gallery-lightbox-image { max-height: none; }
    .gallery-lightbox-close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; }
    .gallery-lightbox-counter { position: fixed; top: max(16px, env(safe-area-inset-top)); left: 14px; }
    .gallery-lightbox-arrow { display: none; }
    .gallery-lightbox-content { overflow: visible; padding: 35px 24px calc(30px + env(safe-area-inset-bottom)); }
    .gallery-lightbox-mobile-navigation { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .gallery-lightbox-mobile-button { min-height: 48px; padding: 12px 14px; color: var(--gallery-navy); background: #f3f5f8; border: 1px solid #d8dee8; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
    .gallery-cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .gallery-hero-content { min-height: 350px; padding: 50px 6%; }
    .gallery-hero-collage { min-height: 260px; grid-template-rows: 130px 130px; }
    .featured-story { padding-top: 42px; padding-bottom: 42px; }
    .featured-story-image { min-height: 280px; }
    .featured-story-content { padding: 35px 22px 38px; }
    .featured-story-details { grid-template-columns: 1fr; }
    .featured-story-actions { display: grid; grid-template-columns: 1fr; }
    .featured-story-button,
    .featured-story-secondary { width: 100%; }
    .gallery-stat { display: block; text-align: center; }
    .gallery-stat-icon { margin: 0 auto 10px; }
    .gallery-lightbox-media { min-height: 43vh; height: 43vh; flex-basis: 43vh; }
    .gallery-lightbox-content { padding: 31px 19px calc(27px + env(safe-area-inset-bottom)); }
    .gallery-lightbox-details li { grid-template-columns: 1fr; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-page *,
    .gallery-page *::before,
    .gallery-page *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* ==========================================================================
   CMS placeholders and database-driven states
   ========================================================================== */
.media-placeholder {
    width: 100%;
    height: 100%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: #53627a;
    background:
        linear-gradient(135deg, rgba(10, 46, 92, .06), rgba(212, 175, 55, .12)),
        #eef2f7;
    border: 1px dashed rgba(10, 46, 92, .2);
}

.media-placeholder-dark {
    color: rgba(255, 255, 255, .82);
    background:
        linear-gradient(135deg, rgba(10, 46, 92, .94), rgba(22, 63, 111, .88));
    border-color: rgba(255, 255, 255, .25);
}

.media-placeholder-icon {
    font-size: 34px;
    line-height: 1;
    color: var(--gallery-gold);
}

.gallery-card-placeholder {
    min-height: 300px;
    border: 0;
}

.gallery-lightbox-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .8);
    background: #071b38;
    font-weight: 700;
}

/* Consultancy in Action categories must remain in one row. */
.gallery-filter-wrapper {
    max-width: 100%;
    overflow: hidden;
}

.gallery-filter-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 2px 14px;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(10, 46, 92, .25) transparent;
    scroll-behavior: smooth;
    overscroll-behavior-inline: contain;
}

.gallery-filter-list::-webkit-scrollbar {
    height: 5px;
}

.gallery-filter-list::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-filter-list::-webkit-scrollbar-thumb {
    background: rgba(10, 46, 92, .25);
    border-radius: 999px;
}

.gallery-filter-button {
    flex: 0 0 auto !important;
}

/* Four-stat layout after removing the former 50+ statistic. */
.gallery-stats-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gallery-stats-grid-4 .gallery-stat:last-child {
    border-right: 0;
}

/* ==========================================================================
   Our Valued Clients & Partners — logos only
   ========================================================================== */
.valued-clients {
    position: relative;
    overflow: hidden;
    padding: 90px 5%;
    background: #fff;
    border-top: 1px solid #e5e9f0;
}

.valued-clients-inner {
    width: min(1380px, 100%);
    margin: 0 auto;
}

.valued-clients-header {
    max-width: 790px;
    margin: 0 auto 42px;
    text-align: center;
}

.valued-clients-header h2 {
    margin: 8px 0 16px;
    color: var(--gallery-navy);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
}

.valued-clients-header p {
    margin: 0;
    color: #637086;
    font-size: 16px;
    line-height: 1.8;
}

.client-logo-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 15px 0;
    outline: none;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.client-logo-carousel::before,
.client-logo-carousel::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    width: 70px;
    pointer-events: none;
}

.client-logo-track {
    display: flex;
    width: max-content;
    gap: 24px;
    animation: client-logo-marquee 38s linear infinite;
    will-change: transform;
}

.client-logo-carousel:hover .client-logo-track,
.client-logo-carousel:focus-within .client-logo-track,
.client-logo-carousel.is-paused .client-logo-track {
    animation-play-state: paused;
}

.client-logo-item {
    flex: 0 0 210px;
}

.client-logo-link {
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    color: var(--gallery-navy);
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 8px 26px rgba(5, 27, 59, .07);
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.client-logo-link:hover,
.client-logo-link:focus-visible {
    transform: translateY(-5px) scale(1.025);
    border-color: rgba(212, 175, 55, .65);
    box-shadow: 0 16px 35px rgba(5, 27, 59, .14);
}

.client-logo-link img {
    width: 100%;
    height: 78px;
    object-fit: contain;
    filter: grayscale(1);
    opacity: .72;
    transition: filter .25s ease, opacity .25s ease, transform .25s ease;
}

.client-logo-link:hover img,
.client-logo-link:focus-visible img {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.04);
}

.client-logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
}

.client-logo-placeholder strong {
    font-size: 17px;
    color: var(--gallery-navy);
}

.client-logo-placeholder small {
    color: #7b8798;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.clients-empty-state,
.instagram-empty-state {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 35px;
    text-align: center;
    color: #637086;
    background: #f7f9fc;
    border: 1px dashed #cbd4df;
    border-radius: 16px;
}

.clients-empty-state h3,
.instagram-empty-state h3 {
    margin: 4px 0 0;
    color: var(--gallery-navy);
}

.clients-empty-state p,
.instagram-empty-state p {
    max-width: 600px;
    margin: 0;
    line-height: 1.7;
}

@keyframes client-logo-marquee {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* ==========================================================================
   Instagram database/API states
   ========================================================================== */
.instagram-placeholder {
    min-height: 100%;
    border: 0;
}

.instagram-post-overlay time {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

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

    .gallery-stats-grid-4 .gallery-stat:nth-child(2) {
        border-right: 0;
    }

    .gallery-stats-grid-4 .gallery-stat:nth-child(-n+2) {
        border-bottom: 1px solid #dfe4ec;
    }
}

@media (max-width: 768px) {
    .valued-clients {
        padding: 70px 6%;
    }

    .client-logo-carousel {
        overflow: hidden;
        -webkit-mask-image: linear-gradient(
            to right,
            transparent,
            #000 8%,
            #000 92%,
            transparent
        );
        mask-image: linear-gradient(
            to right,
            transparent,
            #000 8%,
            #000 92%,
            transparent
        );
        touch-action: pan-y;
        scrollbar-width: none;
    }

    .client-logo-carousel::-webkit-scrollbar {
        display: none;
    }

    .client-logo-track {
        display: flex;
        width: max-content;
        gap: 18px;
        padding-right: 0;
        animation: client-logo-marquee 32s linear infinite;
        will-change: transform;
    }

    .client-logo-carousel:hover .client-logo-track,
    .client-logo-carousel:focus-within .client-logo-track,
    .client-logo-carousel.is-paused .client-logo-track {
        animation-play-state: paused;
    }

    .client-logo-item {
        flex: 0 0 165px;
    }

    .client-logo-link {
        height: 105px;
        padding: 16px;
    }

    .client-logo-link img {
        width: 100%;
        height: 64px;
        object-fit: contain;
    }
}

@media (max-width: 520px) {
    .gallery-stats-grid-4 {
        grid-template-columns: 1fr;
    }

    .gallery-stats-grid-4 .gallery-stat {
        border-right: 0 !important;
        border-bottom: 1px solid #dfe4ec;
    }

    .gallery-stats-grid-4 .gallery-stat:last-child {
        border-bottom: 0;
    }

    .client-logo-track {
        gap: 14px;
        animation-duration: 28s;
    }

    .client-logo-item {
        flex: 0 0 145px;
    }

    .client-logo-link {
        height: 100px;
        padding: 15px;
    }

    .client-logo-link img {
        height: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .client-logo-track {
        animation: none !important;
    }
}


/* ==========================================================================
   FINAL GALLERY FLOW
   Hero → Consultancy in Action → Clients → Instagram → CTA
   ========================================================================== */

.gallery-main {
    padding-top: 70px;
}

/* Category menu always stays on one line on every screen size. */
.gallery-filter-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.gallery-filter-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    width: 100%;
    max-width: 100%;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 2px 13px;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.gallery-filter-button {
    flex: 0 0 auto !important;
}

@media (max-width: 768px) {
    .gallery-main {
        padding-top: 52px;
    }
}

/* ==========================================================================
   AUTHORITATIVE LIGHTBOX + INSTAGRAM FIXES
   These selectors intentionally use higher specificity to override older rules.
   ========================================================================== */

/* ---------- Lightbox shell ---------- */

.gallery-page .gallery-lightbox-dialog{
    width:min(1180px, calc(100vw - 56px)) !important;
    height:min(760px, calc(100dvh - 56px)) !important;
    max-height:calc(100dvh - 56px) !important;

    display:grid !important;
    grid-template-columns:minmax(0, 1.45fr) minmax(330px, .72fr) !important;

    overflow:hidden !important;
}

/*
 * The JavaScript also places the photograph on this element as a background.
 * This guarantees that the media area is populated even if the <img> element
 * is delayed, cached strangely, or affected by another global image rule.
 */
.gallery-page .gallery-lightbox-media{
    position:relative !important;

    width:100% !important;
    min-width:0 !important;
    min-height:0 !important;
    height:100% !important;

    display:block !important;
    overflow:hidden !important;

    background-color:#06183d !important;
    background-repeat:no-repeat !important;
    background-position:center center !important;
    background-size:contain !important;
}

/* Keep the semantic image centred as a second rendering layer. */
.gallery-page .gallery-lightbox-image{
    position:absolute !important;
    inset:0 !important;

    width:100% !important;
    height:100% !important;
    max-width:none !important;
    max-height:none !important;

    display:block !important;
    padding:0 !important;
    margin:0 !important;

    object-fit:contain !important;
    object-position:center center !important;

    opacity:0 !important;
    visibility:hidden !important;
    transform:none !important;
}

.gallery-page .gallery-lightbox-image.is-loaded{
    opacity:1 !important;
    visibility:visible !important;
    transform:none !important;
}

.gallery-page .gallery-lightbox-loader{
    position:absolute !important;
    inset:0 !important;
    z-index:6 !important;

    display:grid !important;
    place-items:center !important;

    background:#06183d !important;
}

.gallery-page .gallery-lightbox-loader.is-hidden{
    opacity:0 !important;
    visibility:hidden !important;
    pointer-events:none !important;
}

/* ---------- Information panel and location wrapping ---------- */

.gallery-page .gallery-lightbox-content{
    min-width:0 !important;
    height:100% !important;

    padding:64px 40px 42px !important;

    overflow-x:hidden !important;
    overflow-y:auto !important;

    overscroll-behavior:contain;
}

.gallery-page .gallery-lightbox-details{
    width:100% !important;
    min-width:0 !important;
}

.gallery-page .gallery-lightbox-details li{
    width:100% !important;
    min-width:0 !important;

    grid-template-columns:90px minmax(0, 1fr) !important;
    align-items:start !important;
}

.gallery-page .gallery-lightbox-details span,
.gallery-page #galleryLightboxLocation,
.gallery-page #galleryLightboxService,
.gallery-page #galleryLightboxDate{
    min-width:0 !important;
    max-width:100% !important;

    display:block !important;

    white-space:normal !important;
    overflow:visible !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    text-overflow:clip !important;
}

/* ---------- Instagram spacing ---------- */

.gallery-page .instagram-wall{
    width:100% !important;

    padding:0 !important;
    margin:0 !important;

    overflow:hidden !important;

    background:#f7f9fc;
}

.gallery-page .instagram-wall-inner{
    width:100% !important;
    max-width:1400px !important;

    margin:0 auto !important;
    padding:82px clamp(28px, 7vw, 100px) !important;
}

.gallery-page .instagram-wall-header{
    width:100% !important;
    max-width:none !important;

    margin:0 0 38px !important;
    padding:0 !important;

    display:flex !important;
    align-items:flex-end !important;
    justify-content:space-between !important;
    gap:35px !important;
}

.gallery-page .instagram-wall-header > div{
    width:100% !important;
    max-width:760px !important;
    min-width:0 !important;

    margin:0 !important;
    padding:0 !important;
}

.gallery-page .instagram-wall-header .gallery-eyebrow{
    display:block !important;
    margin:0 !important;
}

.gallery-page .instagram-wall-header h2{
    margin:10px 0 14px !important;
}

.gallery-page .instagram-wall-header p{
    width:100% !important;
    max-width:760px !important;

    margin:0 !important;
}

/* ---------- Tablet ---------- */

@media(max-width:900px){

    .gallery-page .gallery-lightbox-dialog{
        width:calc(100vw - 40px) !important;
        height:calc(100dvh - 40px) !important;
        max-height:calc(100dvh - 40px) !important;

        grid-template-columns:minmax(0, 1.1fr) minmax(300px, .9fr) !important;
    }

    .gallery-page .instagram-wall-inner{
        padding:66px 6% !important;
    }

    .gallery-page .instagram-wall-header{
        align-items:flex-start !important;
        flex-direction:column !important;
        gap:22px !important;
    }

}

/* ---------- Mobile ---------- */

@media(max-width:768px){

    .gallery-page .gallery-lightbox{
        padding:0 !important;
        align-items:flex-start !important;
    }

    .gallery-page .gallery-lightbox-dialog{
        width:100% !important;
        height:auto !important;
        min-height:100dvh !important;
        max-height:none !important;

        display:flex !important;
        flex-direction:column !important;

        overflow-y:auto !important;

        border-radius:0 !important;
    }

    .gallery-page .gallery-lightbox-media{
        width:100% !important;
        height:52vh !important;
        min-height:52vh !important;
        flex:0 0 52vh !important;
    }

    .gallery-page .gallery-lightbox-content{
        height:auto !important;
        overflow:visible !important;

        padding:35px 24px calc(34px + env(safe-area-inset-bottom)) !important;
    }

    .gallery-page .gallery-lightbox-details li{
        grid-template-columns:82px minmax(0, 1fr) !important;
    }

    .gallery-page .instagram-wall-inner{
        padding:54px 6% !important;
    }

    .gallery-page .instagram-wall-header{
        margin-bottom:28px !important;
    }

}

/* ---------- Small mobile ---------- */

@media(max-width:480px){

    .gallery-page .gallery-lightbox-media{
        height:43vh !important;
        min-height:43vh !important;
        flex-basis:43vh !important;
    }

    .gallery-page .gallery-lightbox-details li{
        grid-template-columns:1fr !important;
        gap:5px !important;
    }

    .gallery-page .instagram-wall-inner{
        padding:46px 20px !important;
    }

}

/* ==========================================================================
   FINAL MOBILE CLIENT LOGO MARQUEE OVERRIDE
   ========================================================================== */

@media (max-width: 768px) {
    .gallery-page .client-logo-carousel {
        overflow: hidden !important;
        -webkit-mask-image: linear-gradient(
            to right,
            transparent,
            #000 8%,
            #000 92%,
            transparent
        ) !important;
        mask-image: linear-gradient(
            to right,
            transparent,
            #000 8%,
            #000 92%,
            transparent
        ) !important;
        touch-action: pan-y !important;
    }

    .gallery-page .client-logo-track {
        display: flex !important;
        width: max-content !important;
        gap: 18px !important;
        padding-right: 0 !important;
        animation: client-logo-marquee 32s linear infinite !important;
        will-change: transform !important;
    }

    .gallery-page .client-logo-item {
        flex: 0 0 165px !important;
    }

    .gallery-page .client-logo-link {
        height: 105px !important;
        padding: 16px !important;
    }

    .gallery-page .client-logo-link img {
        width: 100% !important;
        height: 64px !important;
        object-fit: contain !important;
    }
}

@media (max-width: 520px) {
    .gallery-page .client-logo-track {
        gap: 14px !important;
        animation-duration: 28s !important;
    }

    .gallery-page .client-logo-item {
        flex-basis: 145px !important;
    }

    .gallery-page .client-logo-link {
        height: 100px !important;
        padding: 15px !important;
    }

    .gallery-page .client-logo-link img {
        height: 60px !important;
    }
}


/* ==========================================================================
   PREMIUM INSTAGRAM EXPERIENCE
   ========================================================================== */
.gallery-page .instagram-wall {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 10%, rgba(245, 133, 41, .08), transparent 24%),
        radial-gradient(circle at 92% 12%, rgba(129, 52, 175, .08), transparent 26%),
        #f7f9fc;
}

.gallery-page .instagram-wall-inner {
    width: min(1400px, calc(100% - 10%)) !important;
    margin: 0 auto !important;
    padding: 88px 0 92px !important;
}

.gallery-page .instagram-wall-header {
    margin: 0 0 42px !important;
}

.gallery-page .instagram-wall-header h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 4vw, 3rem);
    letter-spacing: -.02em;
}

.gallery-page .instagram-wall-header p {
    max-width: 760px !important;
    color: #596579;
    font-size: 15px;
    line-height: 1.85;
}

.gallery-page .instagram-profile-link {
    position: relative;
    flex: 0 0 auto;
    min-width: 265px;
    min-height: 58px;
    padding: 10px 14px 10px 12px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    color: #fff !important;
    background: linear-gradient(135deg,#f58529 0%,#feda77 20%,#dd2a7b 48%,#8134af 72%,#515bd4 100%);
    background-size: 180% 180%;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(129,52,175,.28), inset 0 1px 0 rgba(255,255,255,.25);
    text-decoration: none;
    transition: transform .28s ease, box-shadow .28s ease, filter .28s ease, background-position .45s ease;
}

.gallery-page .instagram-profile-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,transparent 20%,rgba(255,255,255,.24) 48%,transparent 72%);
    transform: translateX(-120%);
    transition: transform .65s ease;
}

.gallery-page .instagram-profile-link:hover,
.gallery-page .instagram-profile-link:focus-visible {
    color: #fff !important;
    transform: translateY(-4px);
    filter: saturate(1.08) brightness(1.04);
    background-position: 100% 50%;
    box-shadow: 0 20px 42px rgba(129,52,175,.36), inset 0 1px 0 rgba(255,255,255,.3);
}

.gallery-page .instagram-profile-link:hover::before,
.gallery-page .instagram-profile-link:focus-visible::before {
    transform: translateX(120%);
}

.gallery-page .instagram-profile-icon {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 7px;
    fill: currentColor;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 10px;
}

.gallery-page .instagram-profile-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gallery-page .instagram-profile-copy strong { font-size: 13px; line-height: 1.15; }
.gallery-page .instagram-profile-copy small { color: rgba(255,255,255,.82); font-size: 10px; line-height: 1.15; }

.gallery-page .instagram-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    grid-auto-rows: 235px;
    gap: 18px;
}

.gallery-page .instagram-post {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #dfe5ed;
    border: 1px solid rgba(10,46,92,.08);
    border-radius: 17px;
    box-shadow: 0 12px 30px rgba(5,27,59,.11);
    isolation: isolate;
    opacity: 0;
    transform: translateY(18px) scale(.985);
    transition: opacity .5s ease, transform .5s ease, box-shadow .35s ease;
}

.gallery-page .instagram-post.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.gallery-page .instagram-post-featured { grid-column: span 2; grid-row: span 2; }

.gallery-page .instagram-post > a {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
}

.gallery-page .instagram-post-image {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: block;
    object-fit: cover !important;
    object-position: center;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity .45s ease, transform .65s ease, filter .45s ease;
}

.gallery-page .instagram-post-image.is-loaded { opacity: 1; }
.gallery-page .instagram-post:hover .instagram-post-image,
.gallery-page .instagram-post:focus-within .instagram-post-image { transform: scale(1.07); filter: saturate(1.06) contrast(1.02); }

.gallery-page .instagram-post::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top,rgba(2,18,60,.96) 0%,rgba(2,18,60,.68) 40%,rgba(2,18,60,.08) 76%,transparent 100%);
}

.gallery-page .instagram-post-overlay {
    position: absolute;
    inset: auto 0 0;
    z-index: 3;
    width: 100%;
    padding: 58px 18px 17px;
    color: #fff;
    transform: translateY(7px);
    transition: transform .32s ease;
}

.gallery-page .instagram-post-featured .instagram-post-overlay { padding: 96px 28px 26px; }
.gallery-page .instagram-post:hover .instagram-post-overlay,
.gallery-page .instagram-post:focus-within .instagram-post-overlay { transform: translateY(0); }
.gallery-page .instagram-post-icon { display: none; }

.gallery-page .instagram-post-overlay p {
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gallery-page .instagram-post-featured .instagram-post-overlay p {
    max-width: 650px;
    font-size: 16px;
    line-height: 1.65;
    -webkit-line-clamp: 3;
}

.gallery-page .instagram-post-overlay time {
    display: inline-block;
    margin-top: 9px;
    color: rgba(255,255,255,.76);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.gallery-page .instagram-media-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    min-height: 32px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    background: rgba(0,31,91,.82);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.gallery-page .instagram-media-badge svg { width: 14px; height: 14px; fill: currentColor; }

.gallery-page .instagram-engagement {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 4;
    display: flex;
    gap: 8px;
}

.gallery-page .instagram-engagement span {
    min-height: 30px;
    padding: 7px 9px;
    display: inline-flex;
    align-items: center;
    color: #fff;
    background: rgba(0,31,91,.78);
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    font-size: 10px;
    font-weight: 800;
}

.gallery-page .instagram-mobile-hint { display: none; }

@media (min-width: 1280px) {
    .gallery-page .instagram-grid { grid-auto-rows: 250px; }
}

@media (max-width: 1100px) {
    .gallery-page .instagram-wall-inner { width: min(1200px,calc(100% - 12%)) !important; padding: 74px 0 78px !important; }
    .gallery-page .instagram-grid { grid-template-columns: repeat(3,minmax(0,1fr)); grid-auto-rows: 225px; }
}

@media (max-width: 820px) {
    .gallery-page .instagram-wall-inner { width: calc(100% - 12%) !important; padding: 64px 0 68px !important; }
    .gallery-page .instagram-wall-header { align-items: flex-start !important; flex-direction: column !important; gap: 22px !important; }
    .gallery-page .instagram-grid { grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: 225px; gap: 15px; }
    .gallery-page .instagram-post-featured { grid-column: span 2; grid-row: span 2; }
}

@media (max-width: 600px) {
    .gallery-page .instagram-wall-inner { width: calc(100% - 40px) !important; padding: 52px 0 58px !important; }
    .gallery-page .instagram-wall-header { margin-bottom: 28px !important; }
    .gallery-page .instagram-wall-header h2 { font-size: 30px; }
    .gallery-page .instagram-profile-link { width: 100%; min-width: 0; }

    .gallery-page .instagram-grid {
        display: flex;
        width: calc(100% + 20px);
        margin-right: -20px;
        gap: 14px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 20px 14px 0;
        scroll-snap-type: x mandatory;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .gallery-page .instagram-grid::-webkit-scrollbar { display: none; }

    .gallery-page .instagram-post,
    .gallery-page .instagram-post-featured {
        flex: 0 0 min(84vw,350px);
        aspect-ratio: 4 / 5;
        grid-column: auto;
        grid-row: auto;
        scroll-snap-align: start;
    }

    .gallery-page .instagram-post:nth-child(3n) { aspect-ratio: 1 / 1; }
    .gallery-page .instagram-post-overlay,
    .gallery-page .instagram-post-featured .instagram-post-overlay { padding: 76px 18px 18px; }
    .gallery-page .instagram-post-featured .instagram-post-overlay p { font-size: 14px; -webkit-line-clamp: 3; }

    .gallery-page .instagram-mobile-hint {
        margin-top: 8px;
        display: block;
        color: #778196;
        font-size: 11px;
        font-weight: 700;
        text-align: center;
        letter-spacing: .03em;
    }
}

@media (max-width: 380px) {
    .gallery-page .instagram-wall-inner { width: calc(100% - 30px) !important; }
    .gallery-page .instagram-post,
    .gallery-page .instagram-post-featured { flex-basis: 86vw; }
}


/* ==========================================================================
   FINAL INSTAGRAM ICON-ONLY MEDIA BADGES
   ========================================================================== */

.gallery-page .instagram-media-badge {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;

    display: grid !important;
    place-items: center !important;

    color: var(--gallery-navy) !important;
    background: rgba(255, 255, 255, .96) !important;
    border: 1px solid rgba(255, 255, 255, .78) !important;
    border-radius: 10px !important;

    box-shadow: 0 8px 20px rgba(0, 0, 0, .18) !important;
    backdrop-filter: blur(10px);

    font-size: 0 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.gallery-page .instagram-media-badge svg {
    width: 18px !important;
    height: 18px !important;
    display: block;
    fill: currentColor !important;
}

.gallery-page .instagram-media-badge:hover {
    color: #fff !important;
    background:
        linear-gradient(
            135deg,
            #f58529 0%,
            #dd2a7b 48%,
            #8134af 72%,
            #515bd4 100%
        ) !important;
}

@media (max-width: 600px) {
    .gallery-page .instagram-media-badge {
        top: 12px !important;
        right: 12px !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }

    .gallery-page .instagram-media-badge svg {
        width: 17px !important;
        height: 17px !important;
    }
}


/* ==========================================================================
   FINAL PLACEHOLDER AND MOBILE LIGHTBOX FIX
   Keep this block at the very end of gallery.css.
   ========================================================================== */

/*
 * Do not display "Photograph coming soon" while an image is loading or while
 * users move between lightbox photographs. The elements remain in the DOM for
 * existing JavaScript compatibility, but they are intentionally text-free.
 */
.gallery-page .gallery-card-placeholder,
.gallery-page .gallery-lightbox-placeholder,
.gallery-page .gallery-hero-placeholder{
    color:transparent !important;
    font-size:0 !important;
    line-height:0 !important;
    text-indent:-9999px !important;
    overflow:hidden !important;
}

.gallery-page .gallery-card-placeholder{
    width:100% !important;
    height:100% !important;
    min-height:230px !important;
    display:block !important;
    background:#dfe4eb !important;
    border:0 !important;
}

.gallery-page .gallery-hero-placeholder{
    width:100% !important;
    height:100% !important;
    min-height:100% !important;
    display:block !important;
    background:#071b43 !important;
}

.gallery-page .gallery-lightbox-placeholder{
    position:absolute !important;
    inset:0 !important;
    z-index:0 !important;
    display:none !important;
    background:#06183d !important;
    pointer-events:none !important;
}

/*
 * The loader remains the only temporary lightbox state. This prevents the
 * placeholder text from flashing between photographs.
 */
.gallery-page .gallery-lightbox-loader{
    z-index:6 !important;
}

@media(max-width:768px){

    /*
     * Keep the lightbox locked to the visible mobile viewport.
     * The photograph occupies the upper portion while the information panel
     * receives its own scrolling area.
     */
    .gallery-page .gallery-lightbox{
        width:100% !important;
        height:100dvh !important;
        max-height:100dvh !important;
        padding:0 !important;
        align-items:stretch !important;
        overflow:hidden !important;
    }

    .gallery-page .gallery-lightbox-dialog{
        width:100% !important;
        height:100dvh !important;
        min-height:0 !important;
        max-height:100dvh !important;

        display:flex !important;
        flex-direction:column !important;

        overflow:hidden !important;
        border-radius:0 !important;
    }

    /*
     * Use less than half of the screen for the photograph so that the title,
     * description, service, location and date remain accessible below it.
     */
    .gallery-page .gallery-lightbox-media{
        width:100% !important;
        height:42dvh !important;
        min-height:260px !important;
        max-height:42dvh !important;
        flex:0 0 42dvh !important;

        overflow:hidden !important;
    }

    .gallery-page .gallery-lightbox-image{
        width:100% !important;
        height:100% !important;
        max-height:none !important;
        object-fit:contain !important;
    }

    /*
     * All details scroll independently instead of being cut off by the
     * viewport. Momentum scrolling improves the behaviour on iPhone.
     */
    .gallery-page .gallery-lightbox-content{
        width:100% !important;
        min-width:0 !important;
        height:auto !important;
        min-height:0 !important;
        flex:1 1 auto !important;

        padding:28px 22px calc(24px + env(safe-area-inset-bottom)) !important;

        overflow-x:hidden !important;
        overflow-y:auto !important;
        -webkit-overflow-scrolling:touch;
        overscroll-behavior:contain !important;
    }

    .gallery-page .gallery-lightbox-title,
    .gallery-page .gallery-lightbox-client,
    .gallery-page .gallery-lightbox-project,
    .gallery-page .gallery-lightbox-description,
    .gallery-page .gallery-lightbox-details span{
        max-width:100% !important;
        white-space:normal !important;
        overflow-wrap:anywhere !important;
        word-break:break-word !important;
    }

    .gallery-page .gallery-lightbox-description{
        margin-bottom:20px !important;
    }

    .gallery-page .gallery-lightbox-details{
        width:100% !important;
        margin-bottom:18px !important;
    }

    .gallery-page .gallery-lightbox-details li{
        width:100% !important;
        grid-template-columns:82px minmax(0, 1fr) !important;
        gap:10px !important;
    }

    /*
     * Navigation remains reachable at the end of the details panel and is not
     * covered by the phone's bottom safe area.
     */
    .gallery-page .gallery-lightbox-actions{
        margin-top:12px !important;
    }

    .gallery-page .gallery-lightbox-mobile-navigation{
        position:sticky !important;
        bottom:calc(-24px - env(safe-area-inset-bottom)) !important;
        z-index:5 !important;

        margin:18px -22px calc(-24px - env(safe-area-inset-bottom)) !important;
        padding:14px 22px calc(14px + env(safe-area-inset-bottom)) !important;

        display:grid !important;
        grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) !important;
        gap:10px !important;

        background:#fff !important;
        border-top:1px solid #e0e5ed !important;
        box-shadow:0 -8px 18px rgba(0,31,91,.07) !important;
    }

    .gallery-page .gallery-lightbox-mobile-button{
        width:100% !important;
        min-width:0 !important;
    }

    .gallery-page .gallery-lightbox-close{
        position:fixed !important;
        top:max(12px, env(safe-area-inset-top)) !important;
        right:max(12px, env(safe-area-inset-right)) !important;
        z-index:12 !important;
    }

    .gallery-page .gallery-lightbox-counter{
        position:fixed !important;
        top:max(14px, env(safe-area-inset-top)) !important;
        left:max(12px, env(safe-area-inset-left)) !important;
        z-index:11 !important;
    }
}

@media(max-width:480px){

    .gallery-page .gallery-lightbox-media{
        height:38dvh !important;
        min-height:220px !important;
        max-height:38dvh !important;
        flex-basis:38dvh !important;
    }

    .gallery-page .gallery-lightbox-content{
        padding:24px 18px calc(22px + env(safe-area-inset-bottom)) !important;
    }

    .gallery-page .gallery-lightbox-title{
        font-size:1.65rem !important;
        line-height:1.2 !important;
    }

    .gallery-page .gallery-lightbox-details li{
        grid-template-columns:1fr !important;
        gap:4px !important;
    }

    .gallery-page .gallery-lightbox-mobile-navigation{
        bottom:calc(-22px - env(safe-area-inset-bottom)) !important;
        margin-left:-18px !important;
        margin-right:-18px !important;
        margin-bottom:calc(-22px - env(safe-area-inset-bottom)) !important;
        padding-left:18px !important;
        padding-right:18px !important;
    }
}


/* ==========================================================================
   FINAL MOBILE LIGHTBOX NAVIGATION CLEANUP
   Bottom Previous/Next buttons have been removed. Mobile users can still
   swipe left or right to move between photographs.
   ========================================================================== */

.gallery-page .gallery-lightbox-actions,
.gallery-page .gallery-lightbox-mobile-navigation,
.gallery-page .gallery-lightbox-mobile-button{
    display:none !important;
}

/*
 * Restore normal bottom spacing now that the sticky navigation strip
 * is no longer present.
 */
@media(max-width:768px){
    .gallery-page .gallery-lightbox-content{
        padding-bottom:calc(28px + env(safe-area-inset-bottom)) !important;
    }
}

@media(max-width:480px){
    .gallery-page .gallery-lightbox-content{
        padding-bottom:calc(24px + env(safe-area-inset-bottom)) !important;
    }
}
