html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Roboto', 'Times New Roman', sans-serif;
    color: #37474F;
    min-height: 800px;
}

/* Modifier la règle .fond pour permettre le scroll */
.fond {
    position: relative;
    width: 100%;
    height: calc(100vh - 5em);
    padding: 0;
    margin: 0;
    /* Assurer qu'il n'y a pas de marge */
    max-width: 100%;
    overflow: visible;
    z-index: 1;
    background-image: url("../img/cst-fond-index.jpg");
    background-size: cover;
    background-position: left top;
    background-repeat: no-repeat;
    background-attachment: scroll;
    /* Ajouter ces propriétés pour supprimer tout espace */
    display: block;
    border: none;
}



.container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 5em);
    /* height → min-height */
    padding: 0;
    max-width: 100%;
    overflow: visible;
    /* hidden → visible */
    z-index: 1 !important;
}

.navbar {
    height: 5em;
    margin-bottom: 0;
    box-sizing: border-box;
}

.content-wrapper {
    position: relative;
    width: 100%;
    /* height → min-height */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 8em 0;
    /* Ajoute de l'espace */
}

.image-container {
    position: relative;
    width: 40%;
    height: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-image {
    height: 140%;
    object-fit: contain;
}

.texte_slider {
    margin-left: 5%;
    width: calc(21% - 100px);
    position: absolute;
    top: 53%;
    transform: translateY(-50%);
    left: 0;
    color: #fff;
    z-index: 4;
    background-color: #1c1d22;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2b30;
    backdrop-filter: blur(5px);
    opacity: 1;

}

.texte_slider .description_slider {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.6;
}

.description_slider {
    font-size: 15px;
    overflow: hidden;
}

.description_slider span {
    display: block;
}

/*Animations du texte sur le slider*/
.paragraphe2_slider {
    position: relative;
}

.texte_mots {
    width: 100%;
    opacity: 1;
    font-size: 1.2em;
    text-align: justify;
}

@media screen and (max-width: 2000px) {
    .texte_slider {
        margin-left: 80px;
        width: calc(30% - 70px);
        top: 58%;
    }

    .image-container {
        position: relative;
        width:45%;
        left: 17%;
        display: flex;
    }   

    .content-wrapper {
        flex-direction: column;
        min-height: auto;
        /* Permet au contenu de définir la hauteur */
        padding: 2em 0;
        /* Réduit l'espacement */
    }
}

/* Responsive design */
@media screen and (max-width: 1700px) {
    .texte_slider {
        margin-left: 80px;
        width: calc(30% - 70px);
        top: 58%;
    }

    .image-container {
        position: relative;
        width:45%;
        left: 17%;
        display: flex;
    }   

   
}

/* Responsive design */
@media screen and (max-width: 1500px) {
    .texte_slider {
        margin-left: 80px;
        width: calc(30% - 70px);
        top: 63%;
    }

    .image-container {
        position: relative;
        left: 17%;
        display: flex;
    }   
    
    .main-image {
        width: 140%;
    }
    
}

@media screen and (max-width: 1300px) {
    .texte_slider {
        margin-left: 100px;
        width: calc(30% - 50px);
        top: 58%;
    }

    .image-container {
        position: relative;
        width: 30%;
        height: 40%;
        left: 20%;
        display: flex;
    }
    .main-image {
        width: 170%;
    }

    .texte_mots {
        font-size: 1.1em;
    }
}


@media screen and (max-width: 1200px) {

    .content-wrapper {
        flex-direction: column;
    }

    .texte_slider {
        position: relative;
        margin: 20px auto;
        width: 80%;
        top: auto;
        left: auto;
        transform: none;
        margin-bottom: 30px;
    }

    .image-container {
        position: relative;
        width: 30%;
        height: auto;
        left: 0;
        top: auto;
         margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}



@media screen and (max-width: 1000px) {
    .texte_slider {
        width: 85%;
        margin: 20px auto;
    }

    .image-container {
        width: 45%;
    }
}


@media screen and (max-width: 900px) {
    .image-container {
        width: 50%;
    }
}

@media screen and (max-width: 800px) {
    .image-container {
        width: 55%;
    }
}

@media screen and (max-width: 700px) {
    .image-container {
        width: 60%;
        height: auto;
    }
    
    .main-image {
        max-height: 250px;
    }
}


@media screen and (max-width: 600px) {
    .content-wrapper {
        flex-direction: column;
        min-height: auto;
        /* Permet au contenu de définir la hauteur */
        padding: 1em 0;
        /* Réduit l'espacement */
    }

    .texte_slider {
        position: relative;
        margin: 1rem 1rem 0 1rem;
        width: 70%;
        /* Légèrement plus large */
        top: auto;
        /* Enlève le positionnement fixe */
        left: auto;
        transform: none;
        order: 2;
        /* Met le texte après l'image */
        margin-bottom: 40px;
        /* Ajoute de l'espace en bas */
    }

    .image-container {
        position: relative;
        width: 50% !important;
        /* Force la largeur */
        height: auto;
        /* Hauteur automatique */
        top: auto;
        /* Enlève le positionnement fixe */
        margin: 1em auto;
        /* Centre et ajoute de l'espace */
        order: 1;
        /* Met l'image en premier */
    }

    .main-image {
        height: auto;
        /* Hauteur automatique */
        max-height: 250px;
        /* Hauteur maximale */
    }

    /* Assurez-vous que le fond s'étende */
    .fond {
        min-height: 100vh;
        height: auto;
        overflow: visible;
    }

    /* Permet le scroll */
    body,
    html {
        overflow-y: auto;
        height: auto;
    }

    .texte_mots {
        max-height: none !important;
        /* Assure que le texte n'est pas tronqué */
        overflow: visible !important;
        /* Permet au texte de dépasser */
        font-size: 0.9em;
    }

    .paragraphe2_slider {
        overflow: visible;
        /* Assure que le fond ne cache pas le texte */
    }
}