/* =========================================
   1. IMPORT DES POLICES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Merriweather:ital,wght@0,300;0,700;0,900;1,400&display=swap');

/* =========================================
   2. VARIABLES & THÈME (JOUR / NUIT)
   ========================================= */
:root {
    /* --- PALETTE JOUR (Editorial Warmth) --- */
    --bg-primary: #fdfbf7;      /* Crème / Coquille d'oeuf */
    --bg-secondary: #f3f0e9;    /* Beige un peu plus foncé */
    --bg-header: #ffffff;       /* Blanc pur */
    
    --text-main: #2d2a26;       /* Gris anthracite chaud */
    --text-muted: #5e5b55;      /* Gris taupe */
    
    --accent-primary: #c05621;  /* Terracotta (Orange Brique) */
    --accent-hover: #9c4221;    
    
    /* VERT CALME (British Racing Green) */
    --accent-secondary: #1e4620; 
    
    --border-color: #e2e8f0;
    --shadow-card: 0 4px 6px -1px rgba(66, 58, 50, 0.1), 0 2px 4px -1px rgba(66, 58, 50, 0.06);
    
    /* Mises en avant (Tableaux, Cartes spéciales) */
    --highlight-bg: #fff7ed; /* Orange très pâle */
    --highlight-border: #c05621;
}

[data-theme="dark"] {
    /* --- PALETTE NUIT (Cozy Dark) --- */
    --bg-primary: #1a1816;      /* Noir Café */
    --bg-secondary: #262422;    /* Marron très sombre */
    --bg-header: #1a1816;       
    
    --text-main: #e8e6e3;       /* Blanc cassé */
    --text-muted: #a8a29e;      /* Gris pierre */
    
    --accent-primary: #ed8936;  /* Orange vif */
    --accent-hover: #dd6b20;
    
    --accent-secondary: #68d391; /* Vert plus clair pour contraste nuit */
    
    --border-color: #44403c;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    
    --highlight-bg: #431407; 
    --highlight-border: #9a3412;
}

/* =========================================
   3. BASE & TYPOGRAPHIE
   ========================================= */
html {
    /* Augmentation globale de la taille de police */
    /* 100% = 16px (défaut), 106.25% = ~17px */
    font-size: 106.25%; 
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6; /* Améliore la lisibilité avec la police plus grande */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
}

/* --- TRANSITIONS DOUCES (Activées via JS) --- */
body.smooth-transitions,
body.smooth-transitions * {
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out, color 0.3s ease-in-out, fill 0.3s ease-in-out, stroke 0.3s ease-in-out;
}

/* --- UTILITAIRES COULEURS --- */
.text-accent { color: var(--accent-primary) !important; }
.bg-accent { background-color: var(--accent-primary) !important; }
.border-accent { border-color: var(--accent-primary) !important; }
.text-green-touch { color: var(--accent-secondary) !important; }

/* --- CARTES ÉDITORIALES --- */
.card-editorial {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 0.75rem;
}
.card-editorial:hover {
    transform: translateY(-2px);
}

/* Carte Mise en Avant (Tableau Officiel) */
.card-highlight {
    background-color: var(--highlight-bg);
    border: 2px solid var(--highlight-border);
    box-shadow: var(--shadow-card);
    border-radius: 0.75rem;
}

/* --- HEADER & NAV --- */
header {
    background-color: var(--bg-header) !important;
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.nav-link:hover {
    color: var(--accent-primary);
}
.nav-link.active-link {
    color: var(--accent-primary);
    font-weight: 700;
    border-bottom: 2px solid var(--accent-secondary);
}

/* Bouton Theme */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
}
.theme-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-primary);
}

/* --- CHRONOLOGIES (TIMELINE) --- */
.timeline-pro {
    border-left: 3px solid var(--border-color);
    position: relative;
    padding-left: 20px;
}
.timeline-pro-item {
    position: relative;
    padding-bottom: 30px;
}
.timeline-pro-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--bg-primary);
}
.timeline-pro-item ul {
    list-style: none; padding-left: 0; margin-top: 0.5rem;
}
.timeline-pro-item ul li {
    position: relative; padding-left: 1.5rem; margin-bottom: 0.25rem;
}
.timeline-pro-item ul li::before {
    content: '•';
    color: var(--accent-secondary);
    font-size: 1.5em; line-height: 1;
    position: absolute; left: 0; top: -2px;
}

.timeline-formation {
    border-right: 3px solid var(--border-color);
    position: relative;
    padding-right: 20px;
    text-align: right;
}
.timeline-formation-item {
    position: relative;
    padding-bottom: 30px;
}
.timeline-formation-item::before {
    content: '';
    position: absolute;
    right: -27px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--bg-primary);
}
.timeline-formation-item ul {
    list-style: none; padding-right: 0; margin-top: 0.5rem;
}
.timeline-formation-item ul li {
    position: relative; padding-right: 1.5rem; margin-bottom: 0.25rem;
}
.timeline-formation-item ul li::before {
    content: '•';
    color: var(--accent-secondary);
    font-size: 1.5em; line-height: 1;
    position: absolute; right: 0; top: -2px;
}

/* --- DROPDOWN MENU --- */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%; left: 50%; transform: translateX(-50%);
    z-index: 50; min-width: 180px;
    background-color: var(--bg-header);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    border-radius: 0.5rem; overflow: hidden;
}
@media (min-width: 768px) {
    .dropdown:hover .dropdown-content { display: block; }
}
.dropdown-content a {
    display: block; padding: 0.75rem 1rem;
    color: var(--text-main); font-size: 0.875rem;
}
.dropdown-content a:hover {
    background-color: var(--bg-secondary); color: var(--accent-primary);
}

/* --- LIGHTBOX (Images) --- */
.lightbox {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
.lightbox img {
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.lightbox.active img {
    transform: scale(1);
}

/* --- MOBILE MENU --- */
#mobile-menu {
    background-color: var(--bg-header);
    border: 1px solid var(--border-color);
}
#mobile-menu a {
    color: var(--text-main);
}
#mobile-menu a:hover {
    background-color: var(--bg-secondary);
}

/* =========================================
   4. LOGIQUE SURVOL TABLEAU (E5)
   ========================================= */
/* Transition fluide pour toutes les cellules */
.editorial-table td {
    transition: background-color 0.2s ease;
}

/* 1. Survol d'une ligne standard : Allume ses propres cellules */
.editorial-table tr:hover td {
    background-color: var(--highlight-bg) !important;
}

/* 2. MAGIE : Si on survole la 2ème ligne d'un bloc, on allume la case "Bloc" (rowspan) de la ligne du dessus */
.editorial-table tr:has(+ tr:hover) > td[rowspan] {
    background-color: var(--highlight-bg) !important;
}

/* Mode Nuit : Adaptation de la couleur de survol */
[data-theme="dark"] .editorial-table tr:hover td,
[data-theme="dark"] .editorial-table tr:has(+ tr:hover) > td[rowspan] {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* =========================================
   5. CARTES CENTRES D'INTÉRÊT
   ========================================= */
.card-interest {
    background-color: #fff7ed; /* Orange 50 - Pastel chaud */
    color: #7c2d12; /* Orange 900 - Très contrasté pour la lecture */
    border: 1px solid #fed7aa; /* Orange 200 */
    font-weight: 600;
}
.card-interest:hover {
    background-color: #ffedd5; /* Orange 100 */
    color: #c05621; /* Accent Primary */
    border-color: #c05621;
}

/* Adaptation Nuit */
[data-theme="dark"] .card-interest {
    background-color: rgba(67, 20, 7, 0.4); /* Dark orange tint */
    color: #fdba74; /* Orange 300 - Lisible sur fond sombre */
    border-color: rgba(154, 52, 18, 0.3);
}
[data-theme="dark"] .card-interest:hover {
    background-color: rgba(154, 52, 18, 0.2);
    color: #fed7aa;
    border-color: #ed8936;
}