/* Gallery page: editorial image-led layout built on the shared OpenDoor tokens. */
.gallery-hero {
    min-height: 650px;
    position: relative;
    display: flex;
    align-items: flex-end;
    color: #fff;
    overflow: hidden;
    background: var(--primary-dark);
}

.gallery-hero-image {
    position: absolute;
    inset: 0;
    background: url('../images/hero/hero-banner-1.avif') center 42% / cover;
    transform: scale(1.02);
}

.gallery-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 42, 87, .92) 0%, rgba(10, 42, 87, .55) 48%, rgba(10, 42, 87, .18) 100%), linear-gradient(0deg, rgba(10, 42, 87, .85), transparent 58%);
}

.gallery-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 120px 12px 76px;
}

.gallery-hero h1 {
    color: #fff;
    font-size: clamp(3rem, 6vw, 5.8rem);
    max-width: 850px;
    letter-spacing: -.045em;
    margin-top: 18px;
}

.gallery-hero-copy {
    color: rgba(255, 255, 255, .82);
    font-size: 1.05rem;
    max-width: 320px;
    margin-left: auto;
}

.gallery-scroll {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 58px;
    color: #fff;
    font-family: var(--font-display);
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.gallery-scroll i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    font-size: 1rem;
}

.gallery-intro {
    background: #fff;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 56px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-filter {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    padding: 10px 17px;
    border-radius: 40px;
    font: 600 .82rem var(--font-display);
    cursor: pointer;
    transition: all .3s var(--ease);
}

.gallery-filter:hover,
.gallery-filter.is-active {
    color: #fff;
    border-color: var(--secondary);
    background: var(--secondary);
}

.gallery-count {
    color: var(--muted);
    font-size: .82rem;
    white-space: nowrap;
}

.gallery-count strong {
    color: var(--dark);
    font: 800 1.2rem var(--font-display);
    margin-right: 5px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 260px;
  gap: 14px;
  grid-auto-flow: dense;
}

/* Every card */
.gallery-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
}

/* Wide cards */
.gallery-card-wide {
  grid-column: span 2;
}

/* Tall cards */
.gallery-card-tall {
  grid-row: span 2;
}

/* Featured card */
.gallery-card-featured {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-card.is-hidden {
    display: none;
}

.gallery-card-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.gallery-card-button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(10, 42, 87, .85), transparent 58%);
    opacity: .72;
    transition: opacity .35s ease;
}

.gallery-card-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-card-button:hover img,
.gallery-card-button:focus-visible img {
    transform: scale(1.07);
}

.gallery-card-button:hover::after,
.gallery-card-button:focus-visible::after {
    opacity: .94;
}

.gallery-card-overlay {
    position: absolute;
    inset: auto 22px 19px;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    color: #fff;
}

.gallery-card-overlay span {
    display: grid;
    gap: 5px;
}

.gallery-card-overlay small {
    color: var(--accent-light);
    font: 700 .68rem var(--font-display);
    letter-spacing: .13em;
    text-transform: uppercase;
}

.gallery-card-overlay strong {
    font: 700 1.06rem/1.2 var(--font-display);
}

.gallery-card-overlay i {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    transition: transform .3s var(--ease);
}

.gallery-card-button:hover .gallery-card-overlay i {
    transform: rotate(45deg);
}

.gallery-empty {
    padding: 60px 0;
    color: var(--muted);
    text-align: center;
}

.gallery-cta {
    background: var(--light);
}

.gallery-cta-inner {
    position: relative;
    overflow: hidden;
    padding: 74px 10%;
    border-radius: var(--radius-lg);
    background: var(--gradient-arc);
    color: #fff;
}

.gallery-cta-inner::after {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    right: -100px;
    top: -170px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    box-shadow: 0 0 0 38px rgba(255, 255, 255, .04), 0 0 0 78px rgba(255, 255, 255, .03);
}

.gallery-cta-inner h2 {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.2rem);
    max-width: 600px;
    margin: 13px 0 12px;
}

.gallery-cta-inner p {
    position: relative;
    z-index: 1;
    max-width: 470px;
    color: rgba(255, 255, 255, .78);
}

.gallery-cta-inner .btn-white {
    position: relative;
    z-index: 1;
    margin-top: 28px;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 42, 87, .9);
    backdrop-filter: blur(7px);
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(960px, 100%);
    max-height: 90vh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
    transform: translateY(18px) scale(.98);
    transition: transform .35s var(--ease);
}

.gallery-lightbox.is-open .gallery-lightbox-dialog {
    transform: translateY(0) scale(1);
}

.gallery-lightbox-dialog img {
    width: 100%;
    max-height: 72vh;
    min-height: 260px;
    object-fit: contain;
    background: var(--primary-dark);
}

.gallery-lightbox-close {
    position: absolute;
    z-index: 2;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(10, 42, 87, .74);
    cursor: pointer;
}

.gallery-lightbox-caption {
    padding: 20px 26px 24px;
}

.gallery-lightbox-caption span {
    color: var(--secondary);
    font: 700 .7rem var(--font-display);
    letter-spacing: .13em;
    text-transform: uppercase;
}

.gallery-lightbox-caption h2 {
    margin-top: 5px;
    font-size: 1.35rem;
}

body.gallery-lightbox-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    .gallery-hero {
        min-height: 590px;
    }

    .gallery-hero-copy {
        margin-left: 0;
    }

    .gallery-grid {
        grid-auto-rows: 180px;
    }

    .gallery-card {
        grid-column: span 6;
    }

    .gallery-card-wide,
    .gallery-card-featured {
        grid-column: span 12;
    }

    .gallery-card-tall {
        grid-column: span 6;
    }
}

@media (max-width: 575px) {
    .gallery-hero-content {
        padding-bottom: 52px;
    }

    .gallery-hero h1 {
        font-size: 2.8rem;
    }

    .gallery-scroll {
        margin-top: 36px;
    }

    .gallery-toolbar {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 38px;
    }

    .gallery-grid {
        grid-auto-rows: 230px;
        gap: 12px;
    }

    .gallery-card,
    .gallery-card-wide,
    .gallery-card-tall,
    .gallery-card-featured {
        grid-column: span 12;
        grid-row: span 1;
    }

    .gallery-card-featured {
        grid-row: span 2;
    }

    .gallery-cta-inner {
        padding: 48px 26px;
        border-radius: var(--radius-md);
    }

    .gallery-lightbox {
        padding: 14px;
    }

    .gallery-lightbox-dialog img {
        min-height: 190px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .gallery-card-button img,
    .gallery-lightbox-dialog,
    .gallery-lightbox {
        transition: none;
    }
}
