.photo-gallery {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

@keyframes nextPhoto {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-824%, 0, 0); /* 8*100=800% photos + 3*8=24% gap */
    }
}

.photo-gallery-content {
    position: relative;
    max-width: 100%;
    display: flex;
    gap: 3%;
    animation: nextPhoto 50000ms linear forwards;
    animation-iteration-count: infinite;

    /* Safari fix */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.photo-gallery:hover .photo-gallery-content {
    animation-play-state: paused;
}

@media prefers-reduced-motion {
    .photo-gallery-content {
        animation: none;
    }
}

.gallery-photo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}
