/* --- style_officiel.css (Minimaliste & Détaillé avec Sommaire Fixe) --- */

/* Variables de base */
:root {
    --primary-color: #0077b6; /* Bleu Profond et Professionnel */
    --secondary-color: #2c3e50; /* Bleu Nuit pour le texte et le footer */
    --background-color: #f8f9fa; /* Gris très clair, presque blanc */
    --card-bg-color: #ffffff; /* Fond des cartes blanc pur */
    --border-radius: 10px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Ombre douce */
    --transition-speed: 0.3s;
    
    /* Couleurs des Niveaux (Palette Harmonisée) */
    --level-1-color: #4a90e2; /* Bleu Clair */
    --level-2-color: #50e3c2; /* Cyan/Vert d'Eau */
    --level-3-color: #f5a623; /* Jaune/Orange Vif */
}

/* Styles généraux */
body {
    font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--secondary-color);
}

/* --- EN-TÊTE --- */
header {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 3rem 0 2rem 0;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* --- STRUCTURE PRINCIPALE (Avec Sommaire Flottant) --- */
.container {
    display: flex;
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* --- SOMMAIRE LATÉRAL (Table des Matières) --- */
.sidebar-toc {
    width: 250px;
    flex-shrink: 0; /* Empêche le rétrécissement */
    position: sticky;
    top: 20px; /* Reste en haut lors du défilement */
    height: fit-content;
    padding: 20px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-right: 30px;
}

.sidebar-toc h2 {
    color: var(--primary-color);
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.2rem;
}

.sidebar-toc ul {
    list-style: none;
    padding: 0;
}

.sidebar-toc ul li a {
    display: block;
    padding: 5px 0;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9em;
    border-left: 3px solid transparent;
    transition: all var(--transition-speed);
}

.sidebar-toc ul li a:hover {
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    font-weight: 600;
}

/* Indentation pour la clarté */
.sidebar-toc ul ul {
    padding-left: 15px;
    margin-top: 0;
    border-left: 1px dotted #ccc;
}

/* --- CONTENU PRINCIPAL (Programme) --- */
.main-content {
    flex-grow: 1;
    min-width: 0; /* Important pour la flexbox */
}

.main-content h2 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-top: 50px;
    font-weight: 700;
    font-size: 2rem;
}

/* --- GRILLE DES ANNÉES --- */
.program-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux unités par ligne pour les détails */
    gap: 30px;
    margin-top: 30px;
}
#annee-3 .program-grid {
    grid-template-columns: repeat(3, 1fr); /* Trois unités pour l'année 3 */
}

.year-summary {
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background-color: var(--card-bg-color);
    border-top: 5px solid transparent; 
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.year-summary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.year-summary h3 {
    margin-top: 0;
    font-size: 1.4rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.unit-list {
    list-style: none;
    padding: 0;
}

/* Style de l'unité principale (le lien) */
.unit-list > li {
    margin-bottom: 15px;
    border-left: 3px solid #f1f1f1;
    padding-left: 10px;
}
.unit-list > li > a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 700;
    display: block;
    padding: 5px 0;
    font-size: 1.1em;
    transition: color var(--transition-speed);
}
.unit-list > li > a:hover {
    text-decoration: underline;
}

/* Style de la liste des SÉQUENCES (les détails) */
.unit-list ul {
    list-style-type: disc; /* Puces pour les séquences */
    margin-top: 5px;
    padding-left: 20px;
    font-weight: normal;
    font-size: 0.9em;
    color: #7f8c8d;
}
.unit-list ul li {
    margin-bottom: 3px;
    list-style-type: circle; /* Puces différentes pour les thèmes/contenu */
}
.unit-list ul ul {
    list-style-type: circle;
    padding-left: 20px;
    margin-top: 5px;
}
.unit-list ul ul li {
    list-style-type: none; /* Cache les puces pour les thèmes très détaillés */
    font-size: 0.95em;
    color: #95a5a6;
    margin-top: 2px;
}

/* Styles Spécifiques aux Niveaux (Couleurs d'accentuation) */
.level-1-details { border-top-color: var(--level-1-color); }
.level-1-details h3, .level-1-details a:hover { color: var(--level-1-color); }

.level-2-details { border-top-color: var(--level-2-color); }
.level-2-details h3, .level-2-details a:hover { color: var(--level-2-color); }

.level-3-details { border-top-color: var(--level-3-color); }
.level-3-details h3, .level-3-details a:hover { color: var(--level-3-color); }

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 25px 0;
    background-color: var(--secondary-color);
    color: #ecf0f1;
    margin-top: 50px;
}

/* Adaptation Mobile */
@media (max-width: 1200px) {
    .sidebar-toc {
        display: none; /* Cacher le sommaire fixe sur petit écran pour le contenu */
    }
    .container {
        display: block;
    }
}
@media (max-width: 900px) {
    .program-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
    }
    #annee-3 .program-grid {
        grid-template-columns: 1fr;
    }
    header h1 {
        font-size: 1.8rem;
    }
}