/* ==========================================
   1. STYLES GÉNÉRAUX (Base PC & Tablettes)
   ========================================== */
body {
    font-family: 'Calibri', 'Segoe UI', sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
    max-width: 850px;
    margin: 0 auto;
    padding: 40px 20px; /* Grand espacement élégant sur ordinateur */
    background-color: #fff;
}

header {
    text-align: center;
    border-bottom: 4px solid #1a1a1a;
    margin-bottom: 50px;
    padding-bottom: 20px;
}

header h1 {
    font-size: 3rem;
    text-transform: uppercase;
    margin: 0;
}

nav {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px; /* Espace équilibré pour PC */
    flex-wrap: wrap; /* Permet aux menus de ne pas déborder */
}

nav a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 5px 10px;
    border: 1px solid transparent;
}

nav a:hover, nav a.active {
    border-color: #1a1a1a;
}

/* --- Articles --- */
article {
    margin-bottom: 60px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.content {
    font-size: 1.2rem;
    text-align: left; /* Plus lisible que 'justify' sur tous supports */
}

.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Grille d'accueil --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.article-card {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: #ffffff;
    border: 2px solid #1a1a1a;
    text-decoration: none !important;
    color: #1a1a1a !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.extrait {
    display: -webkit-box;
    -webkit-line-clamp: 14;
    line-clamp: 14;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 8px 8px 0px #1a1a1a;
}
/* Style pour les citations dans les articles */
blockquote {
    border-left: 5px solid #28a745; /* Une barre verte élégante à gauche */
    margin: 1.5em 10px;
    padding: 0.5em 15px;
    color: #555;
    font-style: italic;
    background-color: #f9f9f9;
}

/* ==========================================
   2. CONFIGURATION SPÉCIFIQUE MOBILE 
   (S'active sous les 600px de large)
   ========================================== */
@media (max-width: 600px) {
    body {
        padding: 20px 15px;
    }

    /* --- Header Mobile --- */
    .header-top {
            flex-direction: column !important;
            align-items: center !important;
            gap: 15px;
            padding: 10px 0;
        }

    .lang-switcher {
            position: static !important; 
            justify-content: center;
            width: 100%;
        }
        
    .site-logo {
            font-size: 1.6rem !important;
            text-align: center;
            line-height: 1.2;
            width: 100%;
        }

    header h1 {
        font-size: 1.8rem;
        text-align: center;
    }

    /* --- Navigation Mobile --- */
    nav {
        gap: 10px;
    }

    nav a {
        font-size: 0.8rem;
        padding: 10px 12px;
        background: #f4f4f4; /* Fond gris clair par défaut pour le tactile */
        border-radius: 8px;   /* Arrondi plus prononcé sur mobile */
    }

    /* On garde le fond noir pour la catégorie active même sur mobile */
    nav a.active {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    /* --- Contenu --- */
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .content {
        font-size: 1.1rem;
    }
}

/* --- Alignement du Header --- */
.header-top {
    display: flex;
    justify-content: center; /* Centre le contenu horizontalement */
    align-items: center;    /* Aligne verticalement titre et drapeaux */
    position: relative;     /* Permet de positionner les drapeaux par rapport à ce bloc */
    padding: 20px 0;
}

.site-logo {
    font-size: 3rem;
    text-transform: uppercase;
    margin: 0;
}

.lang-switcher {
    position: absolute;
    right: 0;               /* Pousse les drapeaux tout à droite du titre */
    display: flex;
    gap: 10px;
}

.lang-switcher img {
    filter: grayscale(20%); /* Effet légèrement désaturé pour l'élégance */
    transition: transform 0.2s;
}

.lang-switcher img:hover {
    transform: scale(1.2);
    filter: grayscale(0%);
}

/* --- Catégorie Active (Cadre Noir Plein) --- */
/* --- Navigation & État Actif --- */
nav a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px; /* Ajuste cette valeur pour plus ou moins d'arrondi */
    transition: all 0.2s ease-in-out;
}

/* Style lors du survol et pour la page active */
nav a:hover, 
nav a.active {
    background-color: #1a1a1a; 
    color: #ffffff;            
    border-color: #1a1a1a;
    /* L'arrondi s'appliquera automatiquement au fond noir ici */
}

/* --- Temps de lecture (Point 2) --- */
.reading-time {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

/* --- Barre de progression (Point 4) --- */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}
#progress-bar {
    height: 100%;
    background: #1a1a1a;
    width: 0%;
}

/* --- Footer (Point 1) --- */
footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 60px 20px;
    margin-top: 80px;
    text-align: center;
}
.footer-content h2 {
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.footer-links {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-links a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-links a:hover { color: #fff; }
.site-footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 50px 20px;
    margin-top: 60px;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-column h3 {
    text-transform: uppercase;
    font-size: 1rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #fff;
    display: inline-block;
}

.footer-column ul { list-style: none; padding: 0; }
.footer-column ul li { margin-bottom: 10px; }
.footer-column a { color: #ccc; text-decoration: none; }
.footer-column a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 600px) {
    .footer-container { text-align: center; }
}

/* --- SECTION PARTAGE --- */
.share-box {
    margin: 40px 0;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.share-box p {
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.share-icons { 
    display: flex; 
    gap: 15px; 
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.2s, filter 0.2s;
}

/* Forcer la couleur blanche des icônes à l'intérieur des cercles */
.share-btn i {
    color: #ffffff !important;
}

.share-btn:hover { 
    transform: scale(1.1); 
    filter: brightness(1.1); 
}

/* Nettoyage des couleurs (recopie bien ce bloc précis) */
.x-twitter { background-color: #000000 !important; }
.facebook { background-color: #1877F2 !important; }
.linkedin { background-color: #0077B5 !important; }
.whatsapp { background-color: #25D366 !important; }
.x-twitter i {
    color: #ffffff !important;
    display: inline-block !important;
    visibility: visible !important;
}
/* --- FOOTER FINAL --- */
.site-footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 60px 20px 20px 20px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: left;
}

.footer-column h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 2px solid #fff;
    display: inline-block;
    padding-bottom: 5px;
}

.footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-list li {
    margin-bottom: 10px;
}

.footer-nav-list a {
    color: #ffffff;
    text-decoration: none;
}

.footer-nav-list a:hover {
    text-decoration: underline;
}

.footer-bottom {
    margin-top: 40px;
    text-align: center;
}

.footer-divider {
    border: 0;
    border-top: 1px solid #333;
    max-width: 1000px;
    margin: 0 auto 20px auto;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #888;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Style pour les mots du glossaire */
.glossary-term {
    border-bottom: 1px dashed #007bff;
    color: #007bff;
    cursor: help;
    position: relative;
    font-weight: 500;
}
    
    /* L'infobulle masquée par défaut */
    .glossary-term::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 120%;
        left: 50%;
        transform: translateX(-50%);
        background: #2c3e50;
        color: #fff;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 0.85rem;
        font-family: Arial, sans-serif;
        font-weight: normal;
        line-height: 1.4;
        width: max-content;
        max-width: 250px;
        white-space: normal;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, bottom 0.2s;
        z-index: 100;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    /* Le petit triangle sous la bulle */
    .glossary-term::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #2c3e50;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s;
        z-index: 100;
    }

    /* Affichage au survol */
    .glossary-term:hover::after,
    .glossary-term:hover::before {
        opacity: 1;
        visibility: visible;
        bottom: 100%;
    }