/* Styles spécifiques à la galerie */

/* Grille de la galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.gallery-item {
    position: relative;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: #f0f0f0;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Overlay au survol */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    color: white;
    width: 100%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay-content {
    transform: translateY(0);
}

.gallery-overlay-content i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.gallery-overlay-content h4 {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 5px;
    line-height: 1.3;
}

.gallery-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.gallery-date {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 10px;
}

.gallery-link {
    display: inline-block;
    color: white;
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.gallery-link:hover {
    color: var(--primary-light);
}

/* Info galerie */
.gallery-info {
    margin-bottom: 20px;
    padding: 10px 0;
    color: var(--text-light);
    font-size: 1rem;
}

.gallery-info i {
    color: var(--primary);
    margin-right: 5px;
}

/* Lightbox améliorée */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.lightbox-close:hover {
    transform: rotate(90deg);
    background: rgba(255,255,255,0.2);
}

/* Navigation lightbox */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10000;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 20px;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.pagination-numbers {
    display: flex;
    gap: 5px;
}

.pagination-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.pagination-number:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-number.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination-dots {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: 600;
}

/* État vide amélioré */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--light);
    border-radius: 10px;
}

.empty-state i {
    font-size: 5rem;
    color: var(--border);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-light);
    margin-bottom: 15px;
}

.empty-state p {
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto 20px;
}

/* Animation de chargement */
.gallery-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Délai d'animation pour chaque élément */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }
.gallery-item:nth-child(10) { animation-delay: 1s; }
.gallery-item:nth-child(11) { animation-delay: 1.1s; }
.gallery-item:nth-child(12) { animation-delay: 1.2s; }

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .gallery-overlay-content h4 {
        font-size: 1rem;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-close {
        font-size: 2.5rem;
        top: 10px;
        right: 20px;
    }
    
    .pagination-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .pagination-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item {
        height: 300px;
    }
    
    .lightbox-nav {
        display: none;
    }
    
    .pagination-numbers {
        gap: 3px;
    }
    
    .pagination-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}