
body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background-image: url("vieillesse2.jpg");
    background-attachment: fixed;
    background-size: cover;
    margin: 0;
}

article, nav {
    background: rgba(255, 192, 187, 0.8);
    padding: 2em;
    border: solid 2px white;
    border-radius: 40px;
    box-sizing: border-box;
}


nav {
    width: 100%;
}

article {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}
/* Pour le mode mobile  */
nav {
    order: 1; /*priorité */
}

article {
    order: 2;
}


@media screen and (min-width: 800px) {
    nav, article {
        order: initial;
    }
}
.graphique-container {
    display: block; 
    width: 100%;
    max-width: 100%;
    text-align: center;
    margin: 20px 0;
    line-height: normal; 
}

.graphique-container canvas, 
.graphique-container svg {
    max-width: 100%;
    height: auto !important;
}
@media screen and (min-width: 800px) {
    body {
        flex-direction: row; 
        align-items: flex-start;
        justify-content: center;
        padding-top: 50px;

        /* CORRECTION DE L'IMAGE SUR ORDI */
        background-size: contain;     
        background-repeat: repeat;    
        background-attachment: fixed;  
    }

    nav {
        flex: 0 0 250px; 
        position: sticky;
        top: 20px;
    }

    article {
        flex: 1; 
        margin: 0; 
    }
}
@media screen and (min-width: 800px) {
    body {
        flex-direction: row; 
        align-items: flex-start;
        justify-content: center;
        padding-top: 50px;
    }

    nav {
        flex: 0 0 250px; 
        position: sticky;
        top: 20px;
    }

    article {
        flex: 1; 
        margin: 0; 
    }
}


h1 {
    text-align: center;
    color: brown;
    border: solid 3px brown;
    border-radius: 20px;
    padding: 1em;
    width: fit-content;
    margin: 1em auto;
    background: rgba(255, 255, 255, 0.8);
    flex-basis: 100%; 
}

h2 {
    font-style: italic;
    font-family: constantia, serif;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    margin-bottom: 1.5rem;
}

h2:hover, h3:hover {
    color: red;
    transition: color 0.3s ease-in-out;
}

h3 {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5em;
    font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
    color: brown;
}

p {
    font-family: constantia, georgia, serif;
    font-size: 110%;
    margin-bottom: 1.5rem;
    text-align: justify;
    line-height: 1.4;
}

a {
    text-decoration: none;
    color: blue;
}

a:hover {
    color: red;
}

img {

 max-width: 100%;

 right : 500px;

 height : auto;

 display: block;

 margin: 20px 0

}

@media print {
    nav {
        display: none;
    }
    body {
        background: none;
    }
    article {
        width: 100%;
    }
}