/* ============================================================
   Pintxo – Gallery Page
   ============================================================ */

/* ---------- Page Wrapper ---------- */

.gallery-page {
    background: var(--color-white);
    color: var(--color-text);
    font-family: var(--font-body);
    overflow: hidden;
}

/* ============================================================
   GALLERY HERO
   ============================================================ */
.gallery-hero {
    position: relative;
    height: clamp(340px, 52vh, 540px);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

/*
 * Background image is passed via CSS custom property set inline
 * in gallery.php: style="--gallery-hero-bg: url('…');"
 * The element is pushed -8% on each edge so the parallax
 * translateY never reveals a gap at the top or bottom.
 */
.gallery-hero__bg {
    position: absolute;
    inset: -8%;
    background-image: var(--gallery-hero-bg);
    background-size: cover;
    background-position: center 40%;
    will-change: transform;
    z-index: 0;
}

/* Dark gradient — same feel as the menus page hero */
.gallery-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(10, 4, 4, 0.90) 0%,
            rgba(10, 4, 4, 0.62) 55%,
            rgba(10, 4, 4, 0.28) 100%);
    z-index: 1;
}

.gallery-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-white);
}

.gallery-hero__title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.1;
    margin: 0;
}

.gallery-hero__divider {
    width: 48px;
    height: 2px;
    background: var(--color-burgundy);
    margin: 10px auto 0;
}

/* ============================================================
   SHARED PRESET STRUCTURE
   ============================================================ */

.gallery-preset {
    width: min(1500px, calc(100% - 48px));
    margin: 0 auto;
}

.gallery-preset+.gallery-preset {
    margin-top: clamp(12px, 1.5vw, 24px);
}

.gallery-frame {
    position: relative;
    overflow: hidden;
    margin: 0;
    background: var(--color-black);
}

.gallery-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform var(--transition), filter var(--transition);
    will-change: transform;
}

/* ============================================================
   TEXT BLOCK PRESET
   ============================================================ */

.gallery-preset--text-block {
    padding: 30px 20px;
}

.gallery-text-block {
    text-align: center;
}

.gallery-section-body {
    max-width: 1200px;
    margin: 0 auto;
    color: var(--color-burgundy);
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    font-weight: 400;
    line-height: 1.9;
}

/* ============================================================
   PRESET 2: FULL WIDTH IMAGE
   ============================================================ */

.gallery-preset--full-width .gallery-frame {
    height: clamp(300px, 48vw, 640px);
}

/* ============================================================
   PRESET 3: TWO COLUMN IMAGES
   ============================================================ */

.gallery-preset--two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.gallery-preset--two-column .gallery-frame {
    aspect-ratio: 4 / 3;
}

/* ============================================================
   PRESET 4: THREE IMAGE ROW
   ============================================================ */

.gallery-preset--three-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.gallery-preset--three-row .gallery-frame {
    aspect-ratio: 4 / 3;
}

/* ============================================================
   PRESET 5: FEATURED MOSAIC A
   Matches the home gallery visual structure.
   ============================================================ */

.gallery-preset--mosaic-a {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 240px;
    gap: 6px;
}

.gallery-preset--mosaic-a .gallery-frame:nth-child(1) {
    grid-row: span 2;
}

.gallery-preset--mosaic-a .gallery-frame:nth-child(2) {
    grid-column: span 2;
}

/* ============================================================
   PRESET 6: FEATURED MOSAIC B
   Mirrored version of the home gallery structure.
   ============================================================ */

.gallery-preset--mosaic-b {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 240px;
    gap: 6px;
}

.gallery-preset--mosaic-b .gallery-frame:nth-child(1) {
    grid-column: span 2;
}

.gallery-preset--mosaic-b .gallery-frame:nth-child(4) {
    grid-column: 3;
    grid-row: 1 / span 2;
}

/* ============================================================
   PRESET 7: LARGE + THREE STACK
   ============================================================ */

.gallery-preset--large-stack {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(3, 180px);
    gap: 6px;
}

.gallery-preset--large-stack .gallery-frame:nth-child(1) {
    grid-row: 1 / span 3;
}

.gallery-preset--large-stack .gallery-frame:not(:first-child) {
    min-height: 0;
}

/* ============================================================
   PRESET 8: SIX IMAGE GRID
   ============================================================ */

.gallery-preset--six-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.gallery-preset--six-grid .gallery-frame {
    aspect-ratio: 4 / 3;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {

    .gallery-preset--mosaic-a,
    .gallery-preset--mosaic-b {
        grid-auto-rows: auto;
    }

    .gallery-preset--large-stack {
        grid-template-rows: repeat(3, 150px);
    }
}

@media (max-width: 900px) {
    .gallery-hero {
        min-height: 380px;
    }

    .gallery-preset {
        width: calc(100% - 32px);
    }

    .gallery-preset--three-row,
    .gallery-preset--six-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-preset--mosaic-a,
    .gallery-preset--mosaic-b {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
    }

    .gallery-preset--mosaic-a .gallery-frame:nth-child(1),
    .gallery-preset--mosaic-b .gallery-frame:nth-child(4) {
        grid-column: auto;
        grid-row: span 2;
    }

    .gallery-preset--mosaic-a .gallery-frame:nth-child(2),
    .gallery-preset--mosaic-b .gallery-frame:nth-child(1) {
        grid-column: span 1;
    }

    .gallery-preset--large-stack {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .gallery-preset--large-stack .gallery-frame:nth-child(1) {
        grid-column: span 2;
        grid-row: auto;
        aspect-ratio: 16 / 9;
    }

    .gallery-preset--large-stack .gallery-frame:not(:first-child) {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        min-height: 320px;
    }

    .gallery-hero__eyebrow {
        font-size: 0.68rem;
    }

    .gallery-hero__title {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    .gallery-section-title {
        font-size: 1.55rem;
    }

    .gallery-section-body {
        font-size: 1rem;
    }
}

@media (max-width: 560px) {
    .gallery-preset {
        width: 100%;
    }

    .gallery-preset--text-block {
        width: calc(100% - 40px);
    }

    .gallery-preset--two-column,
    .gallery-preset--three-row,
    .gallery-preset--mosaic-a,
    .gallery-preset--mosaic-b,
    .gallery-preset--large-stack,
    .gallery-preset--six-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .gallery-preset--two-column .gallery-frame,
    .gallery-preset--three-row .gallery-frame,
    .gallery-preset--mosaic-a .gallery-frame,
    .gallery-preset--mosaic-b .gallery-frame,
    .gallery-preset--large-stack .gallery-frame,
    .gallery-preset--six-grid .gallery-frame {
        grid-column: auto !important;
        grid-row: auto !important;
        aspect-ratio: 4 / 3;
    }

    .gallery-preset--mosaic-a .gallery-frame:nth-child(1),
    .gallery-preset--mosaic-b .gallery-frame:nth-child(4) {
        aspect-ratio: 3 / 4;
    }

    .gallery-preset--full-width .gallery-frame {
        height: 300px;
    }
}