/* ============================================================
   gallery.css
   ------------------------------------------------------------
   Sección Galería en masonry + lightbox custom (sin libs externas).
   Pensada para fotos de los espacios reales del restaurante.
   ============================================================ */


/* ------------------------------------------------------------
   Sección Galería
   ------------------------------------------------------------ */
.gallery-section {
    padding: 100px 32px 120px;
    background: linear-gradient(180deg, var(--blanco-perla) 0%, #F8F2E8 100%);
    position: relative;
}

.gallery-section .section-header {
    text-align: center;
    margin-bottom: 56px;
}

/* Masonry usando CSS columns (compatible con todos los navegadores) */
.gallery-masonry {
    max-width: 1400px;
    margin: 0 auto;
    column-count: 4;
    column-gap: 18px;
}

@media (max-width: 1100px) {
    .gallery-masonry { column-count: 3; }
}
@media (max-width: 760px) {
    .gallery-masonry { column-count: 2; column-gap: 12px; }
}
@media (max-width: 480px) {
    .gallery-masonry { column-count: 1; }
}

.gallery-item {
    break-inside: avoid;
    margin: 0 0 18px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(74, 52, 41, 0.08);
    transition: box-shadow 0.35s ease;
}

.gallery-item:hover {
    box-shadow: 0 14px 36px rgba(74, 52, 41, 0.18);
}

.gallery-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: 14px;
}

.gallery-trigger img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                filter 0.35s ease;
}

.gallery-item:hover .gallery-trigger img {
    transform: scale(1.04);
    filter: brightness(1.04);
}

.gallery-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 18px 14px;
    color: #fff;
    font-family: 'Valerius', 'Playfair Display', serif;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 15, 8, 0.78) 100%);
    transform: translateY(40%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
    pointer-events: none;
}

.gallery-item:hover figcaption,
.gallery-item:focus-within figcaption {
    transform: translateY(0);
    opacity: 1;
}


/* ------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 8, 4, 0.94);
    z-index: var(--z-modal-top, 1200);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox[hidden] {
    display: none;
}

.lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease;
}

.lightbox-caption {
    color: rgba(228, 212, 168, 0.92);
    font-family: 'Valerius', 'Playfair Display', serif;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    text-align: center;
}

.lightbox-counter {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(228, 212, 168, 0.7);
    font-family: 'Causten', 'Poppins', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(228, 212, 168, 0.25);
    color: rgba(228, 212, 168, 0.95);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease,
                transform 0.2s ease,
                border-color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    background: rgba(201, 169, 97, 0.25);
    border-color: var(--dorado-sutil, #C9A961);
    transform: scale(1.05);
}

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

.lightbox-prev { left: 22px;  top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 22px; top: 50%; transform: translateY(-50%); }

.lightbox-prev:hover, .lightbox-next:hover,
.lightbox-prev:focus-visible, .lightbox-next:focus-visible {
    transform: translateY(-50%) scale(1.05);
}

@media (max-width: 760px) {
    .lightbox { padding: 56px 12px 80px; }
    .lightbox-prev, .lightbox-next {
        width: 44px;
        height: 44px;
        bottom: 18px;
        top: auto;
        transform: none;
    }
    .lightbox-prev:hover, .lightbox-next:hover,
    .lightbox-prev:focus-visible, .lightbox-next:focus-visible {
        transform: scale(1.05);
    }
    .lightbox-prev { left: calc(50% - 60px); }
    .lightbox-next { right: calc(50% - 60px); }
    .lightbox-image { max-height: 65vh; }
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-item:hover .gallery-trigger img { transform: none; }
    .gallery-item figcaption {
        opacity: 1;
        transform: translateY(0);
    }
    .lightbox,
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        transition: none !important;
    }
}
