/* Gallery Styles for Events Page - Crèche Minibulle */

/* Gallery Description */
.gallery-description {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin: 20px 0 40px 0;
    font-style: italic;
}

/* Gallery Grid Container */
.event-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 40px 0;
    padding: 0;
}

/* Individual Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: #fff;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Gallery Link */
.gallery-link {
    display: block;
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

/* Gallery Images */
.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(87, 80, 160, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1.2);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.lightbox-title {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.lightbox-close:hover {
    background: #5750A0;
    color: white;
    transform: scale(1.1);
}

/* Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.lightbox-nav:hover {
    background: #5750A0;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

/* Gallery Counter */
.lightbox-counter {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .event-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        margin: 30px 0;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .gallery-description {
        font-size: 14px;
        margin: 15px 0 25px 0;
        padding: 0 10px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        position: fixed;
    }
    
    .lightbox-counter {
        top: 10px;
        left: 50%;
        position: fixed;
    }
}

@media screen and (max-width: 480px) {
    .event-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .lightbox-title {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Loading Animation */
.gallery-item.loading img {
    opacity: 0.5;
}

.gallery-item img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Focus States for Accessibility */
.gallery-link:focus {
    outline: 3px solid #5750A0;
    outline-offset: 2px;
}

.lightbox-close:focus,
.lightbox-nav:focus {
    outline: 2px solid #5750A0;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .event-gallery {
        display: block;
    }
    
    .gallery-item {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .gallery-overlay {
        display: none;
    }
}