/* --- SLIDER : on écrase le CSS natif de WordPress --- */
.mgs-slider,
.mgs-slider.wp-block-gallery,
ul.mgs-slider.gallery {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    padding: 0 0 10px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* On neutralise le grid-template-columns que WP peut poser en inline style */
.mgs-slider {
    grid-template-columns: none !important;
}

/* Tous les enfants directs (figure, li, div selon le type de galerie) */
.mgs-slider > * {
    flex: 0 0 auto !important;
    scroll-snap-align: start;
    width: 70% !important;
    max-width: 400px !important;
    margin: 0 !important;
    cursor: pointer;
}

.mgs-slider img {
    width: 100% !important;
    height: 260px !important;
    object-fit: cover !important;
    border-radius: 6px;
    display: block;
}

/* Certains thèmes ajoutent des marges/paddings sur figcaption, on nettoie */
.mgs-slider figcaption {
    margin: 4px 0 0 0;
}

@media (min-width: 782px) {
    .mgs-slider > * {
        width: 32% !important;
    }
}