/* =========================================================
   GALLERY — THE VISUAL ARCHIVE
========================================================= */

.gallery-page {
    min-height: 100vh;
    background: var(--background);
    color: var(--text-primary);
}

.gallery-page > .page-return {
    margin-left: max(2rem, calc((100% - 1180px) / 2 + 3rem));
}

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

.gallery-hero {
    min-height: 58vh;
    display: flex;
    align-items: center;
    padding: 5rem 2rem 6rem;
}

.gallery-hero-inner {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 0 3rem;
    box-sizing: border-box;
}

.gallery-hero h1 {
    max-width: 850px;
    margin: 0.65rem 0 1.4rem;
    color: #f4f2ec;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.gallery-introduction {
    max-width: 680px;
    margin: 0;
    color: #b8becf;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.8;
}

/* =========================================================
   MOONBORN COLLECTION
========================================================= */

.gallery-section {
    width: min(1180px, calc(100% - 4rem));
    margin: 0 auto;
    padding: 7rem 3rem 9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}

.gallery-section-heading {
    max-width: 720px;
    margin-bottom: 4.5rem;
}

.gallery-section-heading h2 {
    margin: 0.65rem 0 1rem;
    color: #f4f2ec;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.6rem, 5vw, 4.5rem);
    font-weight: 400;
    line-height: 1.05;
}

.gallery-section-heading > p:last-child {
    max-width: 58ch;
    margin: 0;
    color: #b8becf;
    line-height: 1.8;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2rem, 4vw, 4.5rem);
}

.gallery-artwork {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    background: #090c13;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
    cursor: zoom-in;
    appearance: none;
    transition:
        transform 320ms ease,
        border-color 320ms ease,
        box-shadow 320ms ease;
}

.gallery-artwork img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-artwork:hover {
    transform: translateY(-4px);
    border-color: rgba(199, 179, 122, 0.34);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.gallery-artwork:hover img {
    transform: scale(1.012);
}

.gallery-artwork:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 5px;
}

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

.gallery-lightbox {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(5, 8, 14, 0.96);
    color: #f4f2ec;
}

.gallery-lightbox::backdrop {
    background: rgba(5, 8, 14, 0.96);
}

.gallery-lightbox[open] {
    display: grid;
    place-items: center;
}

.gallery-lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4.5rem 2rem 2rem;
    box-sizing: border-box;
}

.gallery-lightbox-image {
    display: block;
    max-width: min(86vw, 980px);
    max-height: calc(100vh - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox-title {
    margin: 1rem 0 0;
    color: #b8becf;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.1rem;
    font-style: italic;
}

.gallery-lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f4f2ec;
    font-family: Arial, sans-serif;
    font-size: 2rem;
    font-weight: 200;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 180ms ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
    opacity: 1;
}

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

@media (max-width: 950px) {
    .gallery-page > .page-return {
        margin-left: 3.25rem;
    }

    .gallery-hero {
        min-height: auto;
        padding: 4rem 1.5rem 5rem;
    }

    .gallery-hero-inner {
        padding: 0 1.75rem;
    }

    .gallery-section {
        width: calc(100% - 3rem);
        padding: 5.5rem 1.75rem 7rem;
    }
}

@media (max-width: 650px) {
    .gallery-page > .page-return {
        margin-left: 1.75rem;
    }

    .gallery-hero-inner {
        padding: 0;
    }

    .gallery-section {
        width: calc(100% - 2rem);
        padding: 4.5rem 1.25rem 6rem;
    }

    .gallery-section-heading {
        margin-bottom: 3rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gallery-lightbox-inner {
        padding: 4rem 1rem 1.5rem;
    }

    .gallery-lightbox-image {
        max-width: 94vw;
        max-height: calc(100vh - 7rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-artwork,
    .gallery-artwork img {
        transition: none;
    }
}
