/* Styles pour la page galerie */

/* Hero section */
.gallery-hero {
    background-color: #34495e;
    color: #fff;
    text-align: center;
    padding: 3rem 0;
}

.gallery-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.gallery-hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Galerie */
.gallery {
    padding: 4rem 0;
    background-color: #f4f4f4;
}

/* Grille de la galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #fff;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

.gallery-caption {
    padding: 1rem;
    background-color: #fff;
}

.gallery-caption h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #2c3e50;
}

.gallery-caption p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Modal pour afficher les images agrandies */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.modal-caption {
    color: #fff;
    margin-top: 1rem;
    padding: 0 50px;
}

.modal-caption h3 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    color: #fff;
}

.modal-caption p {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #ccc;
}

.modal-counter {
    font-size: 0.9rem;
    color: #999;
    text-align: center;
}

.modal-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 75vh;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.15s ease;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    z-index: 10;
}

/* Navigation dans la modal */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    transition: background-color 0.3s ease;
    z-index: 5;
}

.modal-nav:hover {
    background-color: rgba(0,0,0,0.8);
}

.modal-prev {
    left: 10px;
}

.modal-next {
    right: 10px;
}

/* Media queries pour le responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-hero h1 {
        font-size: 2rem;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-nav {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .modal-caption {
        padding: 0 20px;
    }
}

/* Accessibilité */
.gallery-link:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

.modal-nav:focus, .modal-close:focus {
    outline: 2px solid #e74c3c;
}

/* Réduction des animations */
@media (prefers-reduced-motion: reduce) {
    .gallery-item, .gallery-item img, .modal-content img {
        transition: none !important;
    }
}