/* ----------------------------------------------------------------------
   DESIGN SYSTEM - RECONSTRUCTION MINIMALISTE INTERNATIONALE ACCESSIBLE
   ---------------------------------------------------------------------- */
:root {
    --bg-main: #F5F3EF;       /* Teinte papier mat haut de gamme */
    --bg-card: #FFFFFF;
    --text-main: #1A1D21;     /* Contraste élevé certifié WCAG 2.2 */
    --text-muted: #535961;
    --primary: #1E2A38;       /* Bleu institutionnel et de commandement */
    --secondary: #8C6A43;     /* Teinte bronze de rappel d'autorité */
    --border: #D1CBC4;
    --success: #1E4620;
    --font-titles: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Source Serif 4', Georgia, serif;
}

[data-theme="dark"] {
    --bg-main: #111418;       /* Immersion obscure pour la fatigue oculaire */
    --bg-card: #1A1D21;
    --text-main: #ECECEC;     /* Gris adouci pour l'affichage émetteur de lumière */
    --text-muted: #A3AAB4;
    --primary: #384E68;
    --secondary: #C5A073;
    --border: #2D3239;
}

/* Règle d'Accessibilité Majeure : Respect des choix utilisateurs de réduction d'animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.75;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 {
    font-family: var(--font-titles);
    color: var(--primary);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; margin-top: 2rem; }

.container { width: 100%; max-width: 1740px; margin: 0 auto; padding: 0 1.5rem; }
.card { background-color: var(--bg-card); border: 1px solid var(--border); padding: 2rem; border-radius: 4px; }

/* Styles UI des Composants Principaux */
.site-header { border-bottom: 1px solid var(--border); background-color: var(--bg-card); padding: 1rem 0; }
.header-wrapper { display: flex; justify-content: space-between; align-items: center; }
.site-logo { font-family: var(--font-titles); font-weight: 800; font-size: 1.25rem; color: var(--text-main); text-decoration: none; text-transform: uppercase; letter-spacing: 0.05em; }
.main-nav ul { display: flex; list-style: none; gap: 2rem; }
.main-nav a { font-family: var(--font-titles); font-size: 0.95rem; font-weight: 500; color: var(--text-muted); text-decoration: none; }
.main-nav a:hover { color: var(--primary); }

.theme-btn { background: none; border: 1px solid var(--border); color: var(--text-main); cursor: pointer; padding: 0.5rem; border-radius: 4px; }
[data-theme="light"] .moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: block; }

/* Styles UI de la Section de Lecture et de l'Article */
.prose-container { max-width: 1020px; margin: 0 auto; }
.article-header { margin-bottom: 3rem; border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.article-meta-info { font-family: var(--font-titles); font-size: 0.875rem; color: var(--text-muted); margin-top: 0.5rem; }
.article-summary-lead { font-size: 1.35rem; color: var(--text-muted); font-style: italic; margin-top: 1.5rem; line-height: 1.6; }
.article-body-content p { margin-bottom: 1.5rem; text-align: justify; }

/* Boutons et Éléments de Formulaire */
.btn { display: inline-flex; align-items: center; padding: 0.75rem 1.5rem; font-family: var(--font-titles); font-size: 0.95rem; font-weight: 600; text-decoration: none; border-radius: 4px; cursor: pointer; border: none; }
.btn-primary { background-color: var(--primary); color: #FFFFFF; }
.btn-primary:hover { opacity: 0.9; }
.form-control { width: 100%; padding: 0.75rem; border: 1px solid var(--border); background-color: var(--bg-main); color: var(--text-main); font-family: inherit; border-radius: 4px; }

/* Lien d'évitement WCAG invisible par défaut */
.skip-link { position: absolute; top: -100px; left: 0; background: var(--secondary); color: #FFF; padding: 1rem; z-index: 100; transition: top 0.2s; }
.skip-link:focus { top: 0; }

/* Traitement Adaptatif de l'intégration PDF en fonction de la largeur de l'écran */
@media (max-width: 768px) {
    .pdf-viewer-container { display: none; } /* Suppression complète de l'objet lourd figé sur terminaux mobiles */
}

/* ==========================================================================
   CONFIGURATION DU GÉNÉRATEUR PDF INTERNE (CSS PRINT)
   ========================================================================== */
@media print {
    /* 1. Masquer les éléments web inutiles pour la Doctrine */
    header, 
    footer, 
    .no-print, 
    .nav, 
    .admin-bar, 
    button, 
    #sidebar {
        display: none !important;
    }

    /* 2. Configurer le format de la page A4 */
    @page {
        size: A4 portrait;
        margin: 25mm 20mm 25mm 20mm; /* Marges académiques de 2,5 cm */
    }

    /* 3. Style du document de recherche */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Georgia', 'Times New Roman', serif !important;
        font-size: 11pt;
        line-height: 1.6;
    }

    #main-content, .card {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }

    /* En-tête de l'article */
    h1 {
        font-size: 26pt;
        margin-top: 0;
        margin-bottom: 10px;
        text-align: left;
    }

    /* Typographie des titres de sections */
    h2 {
        font-size: 16pt;
        margin-top: 30px;
        border-bottom: 0.5pt solid #000000;
        padding-bottom: 5px;
        page-break-after: avoid; /* Interdit de laisser un titre seul en bas de page */
    }

    h3 {
        font-size: 13pt;
        margin-top: 20px;
        page-break-after: avoid;
    }

    p {
        text-align: justify; /* Alignement rigoureux de la doctrine */
        margin-bottom: 12pt;
    }

    /* Citations et extraits de textes */
    blockquote {
        margin: 20px 0;
        padding-left: 15px;
        border-left: 3pt solid #333333;
        font-style: italic;
        color: #222222;
        page-break-inside: avoid;
    }

    /* Gérer proprement les infographies insérées */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid; /* L'infographie ne sera jamais coupée en deux horizontalement */
        margin: 20px auto;
        display: block;
    }
}

/* ==========================================
   ZONE DE TÉLÉCHARGEMENT PDF (PUBLICATIONS)
   ========================================== */
.pdf-download-zone {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    /* Utilise la couleur de fond et de bordure de vos cartes standards */
    background-color: var(--bg-card, #fafafa); 
    border: 1px solid var(--border-color, #eee);
}

.pdf-download-zone p {
    margin-top: 0;
    font-weight: bold;
    color: var(--text-main, #111);
}

.pdf-download-zone .btn-download {
    display: inline-block;
    background-color: var(--text-main, #111);
    color: var(--bg-main, #fff);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.pdf-download-zone .btn-download:hover {
    opacity: 0.9;
}
/* ==========================================
   INTEGRATION LOGO ET SÉCURITÉ THÈME
   ========================================== */

.brand-container {
    transition: opacity 0.2s ease;
}

.brand-container:hover {
    opacity: 0.85;
}

/* Gestion du logo carré */
.header-logo {
    display: block;
    border-radius: 4px; /* Un léger arrondi adoucit les angles du logo carré */
}

/*ASTUCE DARK MODE : Si le fichier logo.jpg possède un fond blanc natif 
   qui jure en mode sombre, on lui applique un léger filtre ou une opacité 
   pour l'intégrer en douceur sans altérer le fichier d'origine. */
[data-theme="dark"] .header-logo {
    opacity: 0.9;
}

/* =======================================================================
   GRILLE ÉDITORIALE AVANCÉE ET HIÉRARCHISÉE (ACCUEIL)
   ======================================================================= */

/* Comportement de base par défaut : Mobile (Tout s'empile sur 1 colonne) */
.editorial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
}

.card-featured-fondatrice .article-title { font-size: 1.6rem; }
.card-featured-strategique .article-title { font-size: 1.4rem; }
.article-card .article-title { font-size: 1.25rem; }

/* Grand écran : Passage à la grille asymétrique de 3 colonnes */
@media (min-width: 1024px) {
    .editorial-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Niveau 2 : La publication fondatrice prend le haut à gauche et s'étend sur 2 lignes de hauteur */
    .card-featured-fondatrice {
        grid-column: 1;
        grid-row: 1 / span 2;
        background-color: var(--bg-card-accent, rgba(0, 0, 0, 0.02));
        border: 2px solid var(--text-main);
    }
    
    /* Changement de thème : ajustement du fond d'accentuation en mode sombre */
    [data-theme="dark"] .card-featured-fondatrice {
        background-color: rgba(255, 255, 255, 0.03);
    }

    /* Niveau 3 : La publication stratégique se place en haut au milieu/droite */
    .card-featured-strategique {
        grid-column: 2 / span 2;
        grid-row: 1 / span 1;
        border: 1px solid var(--text-main);
        border-bottom: 3px double var(--text-main);
    }

    /* Niveau 4 : Les cartes standards se répartissent naturellement dans l'espace restant */
}

/* Animation douce au survol global */
.article-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover {
    transform: translateY(-3px);
}
/* Cohérence visuelle du mode sombre pour la carte fondatrice */
[data-theme="dark"] .card-featured-fondatrice {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Animation fluide sur l'ensemble des cartes au survol */
.article-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover {
    transform: translateY(-3px);
}

/* ==========================================================================
   CORRECTIONS ET OPTIMISATIONS RESPONSIVE (MOBILE)
   ========================================================================== */

/* Style du bouton burger (masqué sur ordinateur) */
.menu-toggle-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
}

/* 📱 ÉCRANS MOBILES & TABLETTES (Max 768px) */
@media (max-width: 768px) {
    .menu-toggle-btn {
        display: inline-flex; /* Devient visible sur mobile */
    }

    .header-wrapper {
        position: relative; /* Référentiel pour l'affichage absolu du menu */
    }

    /* Transformation de la navigation en menu déroulant plein écran / sous le header */
    .main-nav {
        display: none; /* Masqué par défaut */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
        z-index: 999;
        padding: 1.5rem;
    }

    /* Classe activée par le JavaScript lors du clic */
    .main-nav.is-open {
        display: block;
    }

    /* Alignement vertical des liens du menu */
    .main-nav ul {
        flex-direction: column;
        gap: 1.25rem;
    }

    .main-nav a {
        display: block;
        font-size: 1.1rem;
        padding: 0.25rem 0;
        width: 100%;
    }

    /* --- EFFONDREMENT DU MANIFESTE --- */
    .manifesto-zone {
        padding: 1.5rem !important; /* Réduction des paddings sur mobile */
    }

    /* Quand la classe est active, on cache le corps du texte */
    .manifesto-zone.is-collapsed .manifesto-content {
        display: none;
    }

    /* Style du bouton "Afficher la suite" */
    .manifesto-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 1.25rem;
        background-color: transparent;
        border: 1px solid var(--text-main);
        color: var(--text-main);
        font-family: var(--font-titles);
        font-size: 0.9rem;
        font-weight: 600;
        padding: 0.6rem 1rem;
        border-radius: 4px;
        cursor: pointer;
        width: 100%;
        transition: background-color 0.2s ease;
    }
    
    .manifesto-toggle-btn:hover {
        background-color: rgba(0, 0, 0, 0.02);
    }
    
    [data-theme="dark"] .manifesto-toggle-btn:hover {
        background-color: rgba(255, 255, 255, 0.03);
    }
}

/* 💻 SÉCURITÉ GRAND ÉCRAN : Force le bouton mobile à disparaître sur PC */
@media (min-width: 769px) {
    .manifesto-toggle-btn {
        display: none !important;
    }
}