*, ::before, ::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    background: rgba(188, 185, 192, 0.5);
}

html {
    font-family: 'arial';
    font-size: 20px;
}

h1 {
    color: black;
    font-size: 60px;
    font-family: arial;
}

h2 {
    color: black;
    font-size: 20px;
    font-style: italic;
}

a {
    color: black;
    padding: 20px;
    text-decoration: none;
}

a:hover {
    color: #94a2c9;
}

footer {
    display: flex;
    justify-content: center;
    flex-direction: column;
    background: rgba(41, 129, 125, 0.5);
    padding: 10px;
    height: 100px;
}

.titrefooter {
    font-size: 25px;
    text-align: center;
}

#partie_un {
    background: url('images_sommaire/banniere.jpg') center center / cover no-repeat;
    padding-top: 60px;
    padding-bottom: 10%;
}

nav {
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: white;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    padding: 20px 0;
}

#bandeau {
    background-color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

#contenu h1 {
    text-align: center;
    margin: 0;
}

#commentaire {
    background-color: rgb(180, 172, 172);
    margin-top: 1%;
    margin-bottom: 1%;
    flex-grow: 1;
    text-align: center;
    width: auto;
    border-radius: 15px;
    border: 2px solid white;
    color: black;
    padding: 5px;
}

.commentaireindex {
    background-color: rgb(180, 172, 172);
    border-radius: 15px;
    border: 2px solid white;
    margin-top: 1%;
    margin-bottom: 1%;
    text-align: center;
    padding: 15px;
}

#contenu {
    text-align: center;
    padding-top: 5%;
}

.centre {
    width: 90%;
    margin: 0 auto;
}

figure {
    margin: 0;
}

img {
    max-width: 100%;
    border-radius: 15px;
    border: 2px black solid;
}

figcaption {
    text-align: center;
    font-style: italic;
}

.carte:hover {
    box-sizing: border-box;
}

.carte {
    background-color: rgb(180, 172, 172);
    border: 5px solid white;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

article {
    padding: 10px;
}

p {
    text-align: center;
    background-color: rgb(180, 172, 172);
    width: auto;
    border-radius: 15px;
    color: black;
    padding: 5px;
    position: relative;
}

.newsun {
    display: flex;
    flex-flow: column wrap; 
    width: 70%;
    height: auto;
    margin: auto;
    position: relative;
}

.newsun p {
    background-color: #CCCCCC;
    margin-top: 0px;
}

h3 {
    background-color: #a2b3be;
    color: black;
    font-size: 15px;
    margin-bottom: 0px;
    text-align: left;
    margin: 2px;
    padding: 5px; 
}

main {
    padding: 30px;
}

/* --- MEDIA QUERY : GRAND ÉCRAN / PC --- */
@media screen and (min-width: 1000px) {
    .cartes {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .carte {
        flex: 0 0 32%;
        display: flex;
    }
}

/* --- MEDIA QUERY : TABLETTE --- */
@media screen and (min-width: 415px) and (max-width: 999px) {
    h1 {
        font-size: 40px;
    }
    nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    nav a {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    .cartes {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .carte {
        flex: 0 0 48%;
    }
    #partie_un {
        padding-top: 70px; /* Ajusté pour coller sous la nav */
        padding-bottom: 5%;
    }
    #bandeau {
        margin-top: 0;
        height: 220px;
    }
}

/* --- MEDIA QUERY : PETIT MOBILE --- */
@media screen and (max-width: 414px) {
    h1 {
        font-size: 30px;
    }
    nav a {
        display: block;
        font-size: 1rem;
        text-align: center;
        padding: 2px;
    }
    nav {
        display: flex;
        flex-direction: column;
    }
    .centre {
        width: auto;
    }
    p {
        text-align: center;
        width: 90%;
        color: black;
        padding: 5px;
        position: relative;
    }
    .newsun {
        display: flex;
        flex-flow: column wrap; 
        width: 90%;
        height: auto;
        margin: auto;
        position: relative;
    }
    .titre {
        text-align: center;
        width: 90%;
        color: black;
        padding: 5px;
        position: relative;
    }
    #bandeau {
        background-color: rgba(255, 255, 255, 0.5);
        margin-top: 0; /* Supprime l'espace du haut */
        margin-bottom: 0;
        height: 180px;
    }
    #partie_un {
        padding-top: 95px; /* Ajusté exactement à la hauteur de la nav empilée */
        padding-bottom: 5%;
    }
    #barrecommerce {
        font-size: 0.5rem;
    }
}