.gallery {
    display: flex;
    column-gap: 3rem;
    max-width: 85vw;
    margin: 3rem auto;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
}
  
.gallery img {
    max-width: 11.5rem;
    max-height: 11.5rem;
    object-fit: contain;
    margin: 0 0 4rem 0;
    break-inside: avoid;
    cursor: pointer;
    /* Ajoutez ces lignes pour iOS */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

/* Ajoutez ce bloc pour iOS */
@supports (-webkit-touch-callout: none) {
    .gallery {
        display: block;
        -webkit-column-count: 3;
        -moz-column-count: 3;
        column-count: 3;
    }
    
    .gallery img {
        position: relative;
        z-index: 1;
        width: 100%;
        height: auto;
        display: block;
    }
}
  
@media (max-width: 900px) {
    .gallery {
        column-count: 3;
        -webkit-column-count: 3;
        -moz-column-count: 3;
    }
}
  
@media (max-width: 600px) {
    .gallery {
        column-gap: 0.5rem;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
    }
    .gallery img {
        margin: 0 0 4rem 0;
        max-width: 9rem;
        max-height: 9rem;
    }
}