/* =========================================================
   ARC · Gallery Styles
   ========================================================= */

.gallery-page {
    padding: 70px 0 90px;
}

.gallery-page .section-header {
    margin-bottom: 34px;
}

.gallery-page h1 {
    font-size: clamp(2rem, 3.6vw, 2.8rem);
    margin: 6px 0 12px;
}

.gallery-page h1 em {
    font-style: normal;
    color: var(--gold-deep);
}

/* FILTROS */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.filter-chip {
    background: var(--brand-white);
    border: 2px solid var(--color-gray-border);
    padding: 9px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-gray);
}

.filter-chip:hover {
    border-color: var(--brand-gold);
    color: var(--ink);
}

.filter-chip.active {
    background: var(--color-dark);
    border-color: var(--color-dark);
    color: var(--brand-white);
}

/* BENTO GRID DINÁMICO */
.gallery-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 1050px;
    margin: 0 auto;
    grid-auto-flow: dense;
}

.gallery-bento .item {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--color-light);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
}

.gallery-bento .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.gallery-bento .item:hover img {
    transform: scale(1.08);
}

.gallery-bento .item:hover {
    border-color: var(--brand-gold);
    z-index: 2;
    box-shadow: var(--shadow-hover);
}

/* Item Destacado (ocupa 2x2) */
.gallery-bento .item.featured {
    grid-row: span 2;
    aspect-ratio: 1;
}

/* Item ancho (ocupa 2 columnas) */
.gallery-bento .item.wide {
    grid-column: span 2;
    aspect-ratio: 2/1;
}

/* Para el primer item si no hay featured, hacerlo featured por defecto */
.gallery-bento .item:first-child:not(.featured):not(.wide) {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: 1;
}

/* Overlay de gradiente */
.gallery-bento .item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.65) 100%);
    pointer-events: none;
}

/* Etiqueta (label) */
.gallery-bento .item .label {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    z-index: 2;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

/* Badge */
.gallery-bento .item .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--brand-gold);
    color: var(--brand-black);
    font-weight: 700;
    font-size: 0.65rem;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Botón cargar más */
.gallery-more {
    text-align: center;
    margin-top: 36px;
}

/* Sin resultados */
.gallery-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray);
    font-size: 1.05rem;
}

/* Galería vacía */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-gray);
}

.gallery-empty p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* LIGHTBOX */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.open {
    display: flex;
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.2rem;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    z-index: 10;
    line-height: 1;
}

.lightbox .close:hover {
    color: var(--brand-gold);
    transform: rotate(90deg);
}

.lightbox .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 2.2rem;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.lightbox .nav-btn:hover {
    background: var(--brand-gold);
    color: var(--brand-black);
}

.lightbox .nav-btn.prev {
    left: 20px;
}

.lightbox .nav-btn.next {
    right: 20px;
}

.lightbox .lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
    background: #1a1a1a;
}

.lightbox .counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
    font-family: var(--font-mono);
}

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

@media (max-width: 768px) {
    .gallery-bento {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-bento .item.featured,
    .gallery-bento .item:first-child:not(.wide) {
        grid-column: span 2;
        grid-row: span 1;
        aspect-ratio: 1;
    }

    .gallery-bento .item.wide {
        grid-column: span 2;
    }

    .lightbox .nav-btn {
        font-size: 1.4rem;
        padding: 8px 14px;
    }

    .gallery-bento .item .label {
        font-size: 0.75rem;
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-bento {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .gallery-bento .item.featured,
    .gallery-bento .item:first-child:not(.wide) {
        grid-column: span 2;
    }
}