/* Estilos para las galerías de eventos */

.event-gallery {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.event-title {
    margin-bottom: 10px;
    color: #333;
    font-size: 2rem;
    font-weight: 700;
}

.event-date {
    margin-bottom: 20px;
    color: #666;
    font-style: italic;
    font-size: 1.1rem;
}

.gallery-grid {
    margin: 20px 0;
    display: grid;
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 12px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 28px;
    padding: 10px 15px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Event Galleries (múltiples eventos) */
.event-galleries {
    margin: 20px 0;
}

.latest-event {
    margin-bottom: 40px;
}

.latest-event-content {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.latest-event-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.latest-event-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.latest-event-content:hover img {
    transform: scale(1.05);
}

.latest-event-content .gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.3), transparent);
}

.latest-event-content .content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    color: white;
}

.latest-event-content .badge {
    display: inline-block;
    padding: 8px 20px;
    background: var(--picture-pad-primary, #007cba);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 25px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.latest-event-content h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.1;
}

.latest-event-content .event-date {
    font-size: 1.2rem;
    margin-bottom: 20px;
    opacity: 0.9;
    font-weight: 500;
}

.latest-event-content .event-description {
    font-size: 1.1rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Other Events Grid */
.other-events h3 {
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
    font-weight: 700;
}

.events-grid {
    display: grid;
    gap: 25px;
}

.event-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.event-card:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.event-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-card:hover img {
    transform: scale(1.1);
}

.event-card .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    transition: background 0.3s ease;
}

.event-card:hover .overlay {
    background: rgba(0,0,0,0.2);
}

.event-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    color: white;
}

.event-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.event-card .card-date {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .latest-event-content h2 {
        font-size: 2.5rem;
    }
    
    .latest-event-content {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .events-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .latest-event-content {
        height: 300px;
    }
    
    .latest-event-content h2 {
        font-size: 2rem;
    }
    
    .latest-event-content .content-overlay {
        padding: 25px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 8px;
        font-size: 20px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 24px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
    
    .events-grid {
        grid-template-columns: 1fr !important;
    }
    
    .latest-event-content {
        height: 250px;
    }
    
    .latest-event-content h2 {
        font-size: 1.5rem;
    }
    
    .latest-event-content .content-overlay {
        padding: 20px;
    }
    
    .event-title {
        font-size: 1.5rem;
    }
    
    .other-events h3 {
        font-size: 1.5rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-gallery,
.event-galleries {
    animation: fadeIn 0.6s ease-out;
}

.gallery-item,
.event-card {
    animation: fadeIn 0.4s ease-out;
}

/* Estados de carga */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--picture-pad-primary, #007cba);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mejoras de accesibilidad */
.gallery-item:focus,
.event-card:focus,
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 2px solid var(--picture-pad-primary, #007cba);
    outline-offset: 2px;
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .event-title,
    .other-events h3 {
        color: #e0e0e0;
    }
    
    .event-date {
        color: #b0b0b0;
    }
    
    .gallery-item {
        background: #2a2a2a;
    }
    
    .event-card {
        background: #2a2a2a;
    }
}

