/* ============================================
   FORDEMA — Estilos Galería
   ============================================ */

/* --- HERO --- */
.galeria-hero {
    position: relative;
    height: 48vh;
    min-height: 350px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    background-color: #1a2d42;
}

.galeria-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.galeria-hero .hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.galeria-hero h2 {
    font-size: 3.5em;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.galeria-hero p {
    font-size: 1.3em;
    font-weight: 300;
    font-style: italic;
    color: rgba(255,255,255,0.85);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* --- GALLERY GRID --- */
.gallery-grid-section {
    padding: 20px 5%;
    background-color: #1a2d42;
    border-top: 4px solid #a8c528;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-auto-rows: 140px;
    grid-auto-flow: dense;
    gap: 4px;
    padding: 0;
}

.gallery-item {
    overflow: hidden;
    cursor: pointer;
}

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

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

/* Mosaic — wider items (2 columns) */
.gallery-item:nth-child(1),
.gallery-item:nth-child(6),
.gallery-item:nth-child(13),
.gallery-item:nth-child(19) {
    grid-column: span 2;
}

/* Mosaic — taller items (2 rows) */
.gallery-item:nth-child(3),
.gallery-item:nth-child(10),
.gallery-item:nth-child(17),
.gallery-item:nth-child(23) {
    grid-row: span 2;
}

/* Extra large (2x2) */
.gallery-item:nth-child(1) {
    grid-row: span 2;
}

/* Empty gallery message */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #777;
    font-size: 1.2em;
    padding: 60px 20px;
    font-style: italic;
}

/* --- LIGHTBOX --- */
#lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#lightbox.activo {
    display: flex;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 3px solid #ecb94a;
}

#lightbox-cerrar {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
    z-index: 10;
}

#lightbox-cerrar:hover {
    color: #ecb94a;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 2em;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(236, 185, 74, 0.8);
}

#lightbox-prev {
    left: 20px;
}

#lightbox-next {
    right: 20px;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: 118px;
    }

    .galeria-hero h2 {
        font-size: 3em;
    }
}

@media (max-width: 768px) {
    .galeria-hero h2 {
        font-size: 2.5em;
    }

    .galeria-hero p {
        font-size: 1em;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 102px;
    }

    .gallery-grid-section {
        padding: 15px 3%;
    }
}
