/* --- STYLE.CSS (Minimaliste & Détaillé) --- */

/* Variables de base */
:root {
    --primary-color: #3498db; /* Bleu Vif et Moderne */
    --secondary-color: #2c3e50; /* Bleu Nuit pour le texte et le footer */
    --background-color: #ecf0f1; /* 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: #3498db; /* Bleu */
    --level-2-color: #2ecc71; /* Vert Émeraude */
    --level-3-color: #e74c3c; /* Rouge Brique (Utilisé pour le bouton d'accentuation) */
}

/* 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 ET BANNIÈRE --- */
header {
    background: linear-gradient(135deg, var(--secondary-color), #34495e); /* Dégradé sombre */
    color: white;
    padding: 4rem 0 3rem 0; 
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

header h1 {
    margin: 0;
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* STYLE H2 MODIFIÉ pour gérer le lien à côté du titre */
h2 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-top: 50px;
    font-weight: 600;
    
    /* Permet d'aligner le titre (texte) et le lien (bouton) */
    display: flex; 
    align-items: center; 
    justify-content: flex-start; /* Aligner à gauche */
}

/* NOUVEAU STYLE POUR LE LIEN DÉTAILLÉ (PLUS VISIBLE) */
.details-link {
    font-size: 0.5em; /* Taille relative au H2 (environ 50% de la taille du titre) */
    font-weight: 700; /* Plus gras */
    text-decoration: none;
    color: var(--card-bg-color); /* Texte blanc pour un meilleur contraste */
    background-color: var(--level-3-color); /* Couleur d'accentuation forte (Rouge Brique) */
    padding: 8px 15px; /* Rendre plus "bouton" */
    border-radius: 25px; /* Forme de pilule */
    margin-left: 20px;
    transition: background-color 0.3s, opacity 0.3s;
    white-space: nowrap; 
    display: inline-block; /* Assure que le padding et la taille sont appliqués */
}

.details-link:hover {
    background-color: var(--primary-color); /* Changement de couleur au survol (Bleu principal) */
    color: var(--card-bg-color);
    opacity: 0.9;
    text-decoration: none; /* Ne pas souligner */
}
/* FIN DES AJOUTS POUR LE LIEN */

h3 {
    font-weight: 600;
    font-size: 1.5rem;
}

hr {
    border: 0;
    border-top: 1px solid #bdc3c7;
    margin: 40px 0;
}

/* --- SECTION À PROPOS ET LIENS --- */
.about {
    text-align: center;
    padding-bottom: 20px;
}
.contact-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    margin: 0 15px;
    transition: color var(--transition-speed);
}
.contact-links a:hover {
    color: var(--level-3-color);
}

/* --- GRILLE DE PROGRAMME (CARTES DÉTAILLÉES) --- */

.program-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes de taille égale */
    gap: 30px;
    margin-top: 30px;
}

/* Style des cartes par année */
.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; /* Bordure pour l'accentuation */
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.year-summary:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.year-summary h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.year-summary .description {
    font-style: italic;
    font-size: 0.95em;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #7f8c8d;
}

.unit-list {
    list-style: none;
    padding: 0;
}

.unit-list > li {
    margin-bottom: 15px;
    padding-left: 0; /* Pas de padding ici, on utilise la marge */
}

/* Style de l'unité principale (le lien) */
.unit-list > li > a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 700;
    display: block;
    padding: 5px 0;
    transition: color var(--transition-speed);
}

/* Style de la liste des SÉQUENCES (les détails) */
.unit-list ul {
    list-style-type: none; 
    margin-top: 5px;
    padding-left: 15px; /* Décalage à droite pour les détails */
    font-weight: normal;
    font-size: 0.9em;
    color: #7f8c8d; /* Détails en gris clair */
    border-left: 2px solid #f1f1f1; /* Ligne visuelle pour l'imbrication */
}
.unit-list ul li {
    margin-bottom: 3px;
}

/* Styles Spécifiques aux Niveaux (Couleurs d'accentuation) */

.level-1-details { border-top-color: var(--level-1-color); }
.level-1-details h3 { color: var(--level-1-color); }
.level-1-details .unit-list a:hover { color: var(--level-1-color); }

.level-2-details { border-top-color: var(--level-2-color); }
.level-2-details h3 { color: var(--level-2-color); }
.level-2-details .unit-list a:hover { color: var(--level-2-color); }

.level-3-details { border-top-color: var(--level-3-color); }
.level-3-details h3 { color: var(--level-3-color); }
.level-3-details .unit-list a:hover { color: var(--level-3-color); }


/* --- STYLES POUR LES PAGES DE NIVEAU (UNITÉS) --- */

.sub-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.sub-header h1 {
    font-size: 2.2rem;
}

.back-link {
    display: inline-block;
    color: #ffc107; 
    text-decoration: none;
    margin-top: 15px;
    padding: 8px 20px;
    border: 1px solid #ffc107;
    border-radius: 20px; 
    transition: background-color var(--transition-speed);
    font-size: 0.9em;
}

.back-link:hover {
    background-color: #ffc107;
    color: var(--secondary-color);
}

.project-item {
    background-color: var(--card-bg-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-color); 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.project-item h3 {
    color: var(--secondary-color);
    margin-top: 0;
    font-size: 1.3rem;
    border-bottom: none;
    padding-bottom: 0;
}

.technologies {
    font-style: italic;
    font-size: 0.9em;
    color: var(--primary-color);
    margin-top: 10px;
}

.skills-acquired ul {
    list-style-type: none;
    padding: 0;
}

.skills-acquired li {
    background: var(--card-bg-color);
    margin-bottom: 10px;
    padding: 15px;
    border-left: 4px solid var(--level-2-color); 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 25px 0;
    background-color: var(--secondary-color);
    color: #ecf0f1;
    margin-top: 50px;
}

/* Rendre le design adaptable aux mobiles */
@media (max-width: 992px) {
    .program-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
        gap: 20px;
    }
    header {
        padding: 3rem 0 2rem 0;
    }
    header h1 {
        font-size: 2rem;
    }
    
    /* Le lien du programme devient pleine largeur ou aligné au centre sur mobile si le h2 ne peut pas contenir */
    .details-link {
        font-size: 0.6em; /* Légèrement plus grand sur mobile */
        margin-top: 10px;
        margin-left: 0;
    }
}