@import url("./homepage.css");

.modele_home-video .carrousel .splide__slide > .grids {
    position: relative;
}

.modele_home-video .carrousel .splide__slide .gridone,
.modele_home-video .carrousel .splide__slide .gridtwo {
    display: block;
    width: calc(var(--unit) * 4);
    height: calc(var(--unit) * 4);
    position: relative;
}
 
.modele_home-video .carrousel .splide__slide .gridone {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2; 
}  

.modele_home-video .carrousel .splide__slide .gridtwo {
    z-index: 1;
}

.modele_home-video .carrousel .splide__slide .media-layer,
.modele_home-video .carrousel .splide__slide .media-mask-target {
    width: 100%;
    height: 100%;
}  

.modele_home-video .carrousel .splide__slide .media-layer {
    position: relative;
}

.modele_home-video .carrousel .splide__slide .media-mask-target {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.modele_home-video .carrousel .splide__slide .media-asset {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.modele_home-video .carrousel .splide__slide video.media-asset {
    background-color: #000;
}

.modele_home-video .carrousel .splide__slide .media-mask-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.modele_home-video .carrousel .splide__slide .mask-tile {
    transform-box: fill-box;
    transform-origin: center center;
}

.modele_home-video .carrousel {
    --mask-delay: 3s;
}

.modele_home-video .carrousel .splide__slide .media-layer--before .mask-tile {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.modele_home-video .carrousel .splide__slide .media-layer--after .mask-tile {
    opacity: 0;
    transform: rotate(-90deg) scale(0.01);
}

.modele_home-video .carrousel .splide__slide .mask-tile--empty {
    opacity: 0 !important;
    animation: none !important;
}

@supports ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
    .modele_home-video .carrousel .splide__slide .media-mask-target {
        mask-repeat: no-repeat;
        -webkit-mask-repeat: no-repeat;
        mask-position: center;
        -webkit-mask-position: center;
        mask-size: 100% 100%;
        -webkit-mask-size: 100% 100%;
    }

    .modele_home-video .carrousel .splide__slide.is-active .media-layer--before .mask-tile:not(.mask-tile--empty),
    .modele_home-video .carrousel .splide__slide.has-animated .media-layer--before .mask-tile:not(.mask-tile--empty) {
        animation: home-video-mask-out 0.4s calc(var(--mask-delay) + 0.15s * var(--tile-delay-group)) 1 alternate ease-in-out forwards;
    }

    .modele_home-video .carrousel .splide__slide.is-active .media-layer--after .mask-tile:not(.mask-tile--empty),
    .modele_home-video .carrousel .splide__slide.has-animated .media-layer--after .mask-tile:not(.mask-tile--empty) {
        animation: home-video-mask-in 0.4s calc(var(--mask-delay) + 0.15s * var(--tile-delay-group)) 1 alternate ease-in-out forwards;
    }
}

@supports not ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
    .modele_home-video .carrousel .splide__slide .media-layer--before .media-mask-target,
    .modele_home-video .carrousel .splide__slide .media-layer--after .media-mask-target {
        transition: opacity 0.4s ease-in-out;
    }

    .modele_home-video .carrousel .splide__slide .media-layer--before .media-mask-target {
        opacity: 1;
    }

    .modele_home-video .carrousel .splide__slide .media-layer--after .media-mask-target {
        opacity: 0;
    }

    .modele_home-video .carrousel .splide__slide.is-active .media-layer--before .media-mask-target,
    .modele_home-video .carrousel .splide__slide.has-animated .media-layer--before .media-mask-target {
        opacity: 0;
        transition-delay: var(--mask-delay);
    }

    .modele_home-video .carrousel .splide__slide.is-active .media-layer--after .media-mask-target,
    .modele_home-video .carrousel .splide__slide.has-animated .media-layer--after .media-mask-target {
        opacity: 1;
        transition-delay: var(--mask-delay);
    }
}

@keyframes home-video-mask-out {
    0% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: rotate(90deg) scale(0.01);
    }
}

@keyframes home-video-mask-in {
    0% {
        opacity: 0;
        transform: rotate(-90deg) scale(0.01);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* ===== Section #approche ===== */
/* Couleur de fond du texte (.content) de chaque slide, en alternance */
.approcheslider .splide__slide.approche-color-1{ --approche-bg: var(--color1); }
.approcheslider .splide__slide.approche-color-2{ --approche-bg: var(--color2); }
/* Bureau : l'image du slider reste à gauche avec le titre (.titre),
   le texte de chaque slide (.content) passe à droite sur fond de couleur */
.approcheslider{
    --approche-nav: 56px; /* hauteur de la barre de pagination / flèches en mobile */
}
.approcheslider .splide__slide{
    padding: 0;
    -webkit-flex-wrap: nowrap;
    -moz-flex-wrap: nowrap;
    -ms-flex-wrap: nowrap;
    -o-flex-wrap: nowrap;
    flex-wrap: nowrap;
}
.approcheslider .splide__slide .img{
    width: 50%;
}
.approcheslider .splide__slide .titre,
.approcheslider .splide__slide .content{
    box-sizing: border-box;
    flex: 0 0 50%;
    min-width: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    justify-content: center;
}
.approcheslider .splide__slide .titre{
    margin-bottom: 0;
    padding: 20vh 8vw;
}
.approcheslider .splide__slide .content{
    margin-left: auto;
    padding: 20vh 8vw;
    background-color: var(--approche-bg, var(--color1));
}
.approcheslider .splide__arrow--prev{
    left: calc(50% + 1.5vw);
}

@media screen and (max-width:1600px){
    .approcheslider .splide__pagination{
        width: 100%;
    }
}

/* Tablette / mobile : titre sur l'image en haut, texte en dessous,
   pagination et flèches dans une barre sous le slider */
@media screen and (max-width:1024px){
    .approche .approcheslider{
        min-width: 0;
    }
    /* Colonne : le .content s'étire jusqu'au bas de la slide pour éviter
       que l'image apparaisse sous le texte quand une slide est plus courte */
    .approcheslider .splide__slide{
        -webkit-flex-direction: column;
        flex-direction: column;
    }
    .approcheslider .splide__slide .img{
        width: 100%;
    }
    .approcheslider .splide__slide .titre,
    .approcheslider .splide__slide .content{
        flex: 0 0 auto;
    }
    .approcheslider .splide__slide .titre{
        min-height: 45vh;
        padding: 12vh 8vw;
    }
    .approcheslider .splide__slide .content{
        flex-grow: 1;
        justify-content: flex-start;
        margin-left: 0;
        padding: 8vh 8vw;
    }
    .approcheslider .splide__slide .titre img,
    .approcheslider .splide__slide .content img{
        max-width: 100%;
        height: auto;
    }

    /* Barre de navigation sous les slides, dans le flux :
       [flèche prev] [pagination en grille 2 colonnes] [flèche next] */
    .approche .approcheslider{
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        background-color: var(--noir);
    }
    /* height:auto (au lieu de 100%) sinon la barre de navigation
       déborde du slider et passe par-dessus la section suivante */
    .approcheslider .splide__track{
        -webkit-order: 1;
        order: 1;
        flex: 0 0 100%;
        width: 100%;
        height: auto;
    }
    .approcheslider .splide__arrows{
        display: contents;
    }
    .approcheslider .splide__arrow{
        position: static;
        transform: none;
        -webkit-order: 2;
        order: 2;
        flex: 0 0 var(--approche-nav);
        width: var(--approche-nav);
        height: auto;
        min-height: var(--approche-nav);
        align-self: stretch;
        border-radius: 0;
        background-color: transparent;
        display: -webkit-flex;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 1;
    }
    .approcheslider .splide__arrow--next{
        -webkit-order: 4;
        order: 4;
    }
    .approcheslider .splide__arrow svg{
        width: 14px;
        height: 14px;
    }
    /* Toutes les étapes visibles, sans défilement (le thème Splide met
       pointer-events:none sur le ul et une marge de 3px sur les boutons) */
    .approcheslider .splide__pagination{
        position: static;
        -webkit-order: 3;
        order: 3;
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        pointer-events: auto;
    }
    .approcheslider .splide__pagination li{
        display: block;
        margin: 0;
        line-height: 1.2;
    }
    .approcheslider .splide__pagination li button{
        width: 100%;
        height: 100%;
        min-height: var(--approche-nav);
        margin: 0;
        padding: 10px 6px;
        white-space: normal;
        opacity: 1;
    }
}

@media screen and (max-width:640px){
    .approcheslider .splide__slide .titre{
        min-height: 35vh;
        padding: 10vh 6vw;
    }
    .approcheslider .splide__slide .content{
        padding: 6vh 6vw;
    }
    .approcheslider .splide__pagination__page{
        font-size: 12px;
        letter-spacing: 0;
    }
}
