/* Style général */

html {
    min-height: 100vh;
    background-image: url("images/fond.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* L'image reste fixe en fond d'écran sans créer de scroll inutile */
    overflow-x: hidden; /* Empêche les débordements horizontaux */
}

body {
    margin: 0;
    padding: 0;
    background: transparent; /* On laisse transparent pour voir l'image du HTML */
    font-family: "DM Sans", sans-serif;
    color: #333;
    overflow-x: hidden; /* Sécurité anti-scroll fantôme sur mobile */
    max-width: 100%;
}

body.accompagnement {
    background: white; /* Conserve le fond blanc uni sur cette page précise */
    color: black;
}

/* Menu (Version Ordinateur) */

#menu {
    width: 95%;
    margin: 10px auto;
    padding: 15px;
    background-color: rgb(247, 246, 237);
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    /* Remplacement pour un défilement ultra-fluide */
    transition: transform 0.3s ease;
    transform: translateY(0); 
    box-sizing: border-box; /* Ajouté ici pour sécuriser le comportement global */
}

#menu nav {
    display: flex;
    justify-content: center;
    gap: 30px;
}

#menu nav a {
    text-decoration: none;
    color: #5d8a82;
    font-weight: 500;
}

#menu nav a:hover {
    color: #f0f0f0;
}

/* Cacher le bouton hamburger sur les écrans d'ordinateurs */
.hamburger {
    display: none;
}

/* Contenu */

.contenu {
    max-width: 900px;
    margin: 120px auto 0 auto; /* Marge du bas passée à 0 pour bloquer le scroll inutile */
    padding: 20px 20px 60px 20px; /* Espace interne (padding) pour aérer le bas proprement */
    line-height: 1.8;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #5d8a82;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

h2 {
    text-align: center;
    color: #7a9e97;
    margin-bottom: 30px;
}

h3 {
    color: #5d8a82;
}

h4 {
    text-align: center;
    color: #5d8a82;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

h5 {
    text-align: center;
    display: block;
    font-size: 1rem;
    font-family: inherit; /* Force l'utilisation de la même police que le reste de la page */
    font-weight: normal;  /* Optionnel : supprime le gras natif des titres si besoin */   
}

h6{
    font-weight: bold;       /* Rend le texte en gras */
    font-size: 1.2rem;
    text-decoration: underline; /* Souligne le texte */
}

p {
    font-size: 18px;
    text-align: justify;
}

/* Cartes */

.carte {
    background-color: #f7f9f8;
    padding: 20px;
    margin: 20px 0;
    border-left: 5px solid #5d8a82;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Zone du bouton de téléchargement (Valable pour TOUS les écrans) */
.zone-bouton {
    display: flex;
    justify-content: center; /* Centre horizontalement */
    margin: 40px 0;          /* Espace au-dessus et en dessous du bouton */
}

/* Style du bouton de téléchargement */
.bouton-telechargement {
    display: inline-block;
    padding: 14px 35px;
    background-color: #5d8a82;
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(93, 138, 130, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

/* Effet au survol */
.bouton-telechargement:hover {
    background-color: #4a6f68;
    transform: translateY(-2px); /* Léger effet de soulèvement */
    box-shadow: 0 6px 14px rgba(93, 138, 130, 0.3);
}

/* Effet au clic */
.bouton-telechargement:active {
    transform: translateY(0);
}

/* Animation */

.fade-in {
    opacity: 0;
    animation: fadeIn 2s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Smartphone */

@media screen and (max-width: 768px) {

    html {
        /* CORRECTION : On coupe le fond natif sur HTML qui brise le scroll sur smartphone */
        background-image: none !important; 
        min-height: 100vh;
    }

    /* CORRECTION : On applique le fond sur une couche virtuelle fixe de taille stricte */
    html::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        background-image: url("images/fond.jpg");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    /* Gestion propre de la page blanche spécifique */
    body.accompagnement::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        background: white;
    }

    #menu {
        position: fixed; 
        top: 10px;
        left: 5%;
        right: auto; /* Supprime définitivement le conflit avec la version bureau */
        width: 90%;
        box-sizing: border-box; 
        display: flex;
        flex-direction: column; /* Aligne verticalement le bouton et les liens */
        align-items: stretch;
    }

    /* Rendre le bouton hamburger visible sur smartphone */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        margin-left: auto; /* Force l'alignement à droite */
    }

    .hamburger span {
        width: 100%;
        height: 3px;
        background-color: #5d8a82;
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* Masquer la navigation par défaut sur mobile */
    #menu nav {
        display: none; 
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin-top: 15px;
        padding-bottom: 5px;
    }

    /* Quand la classe .active est ajoutée par le JavaScript, on affiche les liens */
    #menu.active nav {
        display: flex;
    }

    /* Transformation du bouton hamburger en "X" quand le menu est ouvert */
    #menu.active .hamburger span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    #menu.active .hamburger span:nth-child(2) {
        opacity: 0;
    }
    #menu.active .hamburger span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Espace au-dessus du texte pour éviter qu'il ne passe sous le menu fixe */
    .contenu {
        margin-top: 140px;
        padding: 15px 15px 60px 15px; /* Ajusté aussi pour la version mobile */
    }

    h1 {
        font-size: 2rem;
    }

    p {
        font-size: 16px;
    }

    /* Optimisation du bouton sur mobile pour éviter qu'il ne déborde si le texte est long */
    .bouton-telechargement {
        width: 100%;
        max-width: 280px; /* Évite qu'il soit trop étiré sur grand téléphone */
        box-sizing: border-box;
        padding: 12px 20px;
    }
}
