/* ==========================================================================
   Styles communs à toutes les pages : header, nav (avec menu mobile),
   footer, et accordéon de chapitres (<details>/<summary>).
   Chaque page peut charger en plus sa propre feuille de style pour son
   contenu spécifique — celle-ci ne gère que les éléments partagés.
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

a {
    color: inherit;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* ----- Header ----- */
.site-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    background-color: rgb(246, 246, 234);
    flex-wrap: wrap;
}

.site-header .Logo {
    width: 130px;
    height: auto;
    flex-shrink: 0;
}

.site-header .Bienvenue {
    text-align: center;
    color: maroon;
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    flex: 1;
}

/* ----- Navigation ----- */
.site-nav {
    width: 100%;
    background: rgb(125, 13, 13);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #f1f1f1;
    font-size: 28px;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
}

.liste-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    color: #f1f1f1;
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: 18px;
    width: 100%;
}

.items {
    cursor: pointer;
    flex: 1 1 auto;
    padding: 10px;
    text-align: center;
    position: relative;
}

.items > a {
    color: #f1f1f1;
    text-decoration: none;
}

.arrow {
    font-size: small;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    z-index: 1;
    min-width: 100%;
}

.dropdown-content a {
    background: maroon;
    color: #f1f1f1;
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.2);
}

.dropdown-content a:hover,
.dropdown-content a:focus {
    background-color: rgb(246, 117, 117);
}

/* Ouverture au survol (desktop) ET au clic (tactile/clavier, via JS qui bascule .open) */
.dropdown:hover .dropdown-content,
.dropdown.open .dropdown-content {
    display: block;
}

/* ----- Footer ----- */
.site-footer {
    display: flex;
    align-items: center;
    text-align: center;
    padding: 6px;
    background: maroon;
    color: white;
    font-size: 14px;
    min-height: 20px;
}

.site-footer p {
    margin: 0;
    width: 100%;
}

.site-footer a {
    color: #ffd9d9;
}

/* ----- Alertes de statut (formulaires) ----- */
.alerte {
    max-width: 700px;
    margin: 15px auto;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

.alerte-succes {
    background: #e6f4ea;
    color: #1e4620;
    border: 1px solid #b7dfc0;
}

.alerte-erreur {
    background: #fdecea;
    color: #7a1a13;
    border: 1px solid #f3b6b0;
}

/* ----- Accordéon des chapitres (pages de niveau) ----- */
.chapitres {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
}

.chapitres details {
    background: #fff;
    border: 1px solid #e2c9c9;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 0;
    overflow: hidden;
}

.chapitres summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    font-weight: bold;
    background: rgb(246, 117, 117);
    color: white;
    font-size: 17px;
}

.chapitres summary::-webkit-details-marker {
    display: none;
}

.chapitres summary::after {
    content: "▾";
    float: right;
    transition: transform 0.2s ease-in-out;
}

.chapitres details[open] summary::after {
    transform: rotate(180deg);
}

.chapitres .lecons-liste {
    list-style: none;
    margin: 0;
    padding: 10px 18px 16px;
}

.chapitres .lecons-liste li {
    padding: 6px 0;
    border-bottom: 1px solid #f1e5e5;
}

.chapitres .lecons-liste li:last-child {
    border-bottom: none;
}

.chapitres .lecons-liste a {
    text-decoration: none;
    color: maroon;
    font-weight: 600;
}

.chapitres .lecons-liste a:hover {
    text-decoration: underline;
}

.badge-bientot {
    display: inline-block;
    background: #eee;
    color: #777;
    font-size: 13px;
    font-style: italic;
    padding: 8px 18px 14px;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .liste-items {
        display: none;
        flex-direction: column;
        align-items: stretch;
    }

    .liste-items.open {
        display: flex;
    }

    .items {
        text-align: left;
        padding: 14px 16px;
    }

    .dropdown-content {
        display: none;
        position: static;
    }

    .dropdown.open .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding: 14px 24px;
    }

    .site-header .Logo {
        margin: 0 auto;
    }

    .site-header {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-header .Bienvenue {
        font-size: 22px;
    }

    .site-header .Logo {
        width: 100px;
    }

    .chapitres summary {
        font-size: 15px;
        padding: 12px 14px;
    }

    .chapitres .lecons-liste {
        padding: 8px 14px 12px;
    }
}
