/* ============================================
   VARIABLES
   ============================================ */
   :root {
    /* Introduction */
    --intro-primary: #37474f;
    --intro-secondary: #455a64;
    --intro-light: #eceff1;
    
    /* EMI */
    --emi-primary: #7e57c2;
    --emi-secondary: #9575cd;
    --emi-light: #ede7f6;
    
    /* Info biaisée */
    --info-biaisee-primary: #ff5722;
    --info-biaisee-secondary: #ff8a65;
    --info-biaisee-light: #fbe9e7;
    
    /* Esprit critique */
    --esprit-critique-primary: #ff6f00;
    --esprit-critique-secondary: #ffb300;
    --esprit-critique-light: #fff8e1;
    
    /* Économie de l'attention (même couleur qu'esprit critique) */
    /* --economie-attention-primary: #ff6f00;
    --economie-attention-secondary: #ffb300;
    --economie-attention-light: #fff8e1; */
    
    /* Vérifier l'information (anciennes couleurs économie attention) */
    --verifier-info-primary: #9e9d24;
    --verifier-info-secondary: #c0ca33;
    --verifier-info-light: #f9fbe7;
    
    /* Données personnelles (anciennes couleurs fact-checking) */
    --donnees-perso-primary: #4caf50;
    --donnees-perso-secondary: #81c784;
    --donnees-perso-light: #e8f5e9;
    
    /* Vie numérique (anciennes couleurs données perso) */
    --vie-numerique-primary: #00acc1;
    --vie-numerique-secondary: #26c6da;
    --vie-numerique-light: #e0f7fa;
    
    /* Ancien indigo (pour header icon et footer links) */
    --accent-primary: #42a5f5;
    --accent-secondary: #64b5f6;
    
    /* Couleurs générales */
    --bg: #f4f6f8;
    /* --bg: #f0f3f5; */
    --text-dark: #37474f;
    --text-light: #757575;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

/* ============================================
   RESET ET BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.4;
    color: var(--text-dark);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
   header {
    background: white;
    box-shadow: 0 2px 4px var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

header h1 {
    font-size: 2rem;
    color: var(--text-dark);
    /* margin-bottom: 0.25rem; */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

header p {
    color: var(--text-light);
    font-size: 1.4rem;
    font-weight: 600;
}

.flower-link {
    display: inline-block;
    cursor: pointer;
    margin-right: 1rem;
}

.flower-decoration {
    height: 5rem;
    width: 5rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background-image: url('../img/flower-color.svg');
    background-size: contain;
    background-repeat: no-repeat;
}

.flower-link:hover .flower-decoration {
    transform: scale(1.1);
}

/* ============================================
   MAIN
   ============================================ */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading p {
    font-size: 1.2rem;
}

/* ============================================
   SECTIONS NIVEAU 1
   ============================================ */
.section-card {
    background: white;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
    transition: box-shadow 0.3s ease;
}

.section-card:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.section-header {
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: stretch;
    gap: 0;
    transition: background-color 0.3s ease;
    user-select: none;
    background: white;
}

.section-header .section-icon {
    font-size: 1.5rem;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-header h2 {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    transition: color 0.3s ease;
    color: var(--intro-primary);
}

.section-header .toggle-icon {
    font-size: 1rem;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, color 0.3s ease;
    color: var(--intro-primary);
}

.section-header.active .toggle-icon {
    transform: rotate(180deg);
}

/* Couleurs - Icône de gauche */
.section-card[data-section="intro"] .section-icon {
    background: var(--intro-primary);
    color: white;
}

.section-card[data-section="emi"] .section-icon {
    background: var(--emi-primary);
    color: white;
}

.section-card[data-section="info-biaisee"] .section-icon {
    background: var(--info-biaisee-primary);
    color: white;
}

.section-card[data-section="esprit-critique"] .section-icon {
    background: var(--esprit-critique-primary);
    color: white;
}

.section-card[data-section="economie-attention"] .section-icon {
    background: var(--economie-attention-primary);
    color: white;
}

.section-card[data-section="verifier-info"] .section-icon {
    background: var(--verifier-info-primary);
    color: white;
}

.section-card[data-section="donnees-perso"] .section-icon {
    background: var(--donnees-perso-primary);
    color: white;
}

.section-card[data-section="vie-numerique"] .section-icon {
    background: var(--vie-numerique-primary);
    color: white;
}

/* Hover & Active */
.section-card[data-section="intro"] .section-header:hover,
.section-card[data-section="intro"] .section-header.active {
    background: var(--intro-primary);
}

.section-card[data-section="intro"] .section-header:hover h2,
.section-card[data-section="intro"] .section-header:hover .toggle-icon,
.section-card[data-section="intro"] .section-header.active h2,
.section-card[data-section="intro"] .section-header.active .toggle-icon {
    color: white;
}

.section-card[data-section="emi"] .section-header:hover,
.section-card[data-section="emi"] .section-header.active {
    background: var(--emi-primary);
}

.section-card[data-section="emi"] .section-header:hover h2,
.section-card[data-section="emi"] .section-header:hover .toggle-icon,
.section-card[data-section="emi"] .section-header.active h2,
.section-card[data-section="emi"] .section-header.active .toggle-icon {
    color: white;
}

.section-card[data-section="info-biaisee"] .section-header:hover,
.section-card[data-section="info-biaisee"] .section-header.active {
    background: var(--info-biaisee-primary);
}

.section-card[data-section="info-biaisee"] .section-header:hover h2,
.section-card[data-section="info-biaisee"] .section-header:hover .toggle-icon,
.section-card[data-section="info-biaisee"] .section-header.active h2,
.section-card[data-section="info-biaisee"] .section-header.active .toggle-icon {
    color: white;
}

.section-card[data-section="esprit-critique"] .section-header:hover,
.section-card[data-section="esprit-critique"] .section-header.active {
    background: var(--esprit-critique-primary);
}

.section-card[data-section="esprit-critique"] .section-header:hover h2,
.section-card[data-section="esprit-critique"] .section-header:hover .toggle-icon,
.section-card[data-section="esprit-critique"] .section-header.active h2,
.section-card[data-section="esprit-critique"] .section-header.active .toggle-icon {
    color: white;
}

.section-card[data-section="economie-attention"] .section-header:hover,
.section-card[data-section="economie-attention"] .section-header.active {
    background: var(--economie-attention-primary);
}

.section-card[data-section="economie-attention"] .section-header:hover h2,
.section-card[data-section="economie-attention"] .section-header:hover .toggle-icon,
.section-card[data-section="economie-attention"] .section-header.active h2,
.section-card[data-section="economie-attention"] .section-header.active .toggle-icon {
    color: white;
}

.section-card[data-section="verifier-info"] .section-header:hover,
.section-card[data-section="verifier-info"] .section-header.active {
    background: var(--verifier-info-primary);
}

.section-card[data-section="verifier-info"] .section-header:hover h2,
.section-card[data-section="verifier-info"] .section-header:hover .toggle-icon,
.section-card[data-section="verifier-info"] .section-header.active h2,
.section-card[data-section="verifier-info"] .section-header.active .toggle-icon {
    color: white;
}

.section-card[data-section="donnees-perso"] .section-header:hover,
.section-card[data-section="donnees-perso"] .section-header.active {
    background: var(--donnees-perso-primary);
}

.section-card[data-section="donnees-perso"] .section-header:hover h2,
.section-card[data-section="donnees-perso"] .section-header:hover .toggle-icon,
.section-card[data-section="donnees-perso"] .section-header.active h2,
.section-card[data-section="donnees-perso"] .section-header.active .toggle-icon {
    color: white;
}

.section-card[data-section="vie-numerique"] .section-header:hover,
.section-card[data-section="vie-numerique"] .section-header.active {
    background: var(--vie-numerique-primary);
}

.section-card[data-section="vie-numerique"] .section-header:hover h2,
.section-card[data-section="vie-numerique"] .section-header:hover .toggle-icon,
.section-card[data-section="vie-numerique"] .section-header.active h2,
.section-card[data-section="vie-numerique"] .section-header.active .toggle-icon {
    color: white;
}

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.section-content.active {
    max-height: 10000px;
}

/* ============================================
   NIVEAU 2
   ============================================ */
.niveau2-item {
    border-bottom: 1px solid var(--border);
}

.niveau2-item:last-child {
    border-bottom: none;
}

.niveau2-header {
    width: 100%;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: none;  /* Ajouter */
    text-align: left;  /* Ajouter */
    font-family: inherit;  /* Ajouter */
    transition: background-color 0.2s ease;
    user-select: none;
}

.niveau2-header h3 {
    flex: 1; /* Ajouté pour que le titre prenne l'espace restant */
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
}

.niveau2-header .toggle-icon {
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.niveau2-header.active .toggle-icon {
    transform: rotate(180deg);
}

/* Couleurs niveau 2 actif ET hover (backgrounds clairs) */
.section-card[data-section="intro"] .niveau2-header:hover,
.section-card[data-section="intro"] .niveau2-header.active {
    background: var(--intro-light);
}

.section-card[data-section="emi"] .niveau2-header:hover,
.section-card[data-section="emi"] .niveau2-header.active {
    background: var(--emi-light);
}

.section-card[data-section="info-biaisee"] .niveau2-header:hover,
.section-card[data-section="info-biaisee"] .niveau2-header.active {
    background: var(--info-biaisee-light);
}

.section-card[data-section="esprit-critique"] .niveau2-header:hover,
.section-card[data-section="esprit-critique"] .niveau2-header.active {
    background: var(--esprit-critique-light);
}

.section-card[data-section="economie-attention"] .niveau2-header:hover,
.section-card[data-section="economie-attention"] .niveau2-header.active {
    background: var(--economie-attention-light);
}

.section-card[data-section="verifier-info"] .niveau2-header:hover,
.section-card[data-section="verifier-info"] .niveau2-header.active {
    background: var(--verifier-info-light);
}

.section-card[data-section="donnees-perso"] .niveau2-header:hover,
.section-card[data-section="donnees-perso"] .niveau2-header.active {
    background: var(--donnees-perso-light);
}

.section-card[data-section="vie-numerique"] .niveau2-header:hover,
.section-card[data-section="vie-numerique"] .niveau2-header.active {
    background: var(--vie-numerique-light);
}

.niveau2-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.niveau2-content.active {
    max-height: 8000px;
}

/* ============================================
   NIVEAU 3
   ============================================ */
.niveau3-item {
    padding: 1.5rem;
    margin: 1rem 1.5rem;
    background: white;
    border-left: 4px solid;
    border-radius: 4px;
}

/* Bordures colorées niveau 3 (couleurs intermédiaires) */
.section-card[data-section="intro"] .niveau3-item {
    border-left-color: var(--intro-secondary);
}

.section-card[data-section="emi"] .niveau3-item {
    border-left-color: var(--emi-secondary);
}

.section-card[data-section="info-biaisee"] .niveau3-item {
    border-left-color: var(--info-biaisee-secondary);
}

.section-card[data-section="esprit-critique"] .niveau3-item {
    border-left-color: var(--esprit-critique-secondary);
}

.section-card[data-section="economie-attention"] .niveau3-item {
    border-left-color: var(--economie-attention-secondary);
}

.section-card[data-section="verifier-info"] .niveau3-item {
    border-left-color: var(--verifier-info-secondary);
}

.section-card[data-section="donnees-perso"] .niveau3-item {
    border-left-color: var(--donnees-perso-secondary);
}

.section-card[data-section="vie-numerique"] .niveau3-item {
    border-left-color: var(--vie-numerique-secondary);
}

.niveau3-item h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.niveau3-item h4 i {
    font-size: 1.3rem;
}

.contenu-principal {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.contenu-principal strong {
    font-weight: 600;
}

/* ============================================
   ACCORDÉONS
   ============================================ */
.accordeons {
    margin-top: 1.5rem;
}

.accordeon {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.accordeon-header {
    width: 100%;
    background: white;
    border: none;
    padding: 1rem 1.25rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: background-color 0.2s ease;
}

.accordeon-header:hover {
    background: var(--bg);
}

.accordeon-header i {
    transition: transform 0.3s ease;
    color: var(--text-light);
    font-size: 0.9rem;
}

.accordeon-header.active {
    background: var(--bg);
}

.accordeon-header.active i {
    transform: rotate(180deg);
}

.accordeon-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordeon-content.active {
    max-height: 3000px;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}

.accordeon-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.accordeon-content li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.accordeon-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.accordeon-content p {
    margin: 0.75rem 0;
}

/* ============================================
   LIENS
   ============================================ */
   .liens {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}

.liens li {
    margin: 0.75rem 0;
    padding-left: 1.75rem;
    position: relative;
}

.liens li::before {
    content: "\f0c1";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--text-light);
}

.liens a {
    color: var(--accent-primary); /* Ancien indigo au lieu du violet EMI */
    text-decoration: none;
    transition: color 0.2s ease;
}

.liens a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* ============================================
   CHIFFRES (section intro)
   ============================================ */
   .chiffres-cles {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 colonnes égales sur grands écrans */
    gap: 1rem;
    margin: 1.5rem 0;
}

.chiffre-item {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--intro-primary);
}

.chiffre-item .nombre {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--intro-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.chiffre-item .description {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.4;
}

.chiffre-item .source {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.chiffre-item .source a {
    color: var(--text-light);
    text-decoration: none;
}

.chiffre-item .source a:hover {
    color: var(--intro-primary);
    text-decoration: underline;
}

/* Responsive pour les chiffres */
@media (max-width: 900px) {
    .chiffres-cles {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur tablette */
    }
}

@media (max-width: 600px) {
    .chiffres-cles {
        grid-template-columns: 1fr; /* 1 colonne sur mobile */
    }
}

/* ============================================
   MÉDIAS (IMAGES ET VIDÉOS)
   ============================================ */
.medias-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.media-item {
    margin: 0;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow);
}

.media-item img,
.media-item video {
    width: 100%;
    height: auto;
    display: block;
}

.media-item figcaption {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.media-item figcaption strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

/* Responsive médias */
@media (max-width: 768px) {
    .medias-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-top: 1rem;
    max-width: 600px;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
    background: var(--accent-primary);
    color: white;
    transform: rotate(90deg);
}

/* Animation d'entrée */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-image {
        max-height: 70vh;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .lightbox-caption {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        max-width: 90%;
    }
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: white;
    padding: 1rem 0;
    text-align: center;
    color: var(--text-light);
    box-shadow: 0 -2px 4px var(--shadow);
    margin-top: 1rem;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    font-size: 0.95rem;
    line-height: 1.8;
}

.footer-content a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* Contact */
.contact-short {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    header h1 {
        font-size: 1.7rem;
        text-align: center;   
    }
    header p {
        display: none;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .niveau3-item {
        margin: 1rem 0.5rem;
        padding: 1rem;
    }

    /* Niveau 1 - Désactiver le hover uniquement quand NON actif */
    .section-card .section-header:hover:not(.active) {
        background: white !important;
    }
    
    .section-card .section-header:hover:not(.active) h2,
    .section-card .section-header:hover:not(.active) .toggle-icon {
        color: var(--intro-primary) !important;
    }

    /* Footer */
    .copyright {
        display: block;
    }
    
    .separator-1 {
        display: none;
    }
}

/* Très petits écrans (< 480px) */
@media (max-width: 510px) {
    header h1 {
        font-size: 1.4rem;       
    }
    
    .flower-link {
        margin-right: 0;
    }

    .flower-decoration {
        height: 3rem;
        width: 3rem;
        transition: none;
    }
    
    .section-header h2 {
        padding: 0.8rem 1.25rem;
    }
    
    /* Footer */
    .contact-full {
        display: none;
    }
    
    .contact-short {
        display: inline;
    }
    
    footer {
        padding: 1rem 0;
    }
    
    .footer-content {
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    header h1 {
        font-size: 1.35rem;
        letter-spacing: normal;     
    }
}

@media (max-width: 381px) {
    header h1 {
        font-size: 1.3rem;
        letter-spacing: normal;     
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-card {
    animation: fadeIn 0.4s ease-out;
}