/**
 * ============================================================
 * FILE: imagen.css
 * PAGE: imagen.php
 *
 * Restaurant gallery styles.
 * Uses home.css for the shared restaurant header and video hero.
 * ============================================================
 */

/* =========================================================
   VIDEO HERO
   The main visual treatment comes from home.css.
   These rules only tune it for the gallery page.
========================================================= */

.gallery-video-hero {
    min-height: 68vh;
}

.gallery-video-content {
    max-width: 820px;
}

.gallery-video-content h1 {
    max-width: 780px;
}

.gallery-page {
    width: min(1260px, calc(100% - 36px));
    margin: 0 auto;
    padding: 58px 0 72px;
}

.gallery-intro {
    max-width: 820px;
    margin: 0 auto 42px;
    text-align: center;
}

.gallery-intro h1 {
    margin: 0;
    color: var(--dark);
    font-size: clamp(3rem, 7vw, 6.4rem);
    line-height: .9;
    letter-spacing: -.065em;
}

.gallery-intro p {
    max-width: 650px;
    margin: 22px auto 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

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

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 240px;
    gap: 18px;
}

/*
 * A few larger cards give the gallery a magazine-style
 * layout without requiring JavaScript positioning.
 */
.gallery-card:nth-child(7n + 1) {
    grid-row: span 2;
}

.gallery-card:nth-child(7n + 5) {
    grid-column: span 2;
}

.gallery-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 1px solid rgba(91, 56, 33, .13);
    border-radius: 24px;
    background: #2b1a11;
    box-shadow: var(--shadow);
    cursor: pointer;
    isolation: isolate;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform .6s ease,
        filter .45s ease;
}

.gallery-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(
            to top,
            rgba(23, 16, 12, .74),
            transparent 55%
        );
    opacity: .72;
    transition: opacity .3s ease;
}

.gallery-card:hover img {
    transform: scale(1.07);
    filter: brightness(.88);
}

.gallery-card:hover::after {
    opacity: 1;
}

.gallery-card-number {
    position: absolute;
    z-index: 3;
    top: 14px;
    left: 14px;

    display: grid;
    place-items: center;

    min-width: 38px;
    height: 30px;
    padding: 0 10px;

    border-radius: 999px;

    color: #fff;
    background: rgba(23, 16, 12, .62);

    font-size: .72rem;
    font-weight: 900;

    backdrop-filter: blur(8px);
}

.gallery-card-overlay {
    position: absolute;
    z-index: 3;
    right: 18px;
    bottom: 17px;
    left: 18px;

    color: #fff;

    text-align: left;

    transform: translateY(7px);
    transition: transform .3s ease;
}

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

.gallery-card-overlay strong,
.gallery-card-overlay small {
    display: block;
}

.gallery-card-overlay strong {
    font-size: 1.05rem;
}

.gallery-card-overlay small {
    margin-top: 3px;
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
}

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

.gallery-empty {
    max-width: 680px;
    margin: 50px auto;
    padding: 52px 28px;

    border: 1px solid var(--line);
    border-radius: var(--radius);

    background: rgba(255, 248, 239, .78);
    box-shadow: var(--shadow);

    text-align: center;
}

.gallery-empty-icon {
    display: block;
    color: var(--brand);
    font-size: 3rem;
}

.gallery-empty h2 {
    margin: 14px 0 8px;
    color: var(--dark);
}

.gallery-empty p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

/* =========================================================
   HOME BUTTON
========================================================= */

.gallery-home-wrap {
    display: flex;
    justify-content: center;
    margin-top: 38px;
}

.gallery-home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 0 22px;

    border-radius: 999px;

    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));

    box-shadow: 0 12px 28px rgba(135, 45, 24, .20);

    text-decoration: none;
    font-weight: 900;
}

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

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 38px 86px;

    background: rgba(10, 7, 5, .94);
    backdrop-filter: blur(14px);
}

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

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(1120px, 100%);
    max-height: calc(100vh - 70px);

    margin: 0;
}

.lightbox-content img {
    max-width: 100%;
    max-height: calc(100vh - 130px);

    border-radius: 18px;

    object-fit: contain;

    box-shadow: 0 28px 90px rgba(0, 0, 0, .42);
}

.lightbox-content figcaption {
    margin-top: 13px;
    color: rgba(255, 255, 255, .74);
    font-size: .9rem;
}

.lightbox-close,
.lightbox-arrow {
    position: absolute;
    z-index: 2;

    display: grid;
    place-items: center;

    border: 0;

    color: #fff;
    background: rgba(255, 255, 255, .10);

    cursor: pointer;

    backdrop-filter: blur(8px);
}

.lightbox-close {
    top: 20px;
    right: 20px;

    width: 46px;
    height: 46px;

    border-radius: 50%;

    font-size: 1.7rem;
}

.lightbox-arrow {
    top: 50%;
    width: 48px;
    height: 66px;

    border-radius: 18px;

    font-size: 2rem;

    transform: translateY(-50%);
}

.lightbox-arrow-left {
    left: 22px;
}

.lightbox-arrow-right {
    right: 22px;
}

/* Prevent background scrolling while lightbox is open. */
body.gallery-modal-open {
    overflow: hidden;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 220px;
    }

    .gallery-card:nth-child(7n + 5) {
        grid-column: span 1;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 620px) {
    .gallery-page {
        width: min(94%, 560px);
        padding-top: 38px;
    }

    .gallery-intro {
        margin-bottom: 28px;
    }

    .gallery-intro h1 {
        font-size: clamp(2.8rem, 14vw, 4.6rem);
    }

    /*
     * On mobile every image uses a simple single-column card.
     * This is easier to browse and tap than a complex mosaic.
     */
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 310px;
        gap: 14px;
    }

    .gallery-card:nth-child(n) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-lightbox {
        padding: 58px 14px 70px;
    }

    .lightbox-arrow {
        top: auto;
        bottom: 14px;

        width: 48px;
        height: 44px;

        transform: none;
    }

    .lightbox-arrow-left {
        left: calc(50% - 58px);
    }

    .lightbox-arrow-right {
        right: calc(50% - 58px);
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
    }

    .lightbox-content img {
        max-height: calc(100vh - 160px);
    }
}


@media (max-width: 620px) {
    .gallery-video-hero {
        min-height: 72vh;
    }

    .gallery-video-content h1 {
        font-size: clamp(2.8rem, 13vw, 4.5rem);
    }
}