/* 
 * TSK-007: Estilos para la sección de Galería 
 * Grid moderno, Lightbox y animaciones progresivas
 */

.gallery-section {
    padding: 60px 0;
    background: #fff;
}

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

.gallery-header h2 {
    font-size: 2.5rem;
    color: #1a3a5f;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.gallery-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color, #0056b3);
    border-radius: 2px;
}

/* --- Category Grouping Styles --- */
.gallery-category-group {
    margin-bottom: 80px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 10px;
}

.category-title {
    font-size: 1.8rem;
    color: #1a3a5f;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-count {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 250px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

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

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

/* Photo Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 86, 179, 0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    opacity: 0;
    transition: opacity 0.4s ease;
    color: white;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease 0.2s;
}

.gallery-item:hover .gallery-overlay h3 {
    opacity: 1;
    transform: translateY(0);
}

/* Lightbox / Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    display: block;
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
}

.lightbox-caption h4 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* Lightbox Controls */
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: none;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-title {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        padding: 0 5px;
    }

    .lightbox-btn {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}
