/* ============================================
   SISTEMA DE GALERÍAS - LABERINTOS DEL CHIGUAZA
   Archivo reutilizable para todas las galerías
   Principio DRY: Don't Repeat Yourself
   ============================================ */

/* ====== MINIATURA INDIVIDUAL ====== */
.miniatura-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--borde-radio-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transicion-normal);
    box-shadow: var(--sombra-sm);
}

.miniatura-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.miniatura-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-lg);
}

.miniatura-item:hover img {
    transform: scale(1.1);
}

/* Overlay de la miniatura */
.miniatura-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(13, 64, 24, 0.8) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transicion-normal);
}

.miniatura-item:hover .miniatura-overlay {
    opacity: 1;
}

.miniatura-ver {
    background: var(--color-acento);
    color: var(--color-primario-oscuro);
    padding: var(--espacio-xs) var(--espacio-md);
    border-radius: var(--borde-radio-full);
    font-size: var(--texto-sm);
    font-weight: var(--peso-bold);
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(20px);
    transition: var(--transicion-normal);
}

.miniatura-item:hover .miniatura-ver {
    transform: translateY(0);
}

/* ====== LIGHTBOX ====== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--espacio-lg);
    animation: fadeIn 0.3s ease;
}

.lightbox.activo {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Contenedor de la imagen */
.lightbox-contenedor {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--espacio-md);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Imagen principal */
.lightbox-imagen {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--borde-radio-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Título de la foto */
.lightbox-titulo {
    color: var(--color-blanco);
    font-size: var(--texto-lg);
    font-weight: var(--peso-medium);
    text-align: center;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Contador de fotos */
.lightbox-contador {
    color: var(--color-acento);
    font-size: var(--texto-base);
    font-weight: var(--peso-bold);
    letter-spacing: 2px;
    background: rgba(0, 0, 0, 0.5);
    padding: var(--espacio-xs) var(--espacio-md);
    border-radius: var(--borde-radio-full);
    border: 1px solid var(--color-acento);
}

/* Botón cerrar (X) */
.lightbox-cerrar {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    background: var(--color-error);
    border: none;
    border-radius: var(--borde-radio-full);
    color: var(--color-blanco);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transicion-normal);
    z-index: 10;
    box-shadow: var(--sombra-lg);
}

.lightbox-cerrar:hover {
    background: var(--color-blanco);
    color: var(--color-error);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-cerrar svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Botones de navegación (anterior/siguiente) */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(244, 196, 48, 0.9);
    border: none;
    border-radius: var(--borde-radio-full);
    color: var(--color-primario-oscuro);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transicion-normal);
    z-index: 10;
    box-shadow: var(--sombra-lg);
}

.lightbox-nav:hover {
    background: var(--color-acento);
    transform: translateY(-50%) scale(1.15);
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.lightbox-anterior {
    left: -80px;
}

.lightbox-siguiente {
    right: -80px;
}

/* ====== RESPONSIVE - LIGHTBOX ====== */
@media (max-width: 992px) {
    .lightbox-anterior { left: 10px; }
    .lightbox-siguiente { right: 10px; }
    .lightbox-cerrar {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 768px) {
    .lightbox {
        padding: var(--espacio-md);
    }
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    .lightbox-nav svg {
        width: 22px;
        height: 22px;
    }
    .lightbox-anterior { left: 10px; }
    .lightbox-siguiente { right: 10px; }
    .lightbox-titulo {
        font-size: var(--texto-base);
    }
    .lightbox-contador {
        font-size: var(--texto-sm);
    }
}

@media (max-width: 576px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
    .lightbox-cerrar {
        width: 38px;
        height: 38px;
    }
    .lightbox-cerrar svg {
        width: 18px;
        height: 18px;
    }
    .lightbox-titulo {
        font-size: var(--texto-sm);
    }
}