body {
    font-family: 'Arial', sans-serif;
    background-color: #111;
    color: #fff;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden; /* Empêche le débordement horizontal */
}

/* En-tête de la galerie */
h2 {
    font-size: 2rem;
    text-align: center;
    margin: 20px 0;
    color: #00ff99;
}

/* Barre de recherche */
#searchInput {
    padding: 10px;
    margin: 10px auto;
    border: 2px solid #00ff99;
    background: #222;
    color: #fff;
    width: 80%;
    max-width: 400px;
    border-radius: 5px;
    font-size: 1rem;
    display: block;
    box-sizing: border-box;
}

/* Conteneur principal */
#gallery-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Grille de la galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Carte d'image */
.gallery-item {
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
    max-width: 100%;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    gap: 10px;
    width: 100%;
    max-width: 1000px;
}

button {
    background-color: transparent;
    border: 2px solid #00ff99;
    color: #00ff99;
    font-size: 1.5rem;
    padding: 10px;
    cursor: pointer;
    transition: color 0.3s ease-in-out;
}

button:hover {
    color: #fff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    overflow: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.close {
    color: #fff;
    font-size: 3rem;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
}

.close:hover {
    color: #00ff99;
}

.modal-nav {
    position: absolute;
    top: 50%;
    font-size: 3rem;
    background-color: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
}

.modal-nav:hover {
    color: #00ff99;
}

#prevImage { left: 10px; }
#nextImage { right: 10px; }

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    #searchInput {
        width: 90%;
    }

    button {
        font-size: 1.2rem;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    /* Empêche tout débordement en largeur */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #searchInput {
        width: 100%;
        padding: 6px;
    }

    button {
        font-size: 1rem;
        padding: 6px;
    }

    h2 {
        font-size: 1.5rem;
    }
}

        #gallery-logo img {
            width: 100%; /* S'ajuste automatiquement à l'espace disponible */
            max-width: 300px; /* Limite la taille maximale du logo à 300px */
            height: auto; /* Conserve les proportions de l'image */
            display: block; /* Empêche l'espace blanc sous l'image */
            margin: 0 auto; /* Centre l'image horizontalement */
            transition: transform 0.3s ease, opacity 0.3s ease; /* Ajoute une transition fluide */
            border-radius: 15px; /* Ajoute des bords arrondis */
        }

        #gallery-logo img:hover {
            transform: scale(1.1); /* Légère agrandissement au survol */
            opacity: 0.9; /* Diminution de l'opacité pour un effet de survol */
        }
