.image-collage {
    padding-top: 5vh;
    padding-bottom: 5vh;
    padding-left: 0;
    padding-right: 0;
}
.dynamic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.grid-item {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    border-radius: 5px;
}

.grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.grid-item:hover .grid-image {
    transform: scale(1.05);
}

.grid-item.small {
    flex-basis: calc(25% - 10px);
    aspect-ratio: 1;
}

.grid-item.medium {
    flex-basis: calc(33.333% - 10px);
    aspect-ratio: 4/3;
}

.grid-item.large {
    flex-basis: calc(50% - 10px);
    aspect-ratio: 16/9;
}

.grid-item.full-width {
    flex-basis: 100%;
    height: 300px; /* Hauteur fixe pour les images seules */
    max-height: 50vh; /* Limitation à 50% de la hauteur de la vue */
}

.grid-item.full-width .grid-image {
    object-fit: cover;
    object-position: center; /* Centre l'image */
}

/* Style pour la disposition spécifique de 3 images */
.three-images-layout .three-images-grid {
    display: flex;
    gap: 10px;
}

.three-images-layout .three-images-grid .left-column {
    flex: 1;
}

.three-images-layout .three-images-grid .right-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.three-images-layout .three-images-grid .right-column .top-right,
.three-images-layout .three-images-grid .right-column .bottom-right {
    width: 100%;
    flex: 1;
}

.three-images-layout .grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Ajout de l'effet de survol pour les images dans la disposition de 3 images */
.three-images-layout .grid-item .grid-image {
    transition: transform 0.3s ease;
}

.three-images-layout .grid-item:hover .grid-image {
    transform: scale(1.05);
}

/* Responsive Styles */
@media screen and (max-width: 1024px) {
    .grid-item.small, .grid-item.medium {
        flex-basis: calc(33.333% - 10px);
    }
    .grid-item.large {
        flex-basis: calc(66.666% - 10px);
    }

    .three-images-layout .three-images-grid {
        flex-direction: column;
    }
    
    .three-images-layout .three-images-grid .left-column,
    .three-images-layout .three-images-grid .right-column {
        flex: 1;
        order: 0;
    }

    .three-images-layout .three-images-grid .right-column {
        display: flex;
        flex-direction: row;
        gap: 10px;
    }

    .three-images-layout .three-images-grid .right-column .top-right,
    .three-images-layout .three-images-grid .right-column .bottom-right {
        width: 50%;
        height: auto;
    }
}

@media screen and (max-width: 768px) {
    .grid-item.small, .grid-item.medium, .grid-item.large {
        flex-basis: calc(50% - 10px);
    }
    .grid-item.full-width {
        height: 250px;
    }

    .three-images-layout .three-images-grid {
        flex-direction: column;
    }
    
    .three-images-layout .three-images-grid .left-column,
    .three-images-layout .three-images-grid .right-column {
        flex: 1;
        order: 0;
    }

    .three-images-layout .three-images-grid .right-column {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .three-images-layout .three-images-grid .right-column .top-right,
    .three-images-layout .three-images-grid .right-column .bottom-right {
        width: 100%;
        height: auto;
    }
}

@media screen and (max-width: 480px) {
    .grid-item.small, .grid-item.medium, .grid-item.large, .grid-item.full-width {
        flex-basis: 100%;
    }
    .grid-item.full-width {
        height: 200px;
    }

    .three-images-layout .three-images-grid {
        flex-direction: column;
    }
    
    .three-images-layout .three-images-grid .left-column,
    .three-images-layout .three-images-grid .right-column {
        flex: 1;
        order: 0;
    }

    .three-images-layout .three-images-grid .right-column {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .three-images-layout .three-images-grid .right-column .top-right,
    .three-images-layout .three-images-grid .right-column .bottom-right {
        width: 100%;
        height: auto;
    }
}
/* Override des styles Tailwind prose */
.prose .image-collage {
    width: 100% !important;
    max-width: 70ch !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 1rem 0 !important;
}

.prose .image-collage img {
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.prose .image-collage .grid-item {
    margin: 0 !important;
}

.prose .image-collage .dynamic-grid,
.prose .image-collage .three-images-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

/* Le reste du CSS reste identique */