.APS3 {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: min(50vw, 500px);
    margin: 150px auto 0;
    overflow: hidden;
    background-color: #f7f7f7;
    transition: background-color 0.7s ease;
}

.APS3 > ul {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 100%;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.APS3 > ul > li {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.APS3 > ul > li.aps3-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.APS3 > ul > li > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 1000px;
    margin: auto;
    object-fit: contain;
    object-position: center;
}

/* Texte superposé sur desktop */
.APS3 > ul > li > div {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 700px;
    box-sizing: border-box;
    margin: 0;
    padding: 1.25rem;
    border-radius: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
}

.APS3 > ul > li > div h1 {
    margin: 0 0 0.75rem;
    color: #1d3e73;
}

.APS3 > ul > li > div p {
    margin: 0;
    font: 300 1rem/1.4rem "Roboto Condensed", sans-serif;
    color: #1d3e73;
}

/* Flèches */
.APS3 #previous,
.APS3 #next {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: block;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    transform: translateY(-50%);
    cursor: pointer;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.APS3 #previous {
    left: 10px;
    background-image: url("../images/arrowLeft.png");
}

.APS3 #next {
    right: 10px;
    background-image: url("../images/arrowRight.png");
}

/* Une seule diapositive */
.APS3.aps3-single #previous,
.APS3.aps3-single #next,
.APS3.aps3-single > ul > li > div {
    display: none;
}


/* ========================================
   CARROUSEL APS3 — MOBILE
======================================== */

@media screen and (max-width: 750px) {
    .APS3 {
        height: auto;
        margin-top: 70px;
        overflow: visible;
        background: transparent !important;
    }

    .APS3 > ul {
        height: auto;
        overflow: visible;
    }

    .APS3 > ul > li {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        height: auto;
    }

    .APS3 > ul > li.aps3-active {
        position: relative;
        inset: auto;
        height: auto;
    }

    .APS3 > ul > li > img {
        order:1;
        position: relative;
        inset: auto;
        display: block;
        width: 100%;
        max-width: 1000px;
        height: auto;
        margin: 0;
        object-fit: contain;
        flex: 0 0 auto;
    }

    .APS3 > ul > li > div {
        order:2;
        position: relative;
        inset: auto;
        left: auto;
        bottom: auto;
        transform: none;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 1rem;
        box-sizing: border-box;
        border-radius: 0;
        background: rgba(255, 255, 255, 1);
    }
    .APS3 > ul > li > div h1{
        text-align:center;
    }

    .APS3 #previous,
    .APS3 #next {
        top: 25vw;
    }
}


/* Très petits écrans */
@media (max-width: 350px) {
    .APS3 #previous,
    .APS3 #next {
        width: 32px;
        height: 32px;
    }
}