* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: CeraMedium;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: normal;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* Filtres pour desktop */
.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 20px;
    background-color: #ecf0f1;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #d5dbdb;
}

.filter-btn.active {
    background-color: #e2efff;
    /* color: white; */
}

/* Custom Dropdown for Mobile */
.custom-dropdown {
    display: none;
    position: relative;
    width: 100%;
    margin-bottom: 25px;
}

.custom-dropdown-trigger {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 1rem;
    color: #2c3e50;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-family: CeraMedium;
}

.custom-dropdown-trigger:hover {
    border-color: #bbb;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.custom-dropdown-text {
    flex: 1;
}

.custom-dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #7f8c8d;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
    margin-top: 5px;
}

.custom-dropdown.open .custom-dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
    opacity: 1;
}

.custom-dropdown-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1rem;
    color: #2c3e50;
    font-family: CeraMedium;
}

.custom-dropdown-option:hover {
    background-color: #f5f7fa;
}

.custom-dropdown-option.active {
    background-color: #e2efff;
    font-weight: 600;
}

.custom-dropdown-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.custom-dropdown-option:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 10px;
    /* Petit incrément pour le masonry */
    gap: 15px;
    margin-bottom: 30px;
}

.gallery-item {
    overflow: hidden;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    /* grid-row-end sera défini dynamiquement par JavaScript */
}

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

.gallery-img-container {
    width: 100%;
    /* Pas de hauteur fixe - permet aux images de garder leurs proportions naturelles */
    overflow: hidden;
    background-color: transparent;
}

.gallery-img {
    width: 100%;
    height: auto;
    /* Hauteur automatique pour garder les proportions */
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.5s ease, opacity 0.5s ease;
    transform: scale(0.95);
    opacity: 0;
    background-color: transparent;
}

.gallery-img.loaded {
    transform: scale(1);
    opacity: 1;
}

.gallery-content {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
    background-color: transparent;
}

.gallery-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #2c3e50;
    text-align: center;
    font-weight: normal;
    background-color: transparent;
    padding: 5px 10px;
    border-radius: 5px;
    position: relative;
    z-index: 2;
}

/* Masquer la catégorie sur tous les écrans */
.gallery-category {
    display: none;
}

.load-more-container {
    text-align: center;
    margin: 30px 0;
    background-color: transparent;
}

.load-more-btn {
    padding: 12px 30px;
    background-color: #e2efff;
    /* color: white; */
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: block !important;
}

.load-more-btn:hover {
    background-color: #2980b9;
}

.load-more-btn.hidden {
    display: none !important;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #7f8c8d;
    border-top: 1px solid #ecf0f1;
    background-color: transparent;
}

/* Modal de zoom */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    animation: zoomIn 0.3s ease;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    background-color: transparent;
}

.modal-title {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 16px;
    background-color: transparent;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
    background-color: transparent;
    border: none;
}

.close-btn:hover {
    color: #e2efff;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
    z-index: 1001;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.prev-btn {
    left: 25px;
}

.next-btn {
    right: 25px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

@media (max-width: 600px) {

    /* Masquer le titre sur mobile */
    .desktop-title {
        display: none;
    }

    /* Masquer les boutons de filtre sur mobile */
    .filter-buttons {
        display: none;
    }

    /* Afficher le dropdown personnalisé sur mobile */
    .custom-dropdown {
        display: block;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Masquer le titre des images sur mobile */
    .gallery-title {
        display: none;
    }

    /* Réduire l'espace autour de l'image sur mobile */
    .gallery-content {
        padding: 5px 0;
    }

    .modal-content {
        max-width: 95%;
        max-height: 80%;
    }

    .modal-title {
        font-size: 1.2rem;
    }
}


.filter-buttons button {
    font-weight: initial;
}

.filter-btn:focus,
.loadMore-btn:focus {
    border: none;
    outline: none;
    background-color: #e2efff;

}