/* ================================================================
   Article Custom Styles - Ayi NEDJIMI Consultants
   Version: Complete from Production
   ================================================================ */

/* ===== Base Styles ===== */
[x-cloak] { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== Article Hero ===== */
.article-hero { 
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 50%, #1e1b4b 100%); 
    padding: 5rem 0; 
    text-align: center; 
    position: relative; 
    overflow: hidden; 
}
.article-hero::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background: radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.08) 0%, transparent 70%); 
}

/* ===== Article Content ===== */
.article-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
    font-size: 1.125rem !important;
    line-height: 1.75 !important;
}
/* ===== Article Chapeau (intro excerpt) ===== */
.article-chapeau {
    font-size: 1.2rem !important;
    line-height: 1.8 !important;
    color: #d1d5db !important;
    font-weight: 400;
    border-left: 3px solid #ef4444;
    padding: 1rem 1.25rem;
    margin: 0 0 2rem 0 !important;
    max-width: 860px !important;
    background: rgba(239,68,68,.04);
    border-radius: 0 0.5rem 0.5rem 0;
}

/* P4: H2 without Tailwind gradient classes get the same visual treatment */
.article-body h2:not([class*="bg-gradient"]):not([class*="text-transparent"]) {
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    margin-top: 4rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    scroll-margin-top: 120px;
    position: relative;
}
/* P6: Hide redundant section-nav blocks inside article body */
.article-body .section-nav { display: none !important; }

.article-content h2 { scroll-margin-top: 120px; margin-top: 6rem; margin-bottom: 2.5rem; position: relative; }
.article-content h2::before {
    content: '';
    position: absolute;
    top: -3rem;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
}
.article-content h3 { scroll-margin-top: 120px; margin-top: 3rem; margin-bottom: 1.5rem; }
.article-content ul { list-style: none; padding-left: 0; }

/* ===== Article Wrapper ===== */
.article-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 1280px) {
    .article-wrapper {
        display: flex;
        gap: 2rem;
        align-items: flex-start;
    }
}

/* ===== Reading Progress Bar ===== */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #ec4899);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ===== Sidebar Table of Contents ===== */
#sidebar-toc {
    display: none; /* Hidden by default, shown on xl screens */
}

@media (min-width: 1280px) {
    #sidebar-toc {
        display: block;
        position: sticky;
        top: 88px;
        width: 280px;
        flex-shrink: 0;
        align-self: flex-start;
        max-height: calc(100vh - 108px);
        overflow-y: auto;
        background: rgba(17, 24, 39, 0.95);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(239, 68, 68, 0.15);
        border-radius: 1rem;
        padding: 1.5rem;
        z-index: 40;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        order: -1; /* Sidebar on the left */
    }

    /* Hide inline TOC when sidebar is visible */
    #toc-inline {
        display: none;
    }

    /* Article takes remaining width */
    .article-wrapper > article {
        flex: 1;
        min-width: 0;
    }

    /* Remove horizontal padding from article-content since wrapper handles it */
    .article-wrapper .article-content {
        padding-left: 0;
        padding-right: 0;
        max-width: none;
    }
}

#sidebar-toc::-webkit-scrollbar { width: 6px; }
#sidebar-toc::-webkit-scrollbar-track { background: rgba(31, 41, 55, 0.5); border-radius: 3px; }
#sidebar-toc::-webkit-scrollbar-thumb { background: rgba(239, 68, 68, 0.35); border-radius: 3px; }
#sidebar-toc::-webkit-scrollbar-thumb:hover { background: rgba(239, 68, 68, 0.6); }

#sidebar-toc h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #ef4444;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

#sidebar-toc ul { list-style: none; padding: 0; margin: 0; }
#sidebar-toc li { margin-bottom: 0.5rem; }
#sidebar-toc a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}
#sidebar-toc a:hover {
    color: #d1d5db;
    background: rgba(239, 68, 68, 0.08);
    border-left-color: rgba(239, 68, 68, 0.5);
    transform: translateX(4px);
}
#sidebar-toc a.active {
    color: #fff;
    background: rgba(239, 68, 68, 0.12);
    border-left-color: #ef4444;
    font-weight: 600;
}

/* ===== Section Navigation ===== */
.section-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4rem 0 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: 1rem;
}

.section-nav-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(239, 68, 68, 0.08);
    color: #d1d5db;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}
.section-nav-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.section-nav-btn svg { width: 1.25rem; height: 1.25rem; }
.section-nav-btn.prev svg { margin-right: 0.5rem; }
.section-nav-btn.next svg { margin-left: 0.5rem; }

/* ===== SVG Container ===== */
.svg-container {
    background: linear-gradient(135deg, #1e1b4b 0%, #1f2937 100%);
    padding: 3rem;
    border-radius: 1rem;
    margin: 2rem auto;
    border: 1px solid rgba(239, 68, 68, 0.12);
    transition: all 0.3s ease;
    position: relative;
}
.svg-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}
.svg-container::after {
    content: '🔍 Cliquer pour agrandir';
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: rgba(139, 92, 246, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.svg-container:hover::after { opacity: 1; }
svg { max-width: 100%; height: auto; }

/* ===== Prose Typography ===== */
.prose { color: #D1D5DB; max-width: none; }
.prose h2 { 
    color: #FFF; 
    border-bottom: 2px solid #374151; 
    padding-bottom: 0.75rem; 
    margin-top: 3em; 
    margin-bottom: 1.5em; 
    font-size: 1.8em; 
    font-weight: 800; 
}
.prose h3 { 
    color: #f87171; 
    margin-top: 2.5em; 
    margin-bottom: 1em; 
    font-size: 1.5em; 
    font-weight: 700; 
}
.prose h4 { 
    color: #fb923c; 
    margin-top: 2em; 
    font-size: 1.25em; 
    font-weight: 600; 
}
.prose a { 
    color: #fb923c; 
    text-decoration: none; 
    border-bottom: 1px dotted #fb923c; 
    transition: all 0.3s; 
}
.prose a:hover { 
    border-bottom-style: solid; 
    color: #f87171; 
}
.prose strong { color: #FFF; font-weight: 600; }
.prose em { color: #9CA3AF; }
.prose p { margin-top: 1.25em; margin-bottom: 1.25em; }
.prose ul, .prose ol { 
    padding-left: 1.75rem; 
    margin: 1.5rem 0; 
    color: #e5e7eb; 
}
.prose li { margin-top: 0.5em; margin-bottom: 0.5em; }

/* Code blocks */
.prose code { 
    color: #e5e7eb; 
    background-color: #2b3649; 
    padding: 0.2em 0.5em; 
    margin: 0; 
    font-size: 90%; 
    border-radius: 4px; 
    font-family: 'Courier New', Consolas, monospace; 
}
.prose pre { 
    background-color: #1f2937; 
    padding: 1.5em; 
    border-radius: 8px; 
    overflow-x: auto; 
    border: 1px solid #374151; 
    margin: 2rem 0;
}
.prose pre code { 
    font-size: 0.9em; 
    background: transparent; 
    padding: 0; 
    color: #E0E7FF;
}

/* Tables */
.prose table { border-collapse: collapse; width: 100%; margin: 2rem 0; }
.prose th { 
    background: #1f2937; 
    color: #f87171; 
    font-weight: 700; 
    padding: 1rem; 
    border: 1px solid #374151; 
    text-align: left; 
}
.prose td { padding: 0.75rem 1rem; border: 1px solid #374151; }
.prose tr:nth-child(even) { background: rgba(31, 41, 55, 0.3); }
.prose tr:hover { background: #374151; }

/* Blockquotes */
.prose blockquote { 
    color: #9CA3AF; 
    border-left: 4px solid #EF4444; 
    padding: 1rem 1.5rem; 
    font-style: italic; 
    background: rgba(239, 68, 68, 0.05); 
    border-radius: 0.5rem; 
    margin: 2rem 0;
}

/* ===== Info/Warning/Defense Boxes ===== */
.attack-number { 
    background: linear-gradient(135deg, #DC2626, #EA580C); 
    color: white; 
    padding: 0.5rem 1rem; 
    border-radius: 9999px; 
    font-weight: 800; 
    display: inline-block; 
    margin-right: 0.75rem; 
    font-size: 1.1em; 
}

.defense-box { 
    background: rgba(34, 197, 94, 0.1); 
    border-left: 4px solid #22C55E; 
    padding: 1.5rem; 
    border-radius: 0.5rem; 
    margin: 2rem 0; 
}
.defense-box h4 { color: #22C55E !important; margin-top: 0; }

.warning-box { 
    background: rgba(251, 146, 60, 0.1); 
    border-left: 4px solid #FB923C; 
    padding: 1.5rem; 
    border-radius: 0.5rem; 
    margin: 2rem 0; 
}
.warning-box h4 { color: #FB923C !important; margin-top: 0; }

.info-box, .info-box-ia { 
    background: rgba(59, 130, 246, 0.1); 
    border-left: 4px solid #3B82F6; 
    padding: 1.5rem; 
    border-radius: 0.5rem; 
    margin: 2rem 0; 
}
.info-box h4, .info-box-ia h4 { color: #3B82F6 !important; margin-top: 0; }

.success-box { 
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%); 
    border-left: 4px solid #22c55e; 
    padding: 1.5rem; 
    border-radius: 0.5rem; 
    margin: 2rem 0; 
}

.highlight-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%);
    border-left: 4px solid #ef4444;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
    max-width: 1152px !important;
}

.cta-box { 
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(234, 88, 12, 0.15)); 
    border: 2px dashed #DC2626; 
    padding: 2.5rem; 
    border-radius: 1rem; 
    margin: 3rem 0; 
    text-align: center; 
}

/* ===== Table of Contents (Inline) ===== */
.table-of-contents, .toc-box { 
    background: #1f2937; 
    border: 1px solid #374151; 
    border-radius: 0.75rem; 
    padding: 2rem; 
    margin: 2rem 0; 
}
.table-of-contents h2, .table-of-contents h3,
.toc-box h2, .toc-box h3 { 
    color: #fff !important; 
    margin-top: 0 !important; 
    border: none !important;
    padding-bottom: 0 !important;
}
.table-of-contents ul, .toc-box ul { list-style: none; padding-left: 0; margin: 0; }
.table-of-contents li, .toc-box li { padding: 0.5rem 0; border-bottom: 1px solid #374151; }
.table-of-contents li:last-child, .toc-box li:last-child { border-bottom: none; }
.table-of-contents a, .toc-box a { color: #fb923c; font-weight: 500; text-decoration: none; border-bottom: none !important; }
.table-of-contents a:hover, .toc-box a:hover { color: #f87171; }

/* TOC container alignment */
.article-content .toc-container { max-width: 1152px !important; text-align: left !important; }
.article-content .toc-container ol { max-width: 100% !important; width: 100% !important; text-align: left !important; padding-left: 0 !important; margin-left: 0 !important; }
.article-content .toc-container li { max-width: 100% !important; width: 100% !important; text-align: left !important; }
.article-content .toc-container li.flex { justify-content: flex-start !important; flex-direction: row !important; align-items: flex-start !important; text-align: left !important; }
/* Numéro : taille fixe, pas de flex-grow */
.article-content .toc-container li.flex > span:first-child { flex: 0 0 auto !important; min-width: 2rem; }
/* Lien : prend tout l'espace restant */
.article-content .toc-container li.flex > a,
.article-content .toc-container li.flex > span:not(:first-child) > a { flex: 1 1 auto !important; }
.article-content .toc-container a { text-align: left !important; display: block !important; width: 100% !important; border-bottom: none !important; text-decoration: none !important; }
/* Supprime le double soulignement sur tous les liens de sommaire */
.article-content .toc-container a,
.article-content .table-of-contents a,
.article-content .toc-box a { border-bottom: none !important; text-decoration: none !important; }

/* ===== Author Bio ===== */
.author-bio {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%);
    border: 2px solid rgba(239, 68, 68, 0.12);
    border-radius: 1.5rem;
    padding: 3rem;
    margin: 5rem auto 3rem;
    max-width: 1200px;
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
    position: relative;
    overflow: hidden;
}
.author-bio::before {
    content: '';
    position: absolute;
    top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.author-container {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}
.author-photo {
    border-radius: 50%;
    border: 5px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    object-fit: cover;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== SVG Grid ===== */
.svg-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin: 3rem 0; }
@media (min-width: 768px) { .svg-grid { grid-template-columns: repeat(2, 1fr); } }
.svg-grid-item {
    background: linear-gradient(135deg, #1e1b4b 0%, #1f2937 100%);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.12);
    transition: all 0.3s ease;
    cursor: pointer;
}
.svg-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}
.svg-caption { text-align: center; margin-top: 1rem; font-size: 0.875rem; color: #9ca3af; font-style: italic; }

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.lightbox.active { display: flex; }
.lightbox-content { max-width: 95%; max-height: 90vh; overflow: auto; }
.lightbox-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: white;
    width: 3rem; height: 3rem;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.lightbox-close:hover { background: rgba(139, 92, 246, 0.4); transform: scale(1.1); }

/* ===== Section Badge ===== */
.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #ef4444, #ec4899);
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
    margin-right: 1rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* ===== Width Uniformity ===== */
.article-content .text-lg { font-size: 1.125rem !important; line-height: 1.75 !important; }
.article-content > *:not(.svg-container):not(.section-nav):not(#sidebar-toc):not(.overflow-x-auto):not(.toc-container):not(table):not(aside) {
    max-width: 1152px !important;
    width: 100% !important;
}
.article-content p, .article-content ul, .article-content ol, .article-content blockquote,
.article-content h3, .article-content h4, .article-content h5, .article-content > strong {
    max-width: 1152px !important;
}
.article-content > strong { display: block !important; max-width: 1152px !important; width: 100% !important; margin-bottom: 0.75rem; }
.article-content p strong, .article-content p em, .article-content li strong, .article-content li em {
    max-width: none !important; display: inline !important; width: auto !important;
}
.article-content ul, .article-content ol { max-width: 1152px !important; width: 100% !important; }
.article-content li { font-size: 1.125rem !important; line-height: 1.75 !important; max-width: 100% !important; }
.article-content li.flex span { max-width: none !important; flex: 1 1 auto; }
.article-content span { max-width: none !important; }
.article-content [class*="max-w-"]:not(.svg-container):not(.section-nav):not(.toc-container):not([class*="svg-"]) { max-width: 1152px !important; }
.article-content > div:not(.svg-container):not(.section-nav):not(.toc-container):not(.overflow-x-auto):not([class*="svg-"]) { max-width: 1152px !important; }
.article-content .svg-container, .article-content [class*="svg-"] { max-width: 100% !important; }
.article-content table, .article-content .overflow-x-auto { max-width: 100% !important; width: 100% !important; }
.article-content h2, .article-content .svg-container, .article-content .section-nav, #sidebar-toc { max-width: 100% !important; }
.article-content p, .article-content > strong, .article-content li,
.article-content > div:not(.svg-container):not(.section-nav):not(.toc-container) { text-align: left !important; }

/* ===== Tool Cards ===== */
.tool-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s;
}
.tool-card:hover { border-color: #fb923c; transform: translateY(-2px); }

/* ===== Category Tags ===== */
.article-category { 
    display: inline-block; 
    background: #374151; 
    color: #d1d5db; 
    padding: 0.25rem 0.75rem; 
    border-radius: 0.375rem; 
    font-size: 0.875rem; 
    margin-bottom: 1rem; 
}
.category-vectorielles { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.category-optimisation { background: linear-gradient(135deg, #ec4899 0%, #be185d 100%); }
.category-forensics { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.category-securite { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

/* ===== Gradient Text ===== */
.gradient-text-ia { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text;
}
.gradient-text-forensics {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Article Navigation ===== */
.nav-article { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.5rem 0; 
    margin-top: 3rem;
    border-top: 1px solid #374151;
}
.nav-prev, .nav-next { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    padding: 0.75rem 1.5rem; 
    background: #1f2937; 
    border-radius: 0.5rem; 
    transition: all 0.3s; 
    text-decoration: none; 
    color: #d1d5db; 
}
.nav-prev:hover, .nav-next:hover { background: #374151; color: #fff; }

/* ===== Step/Section Numbers ===== */
.step-number, .section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 1rem;
}

/* ===== Forensics specific ===== */
.forensic-artifact {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.forensic-path {
    font-family: 'Courier New', monospace;
    background: #1f2937;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: #60a5fa;
}

/* ===== Badge Animation ===== */
.badge-new { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

/* ===== TOC Inline Styles ===== */
.toc-inline {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

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

.toc-list li {
    margin: 0.5rem 0;
}

.toc-h2 {
    padding-left: 0;
}

.toc-h3 {
    padding-left: 1.25rem;
}

.toc-link {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: block;
    padding: 0.25rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}

.toc-link:hover {
    color: #A78BFA;
}

.toc-link.active {
    color: #A78BFA;
    border-left-color: #8B5CF6;
    font-weight: 500;
}

/* ===== Reading Progress Bar ===== */
#reading-progress-container {
    background: rgba(31, 41, 55, 0.5);
}

#reading-progress {
    background: linear-gradient(90deg, #8B5CF6, #6366F1);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* ===== Lightbox ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 2rem;
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    position: relative;
}

.lightbox-content img,
.lightbox-content svg {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ===== Code Copy Button ===== */
.code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem;
    background: rgba(75, 85, 99, 0.8);
    border: none;
    border-radius: 0.375rem;
    color: #D1D5DB;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: rgba(107, 114, 128, 0.9);
}

/* ===== Article Body Typography ===== */
.article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.article-body h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #E5E7EB;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-body h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #D1D5DB;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-body p {
    color: #9CA3AF;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
    color: #9CA3AF;
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    border-left: 4px solid #8B5CF6;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #A78BFA;
    font-style: italic;
    background: rgba(239, 68, 68, 0.08);
    padding: 1rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.article-body pre {
    background: #1F2937;
    border-radius: 0.75rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #374151;
}

.article-body code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.article-body :not(pre) > code {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.article-body a {
    color: #A78BFA;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.article-body a:hover {
    color: #C4B5FD;
}

.article-body img {
    border-radius: 0.75rem;
    margin: 1.5rem auto;
    max-width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-body th,
.article-body td {
    padding: 0.75rem 1rem;
    border: 1px solid #374151;
    text-align: left;
}

.article-body th {
    background: #1F2937;
    color: #fff;
    font-weight: 600;
}

.article-body td {
    color: #9CA3AF;
}

.article-body tr:nth-child(even) {
    background: rgba(31, 41, 55, 0.5);
}

/* Line clamp utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== SEO/LLMO 2026 — Citation-ready boxes ===== */

/* Key Takeaway / A Retenir */
.key-takeaway,
.a-retenir {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.08) 0%, rgba(234, 179, 8, 0.08) 100%);
    border: 2px solid rgba(250, 204, 21, 0.4);
    border-left: 5px solid #FACC15;
    padding: 2rem 2rem 1.5rem;
    border-radius: 0 0.75rem 0.75rem 0;
    margin: 2.5rem 0;
    position: relative;
}
.key-takeaway::before,
.a-retenir::before {
    content: '\00C0 retenir';
    display: inline-block;
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #FACC15;
    color: #1F2937;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.75rem;
    border-radius: 0.25rem;
}
.key-takeaway p,
.a-retenir p {
    color: #FEF9C3 !important;
    font-weight: 500;
    line-height: 1.75;
    margin: 0 !important;
}
.key-takeaway strong,
.a-retenir strong {
    color: #FACC15 !important;
}

/* Definition Box */
.definition-box {
    background: rgba(147, 51, 234, 0.06);
    border: 1px solid rgba(147, 51, 234, 0.25);
    border-left: 5px solid #9333EA;
    padding: 1.5rem 2rem;
    border-radius: 0 0.75rem 0.75rem 0;
    margin: 2rem 0;
}
.definition-box::before {
    content: 'D\00E9finition';
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #A855F7;
    margin-bottom: 0.5rem;
}
.definition-box p {
    color: #E9D5FF !important;
    line-height: 1.75;
    margin: 0 !important;
}
.definition-box strong,
.definition-box dfn {
    color: #C084FC !important;
    font-style: normal;
    font-weight: 700;
}

/* FAQ Section */
.faq-section {
    margin: 3rem 0;
}
.faq-item {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.3s;
}
.faq-item:hover {
    border-color: rgba(139, 92, 246, 0.5);
}
.faq-question {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #F3F4F6;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background 0.2s;
    user-select: none;
}
.faq-question:hover {
    background: rgba(139, 92, 246, 0.05);
}
.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: #8B5CF6;
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 1rem;
}
.faq-item.active .faq-question::after {
    content: '\2212';
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.3s;
    padding: 0 1.5rem;
}
.faq-item.active .faq-answer {
    max-height: 600px;
    padding: 0 1.5rem 1.25rem;
}
.faq-answer p {
    color: #9CA3AF !important;
    line-height: 1.75;
}

/* Citation Box */
.citation-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-left: 5px solid #3B82F6;
    padding: 1.75rem 2rem;
    border-radius: 0 0.75rem 0.75rem 0;
    margin: 2rem 0;
    position: relative;
}
.citation-box::before {
    content: '\201C';
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    font-size: 2.5rem;
    color: rgba(59, 130, 246, 0.3);
    font-family: Georgia, serif;
    line-height: 1;
}
.citation-box p {
    color: #BFDBFE !important;
    font-size: 1.05rem;
    line-height: 1.75;
    margin: 0 !important;
    padding-left: 1rem;
}
.citation-box .citation-source {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #60A5FA;
    font-style: italic;
}

/* ===== HUMAN.md — Humanization Boxes ===== */

.failure-story {
    background-color: rgba(220, 53, 69, 0.08);
    border-left: 4px solid #dc3545;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 0.75rem 0.75rem 0;
    position: relative;
}
.failure-story::before {
    content: 'Ce qui n\0027a pas march\00E9';
    display: inline-block;
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.75rem;
    border-radius: 0.25rem;
}
.failure-story p { color: #fca5a5 !important; line-height: 1.75; }
.failure-story strong { color: #f87171 !important; }

.hot-take {
    background: rgba(255, 193, 7, 0.08);
    border-left: 4px solid #ffc107;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 0.75rem 0.75rem 0;
    position: relative;
}
.hot-take::before {
    content: 'Hot Take';
    display: inline-block;
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #ffc107;
    color: #1F2937;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.75rem;
    border-radius: 0.25rem;
}
.hot-take p { color: #fde68a !important; line-height: 1.75; }
.hot-take strong { color: #fbbf24 !important; font-style: italic; }

.opinion-box {
    background: rgba(0, 102, 204, 0.08);
    border-left: 4px solid #0066cc;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 0.75rem 0.75rem 0;
    position: relative;
}
.opinion-box::before {
    content: 'Avis d\0027expert';
    display: inline-block;
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #0066cc;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.75rem;
    border-radius: 0.25rem;
}
.opinion-box p { color: #93c5fd !important; line-height: 1.75; }
.opinion-box strong { color: #60a5fa !important; }

.rex-box {
    background: rgba(40, 167, 69, 0.08);
    border-left: 4px solid #28a745;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 0.75rem 0.75rem 0;
    position: relative;
}
.rex-box::before {
    content: 'Retour d\0027exp\00E9rience';
    display: inline-block;
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #28a745;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.75rem;
    border-radius: 0.25rem;
}
.rex-box p { color: #86efac !important; line-height: 1.75; }
.rex-box strong { color: #4ade80 !important; }

.human-check {
    background: rgba(0, 200, 83, 0.06);
    border-left: 4px solid #00c853;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.9rem;
}
.human-check::before {
    content: '\2713  V\00E9rifi\00E9 manuellement';
    display: block;
    font-weight: 700;
    color: #00c853;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.human-check p { color: #a7f3d0 !important; margin: 0 !important; }

.soc-scenario {
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: 'Fira Code', 'Courier New', monospace;
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
    margin: 2rem 0;
    border-left: 4px solid #a6e3a1;
    font-size: 0.9rem;
    line-height: 1.8;
    position: relative;
}
.soc-scenario::before {
    content: 'Sc\00E9nario SOC';
    display: inline-block;
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #a6e3a1;
    color: #1e1e2e;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.75rem;
    border-radius: 0.25rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.soc-scenario strong { color: #f9e2af; }

/* ================================================================
   MICRO-ANIMATIONS — Article Cards & Mega Menu
   ================================================================ */

/* ── 5. Card entrance stagger ── */
.article-card {
    position: relative;
    z-index: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .4s ease var(--delay, 0ms), transform .4s ease var(--delay, 0ms), box-shadow .25s ease, border-color .25s ease;
    overflow: hidden;
    isolation: isolate;
    /* Subtle default border — presque invisible */
    border-color: rgba(55, 65, 81, 0.35) !important;
}
.article-card.revealed {
    opacity: 1;
    transform: translateY(0);
}
/* Hover glow Vercel/OpenAI style */
.article-card:hover {
    border-color: rgba(239, 68, 68, 0.0) !important;
    box-shadow:
        0 0 0 1px rgba(239, 68, 68, 0.35),
        0 0 20px rgba(239, 68, 68, 0.12),
        0 8px 32px rgba(0, 0, 0, 0.45);
    transform: translateY(-3px);
}

/* ── 7. Border gradient animé (hover) ── */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.article-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(from var(--angle), transparent 60%, #ef4444, #f97316, #ef4444, transparent 40%);
    z-index: -1;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.article-card:hover::before {
    opacity: 1;
    animation: borderSpin 3s linear infinite;
}
@keyframes borderSpin {
    to { --angle: 360deg; }
}

/* ── 8. Badge pulse contextuel ── */
.category-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, rgba(239,68,68,.15), rgba(249,115,22,.15));
    color: #f87171;
    border: 1px solid rgba(239,68,68,.2);
    transition: transform .2s ease, box-shadow .2s ease;
}
.article-card:hover .category-badge {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(239,68,68,.25);
}

/* ── 9. Read time indicator bar ── */
.read-time-bar {
    height: 2px;
    background: rgba(75,85,99,.3);
    border-radius: 9999px;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.read-time-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 9999px;
    width: calc(var(--rt, 0) * 5%);
    max-width: 100%;
    transition: width .6s ease;
}

/* ── 10. Read CTA slide ── */
.read-cta {
    transition: transform .2s ease;
}
.article-card:hover .read-cta {
    transform: translateX(4px);
}

/* ── 4. Cursor spotlight CSS ── */
[data-spotlight] {
    position: relative;
}
[data-spotlight]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(239,68,68,.04), transparent 60%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity .3s;
}
[data-spotlight]:hover::after {
    opacity: 1;
}

/* ── Scroll reveal animations ── */
.scroll-animate.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease, transform .5s ease;
    transition-delay: var(--delay, 0ms);
}
.scroll-animate.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Accessibility: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .mega-stagger { animation: none !important; opacity: 1 !important; transform: none !important; }
    .scroll-animate.fade-in { opacity: 1 !important; transform: none !important; transition: none !important; }
    .article-card { opacity: 1 !important; transform: none !important; transition: none !important; }
    .article-card::before { animation: none !important; }
    .article-card:hover .category-badge { transform: none !important; }
    .article-card:hover .read-cta { transform: none !important; }
}

/* ── SVG responsive + emoji size fix ── */
.article-body svg {
    max-width: 100%;
    height: auto;
}
.article-body img.emoji,
.article-body img[src*='emoji'],
.article-body img[src*='twemoji'] {
    display: inline;
    height: 1.1em;
    width: 1.1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}
