/* ==========================================================
   GMAHSSA PUBLIC GALLERY
========================================================== */

.public-gallery-page {
    overflow: hidden;
    background:
        linear-gradient(
            180deg,
            #f8fafc 0%,
            #ffffff 34%,
            #f8fafc 100%
        );
}


/* ==========================================================
   HERO
========================================================== */

.public-gallery-hero {
    position: relative;
    padding: clamp(7rem, 12vw, 10rem) 0
             clamp(4.5rem, 8vw, 7rem);
    overflow: hidden;
}

.public-gallery-hero::before {
    content: "";
    position: absolute;
    width: 38rem;
    height: 38rem;
    top: -22rem;
    right: -10rem;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(180, 140, 70, 0.12),
            transparent 70%
        );
    pointer-events: none;
}

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

.public-gallery-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8b6a31;
}

.public-gallery-eyebrow span {
    width: 2.8rem;
    height: 1px;
    background: currentColor;
}

.public-gallery-hero-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.65fr)
        minmax(15rem, 0.55fr);
    gap: clamp(3rem, 7vw, 8rem);
    align-items: end;
}

.public-gallery-hero-copy h1 {
    max-width: 850px;
    margin: 0;
    font-size: clamp(3.5rem, 8vw, 7.7rem);
    line-height: 0.92;
    letter-spacing: -0.055em;
    font-weight: 700;
    color: #111827;
}

.public-gallery-hero-copy h1 em {
    display: block;
    margin-left: clamp(1.6rem, 8vw, 7rem);
    color: #9a783d;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
}

.public-gallery-hero-copy p {
    max-width: 690px;
    margin: 2.4rem 0 0;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.85;
    color: #64748b;
}

.public-gallery-hero-meta {
    padding-bottom: 0.5rem;
}

.public-gallery-stat {
    padding-bottom: 1.65rem;
    margin-bottom: 1.65rem;
    border-bottom: 1px solid rgba(17, 24, 39, 0.12);
}

.public-gallery-stat strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 1;
    letter-spacing: -0.06em;
    color: #111827;
}

.public-gallery-stat span {
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.public-gallery-home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #111827;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        gap 180ms ease,
        color 180ms ease;
}

.public-gallery-home-link:hover {
    gap: 1rem;
    color: #8b6a31;
}


/* ==========================================================
   CONTENT
========================================================== */

.public-gallery-content {
    padding: 0 0 clamp(6rem, 10vw, 10rem);
}

.public-gallery-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(17, 24, 39, 0.11);
}

.public-gallery-intro p {
    max-width: 590px;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #475569;
}

.public-gallery-intro span {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: #94a3b8;
}


/* ==========================================================
   GRID
========================================================== */

.public-gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: clamp(0.85rem, 1.6vw, 1.4rem);
}

.public-gallery-item {
    grid-column: span 4;
    min-width: 0;
}

.public-gallery-item:nth-child(8n + 1),
.public-gallery-item:nth-child(8n + 6) {
    grid-column: span 8;
}

.public-gallery-item:nth-child(8n + 1)
.public-gallery-photo,
.public-gallery-item:nth-child(8n + 6)
.public-gallery-photo {
    aspect-ratio: 16 / 9;
}

.public-gallery-item:nth-child(8n + 4)
.public-gallery-photo {
    aspect-ratio: 4 / 5;
}

.public-gallery-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 1.15rem;
    background: #e5e7eb;
    cursor: zoom-in;
    text-align: left;
    box-shadow:
        0 8px 30px rgba(15, 23, 42, 0.05);
}

.public-gallery-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition:
        transform 700ms
        cubic-bezier(0.2, 0.75, 0.25, 1);
}

.public-gallery-photo-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            transparent 45%,
            rgba(2, 6, 23, 0.72) 100%
        );
    opacity: 0.72;
    transition: opacity 300ms ease;
}

.public-gallery-expand {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.93);
    color: #111827;
    transform: translateY(-0.5rem);
    opacity: 0;
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

.public-gallery-photo-info {
    position: absolute;
    left: 1.35rem;
    right: 1.35rem;
    bottom: 1.3rem;
    z-index: 2;
    color: white;
}

.public-gallery-photo-info strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    line-height: 1.3;
}

.public-gallery-photo-info small {
    display: block;
    max-width: 34rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
}

.public-gallery-photo:hover img {
    transform: scale(1.045);
}

.public-gallery-photo:hover
.public-gallery-photo-shade {
    opacity: 0.92;
}

.public-gallery-photo:hover
.public-gallery-expand {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================
   EMPTY STATE
========================================================== */

.public-gallery-empty {
    max-width: 700px;
    margin: 2rem auto 0;
    padding: clamp(4rem, 9vw, 7rem) 2rem;
    text-align: center;
}

.public-gallery-empty-icon {
    width: 5rem;
    height: 5rem;
    display: grid;
    place-items: center;
    margin: 0 auto 2rem;
    border-radius: 50%;
    border: 1px solid rgba(154, 120, 61, 0.25);
    background: rgba(154, 120, 61, 0.06);
    color: #9a783d;
    font-size: 1.6rem;
}

.public-gallery-empty > span {
    display: block;
    margin-bottom: 0.9rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9a783d;
}

.public-gallery-empty h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.8rem);
    letter-spacing: -0.04em;
    color: #111827;
}

.public-gallery-empty p {
    max-width: 500px;
    margin: 1.3rem auto 2rem;
    line-height: 1.75;
    color: #64748b;
}

.public-gallery-empty a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #111827;
    font-weight: 700;
    text-decoration: none;
}


/* ==========================================================
   LIGHTBOX
========================================================== */

.public-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: stretch;
    justify-content: stretch;
}

.public-gallery-lightbox.is-open {
    display: flex;
}

.public-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.96);
    backdrop-filter: blur(14px);
}

.public-gallery-lightbox-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.public-gallery-lightbox-toolbar {
    height: 5.5rem;
    padding: 0 clamp(1.2rem, 4vw, 3.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.68);
}

.public-gallery-lightbox-toolbar span {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
}

.public-gallery-lightbox-close {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
    transition:
        background 180ms ease,
        transform 180ms ease;
}

.public-gallery-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: rotate(5deg);
}

.public-gallery-lightbox-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns:
        clamp(3.5rem, 7vw, 6.5rem)
        minmax(0, 1fr)
        clamp(3.5rem, 7vw, 6.5rem);
    align-items: center;
}

.public-gallery-lightbox-figure {
    min-width: 0;
    margin: 0;
    text-align: center;
}

.public-gallery-lightbox-figure img {
    display: block;
    max-width: min(1100px, 100%);
    max-height: calc(100vh - 13rem);
    width: auto;
    height: auto;
    margin: auto;
    object-fit: contain;
    border-radius: 0.8rem;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.35);
}

.public-gallery-lightbox-figure figcaption {
    max-width: 750px;
    margin: 1.4rem auto 1.5rem;
    color: white;
}

.public-gallery-lightbox-figure strong {
    display: block;
    font-size: 1.05rem;
}

.public-gallery-lightbox-figure p {
    margin: 0.45rem 0 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.63);
}

.public-gallery-lightbox-arrow {
    width: 3.3rem;
    height: 3.3rem;
    display: grid;
    place-items: center;
    justify-self: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    transition:
        background 180ms ease,
        transform 180ms ease;
}

.public-gallery-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: scale(1.05);
}

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


/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 991px) {

    .public-gallery-hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .public-gallery-hero-meta {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 2rem;
    }

    .public-gallery-stat {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .public-gallery-item,
    .public-gallery-item:nth-child(8n + 1),
    .public-gallery-item:nth-child(8n + 6) {
        grid-column: span 6;
    }

    .public-gallery-item:nth-child(8n + 1)
    .public-gallery-photo,
    .public-gallery-item:nth-child(8n + 6)
    .public-gallery-photo {
        aspect-ratio: 4 / 3;
    }

}

@media (max-width: 767px) {

    .public-gallery-hero {
        padding-top: 6.5rem;
    }

    .public-gallery-hero-copy h1 {
        font-size: clamp(3.5rem, 18vw, 5rem);
    }

    .public-gallery-hero-copy h1 em {
        margin-left: 1.4rem;
    }

    .public-gallery-hero-meta {
        display: block;
    }

    .public-gallery-stat {
        margin-bottom: 1.75rem;
    }

    .public-gallery-intro {
        display: block;
    }

    .public-gallery-intro span {
        display: block;
        margin-top: 0.8rem;
    }

    .public-gallery-grid {
        gap: 0.8rem;
    }

    .public-gallery-item,
    .public-gallery-item:nth-child(8n + 1),
    .public-gallery-item:nth-child(8n + 6) {
        grid-column: span 12;
    }

    .public-gallery-photo,
    .public-gallery-item:nth-child(8n + 1)
    .public-gallery-photo,
    .public-gallery-item:nth-child(8n + 6)
    .public-gallery-photo,
    .public-gallery-item:nth-child(8n + 4)
    .public-gallery-photo {
        aspect-ratio: 4 / 3;
    }

    .public-gallery-expand {
        opacity: 1;
        transform: none;
    }

    .public-gallery-lightbox-stage {
        grid-template-columns: 1fr;
        padding: 0 1rem 1.5rem;
    }

    .public-gallery-lightbox-arrow {
        position: absolute;
        bottom: 1.1rem;
    }

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

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

    .public-gallery-lightbox-figure img {
        max-height: calc(100vh - 15rem);
    }

    .public-gallery-lightbox-figure figcaption {
        padding: 0 0.75rem 4.8rem;
    }

}

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

    .public-gallery-photo img,
    .public-gallery-expand,
    .public-gallery-home-link,
    .public-gallery-lightbox-close,
    .public-gallery-lightbox-arrow {
        transition: none;
    }

}
