/* ============================================
galeria.css
   ============================================ */

/* ── HEADER ── */
.sec-header-img {
    width: 100%;
    line-height: 0;
}

.sec-header-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── GALERÍA MASONRY ── */
.galeria-section {
    position: relative;
    padding: 64px 48px;
    background-image: url('../assets/img/fondos/fondos-varios-03.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.galeria-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 0;
}

.masonry {
    position: relative;
    z-index: 1;
    columns: 3;
    column-gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.masonry-overlay {
    position: absolute;
    inset: 0;
    background: rgba(192, 20, 26, 0.0);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.4s ease;
}

.masonry-overlay i {
    font-size: 32px;
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
}

.masonry-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.75);
}

.masonry-item:hover {
    box-shadow: 0 0 20px rgba(192, 20, 26, 0.5),
        0 0 40px rgba(192, 20, 26, 0.25);
    border-radius: 8px;
}

.masonry-item:hover .masonry-overlay {
    background: rgba(192, 20, 26, 0.3);
}

.masonry-item:hover .masonry-overlay i {
    opacity: 1;
    transform: scale(1);
}

/* ── LIGHTBOX ── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox.activo {
    display: flex;
}

.lightbox-img {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 60px rgba(192, 20, 26, 0.3);
}

.lightbox-cerrar {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(192, 20, 26, 0.8);
    border: none;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transicion);
}

.lightbox-cerrar:hover {
    background: var(--color-rojo);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--color-rojo-suave);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transicion);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-rojo);
    border-color: var(--color-rojo);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .masonry {
        columns: 2;
    }

    .galeria-section {
        padding: 48px 24px;
    }
}

@media (max-width: 480px) {
    .masonry {
        columns: 1;
    }

    .galeria-section {
        background-attachment: scroll;
    }
}