/* ==================================================
   SECTION COMMENT ÇA FONCTIONNE
   ================================================== */

#fonctionnement {
    width: 100%;
    padding: 70px 20px;
    box-sizing: border-box;
    overflow: hidden;
}


/* ==================================================
   TITRE DE LA SECTION
   ================================================== */

#fonctionnement .section-title {
    width: min(100%, 760px);
    margin: 0 auto 25px;
    text-align: center;
}

#fonctionnement .section-title h2 {
    margin: 0;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}


/* ==================================================
   BOUTON REVENIR AU DÉBUT
   ================================================== */

#fonctionnement .carousel-restart {
    display: block;
    margin: 22px auto 0;
    padding: 9px 18px;

    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 999px;

    color: #111;
    background: transparent;

    font: inherit;
    font-size: 0.9rem;

    cursor: pointer;

    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        border-color 0.25s ease;
}

#fonctionnement .carousel-restart:hover {
    color: #fff;
    background: #111;
    border-color: #111;
}


/* ==================================================
   CONTENEUR DU CARROUSEL
   ================================================== */

#fonctionnement .how-carousel {
    position: relative;

    width: min(100%, 680px);
    margin: 25px auto 0;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* Zone visible */

#fonctionnement .carousel-viewport {
    width: 100%;
    overflow: hidden;

    border-radius: 18px;
    background: #111;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.14);
}


/* Bande qui se déplace */

#fonctionnement .carousel-track {
    display: flex;

    width: 100%;

    transition:
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);

    will-change: transform;
}


/* ==================================================
   DIAPOSITIVES
   ================================================== */

#fonctionnement .carousel-slide {
    position: relative;

    flex: 0 0 100%;
    min-width: 100%;

    aspect-ratio: 4 / 3;

    overflow: hidden;
    background: #111;
}


/* Images */

#fonctionnement .carousel-slide img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    user-select: none;
    -webkit-user-drag: none;
}


/* Dégradé permettant de lire le texte */

#fonctionnement .carousel-slide::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 1;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.82) 0%,
        rgba(0, 0, 0, 0.38) 35%,
        rgba(0, 0, 0, 0.08) 65%,
        transparent 100%
    );

    pointer-events: none;
}


/* ==================================================
   TEXTE SUR LES IMAGES
   ================================================== */

#fonctionnement .slide-overlay {
    position: absolute;

    left: 28px;
    right: 28px;
    bottom: 26px;

    z-index: 2;

    color: #fff;
    text-align: left;
}

#fonctionnement .step-number{
    display: inline-block;

    margin-bottom: 12px;

    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .25em;
    text-transform: uppercase;

    background: linear-gradient(
        180deg,
        #F6E8B1 0%,
        #D4AF37 45%,
        #B8860B 100%
    );

    -webkit-background-clip: text;
    background-clip: text;

    -webkit-text-fill-color: transparent;

    text-shadow: 0 0 8px rgba(212,175,55,.25);
}

#fonctionnement .slide-overlay h3 {
    margin: 0 0 9px;

    color: #fff;

    font-size: clamp(1.7rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1;
}

#fonctionnement .slide-overlay p {
    max-width: 520px;

    margin: 0;

    color: rgba(255, 255, 255, 0.92);

    font-size: 0.98rem;
    line-height: 1.45;
}


/* ==================================================
   FLÈCHES
   ================================================== */

#fonctionnement .carousel-arrow {
    position: absolute;

    top: 50%;
    z-index: 10;

    width: 44px;
    height: 44px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;

    color: #fff;
    background: rgba(0, 0, 0, 0.48);

    font-size: 1.3rem;
    line-height: 1;

    cursor: pointer;

    transform: translateY(-50%);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transition:
        background-color 0.25s ease,
        transform 0.25s ease;
}

#fonctionnement .carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);

    transform:
        translateY(-50%)
        scale(1.07);
}

#fonctionnement .carousel-arrow-left {
    left: 14px;
}

#fonctionnement .carousel-arrow-right {
    right: 14px;
}


/* ==========================
   CAPSULES
   ========================== */

#fonctionnement .carousel-dots{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:12px;
    margin-top:25px;
}

#fonctionnement .carousel-dot{

    width:18px;
    height:6px;

    border:none;
    border-radius:999px;

    background:rgba(212,175,55,.35);

    cursor:pointer;

    transition:all .35s ease;
}

#fonctionnement .carousel-dot:hover{
    background:#D4AF37;
}

#fonctionnement .carousel-dot.active{

    width:46px;

    background:linear-gradient(
        90deg,
        #E8D39A,
        #D4AF37,
        #B8891F
    );

    box-shadow:
        0 0 10px rgba(212,175,55,.35);

    transform:scale(1.05);
}


/* ==================================================
   TABLETTE
   ================================================== */

@media (max-width: 768px) {

    #fonctionnement {
        padding: 55px 15px;
    }

    #fonctionnement .section-title {
        margin-bottom: 20px;
    }

    #fonctionnement .how-carousel {
        width: min(100%, 540px);
    }

    #fonctionnement .carousel-slide {
        aspect-ratio: 4 / 3;
    }

    #fonctionnement .slide-overlay {
        left: 22px;
        right: 22px;
        bottom: 22px;
    }

    #fonctionnement .slide-overlay h3 {
        font-size: 2rem;
    }

    #fonctionnement .slide-overlay p {
        font-size: 0.92rem;
    }

    #fonctionnement .carousel-arrow {
        width: 40px;
        height: 40px;

        font-size: 1.15rem;
    }

    #fonctionnement .carousel-arrow-left {
        left: 10px;
    }

    #fonctionnement .carousel-arrow-right {
        right: 10px;
    }
}


/* ==================================================
   SMARTPHONE
   ================================================== */

@media (max-width: 480px) {

    #fonctionnement {
        padding: 45px 12px;
    }

    #fonctionnement .section-title h2 {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    #fonctionnement .how-carousel {
        width: 100%;
    }

    #fonctionnement .carousel-viewport {
        border-radius: 14px;
    }

    #fonctionnement .carousel-slide {
        aspect-ratio: 3 / 4;
    }

    #fonctionnement .slide-overlay {
        left: 18px;
        right: 18px;
        bottom: 18px;
    }

    #fonctionnement .step-number {
        font-size: 0.92rem;
    }

    #fonctionnement .slide-overlay h3 {
        margin-bottom: 7px;

        font-size: 1.65rem;
    }

    #fonctionnement .slide-overlay p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    #fonctionnement .carousel-arrow {
        width: 36px;
        height: 36px;

        font-size: 1rem;
    }

    #fonctionnement .carousel-arrow-left {
        left: 7px;
    }

    #fonctionnement .carousel-arrow-right {
        right: 7px;
    }
}


/* Accessibilité */

@media (prefers-reduced-motion: reduce) {

    #fonctionnement .carousel-track {
        transition: none;
    }
}