/* ============================================================
   EVONET V2 - Light Theme · Cybersécurité/Tech
   Palette : Gris-bleu doux · Confort oculaire · Accent cyan
   ============================================================ */

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
    /* Couleurs de fond - blanc crème, confort naturel */
    --bg-primary:    #faf9f6;
    --bg-secondary:  #c3c2bf;
    --bg-tertiary:   #e8e4dc;
    --bg-card:       #faf8f5;
    --bg-hover:      #e6f4ff;

    /* Bordures */
    --border-color:  #ddd8cf;
    --border-light:  #e8e4dc;

    /* Textes */
    --text-primary:   #0f172a;
    --text-secondary: #334155;
    --text-muted:     #7a8899;

    /* Accent bleu-cyan tech */
    --accent:         #0ea5e9;
    --accent-hover:   #0284c7;
    --accent-glow:    rgba(14, 165, 233, 0.12);
    --accent-border:  rgba(14, 165, 233, 0.30);

    /* États */
    --success:  #10b981;
    --warning:  #f59e0b;
    --danger:   #ef4444;
    --info:     #6366f1;

    /* Glassmorphism - non utilisé sur le header en thème clair (overridé ci-dessous) */
    --glass-bg:     rgba(250, 249, 246, 0.92);
    --glass-border: rgba(255, 255, 255, 0.70);

    /* Ombres */
    --shadow:        0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-sm:     0 2px 8px  rgba(15, 23, 42, 0.05);
    --shadow-lg:     0 8px 40px rgba(15, 23, 42, 0.12);
    --shadow-accent: 0 4px 20px rgba(14, 165, 233, 0.20);

    /* Rayons */
    --radius:    12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.22s ease;

    /* Typo */
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', Arial, sans-serif;
    --font-mono: 'Consolas', 'Fira Code', 'Courier New', monospace;

    /* Layout */
    --max-width: 1160px;
    --nav-height: 68px;
}

/* ── DARK THEME ────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-primary:    #080d17;
    --bg-secondary:  #0b1220;
    --bg-tertiary:   #0f1a2e;
    --bg-card:       #111b2e;
    --bg-hover:      #162038;

    --border-color:  rgba(56, 189, 248, 0.12);
    --border-light:  rgba(255, 255, 255, 0.04);

    --text-primary:   #e8f2ff;
    --text-secondary: #8baabf;
    --text-muted:     #4b6070;

    --accent:         #38bdf8;
    --accent-hover:   #7dd3fc;
    --accent-glow:    rgba(56, 189, 248, 0.12);
    --accent-border:  rgba(56, 189, 248, 0.28);

    --glass-bg:     rgba(8, 13, 23, 0.92);
    --glass-border: rgba(56, 189, 248, 0.08);

    --shadow:        0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-sm:     0 2px 8px  rgba(0, 0, 0, 0.35);
    --shadow-lg:     0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-accent: 0 4px 20px rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(circle at 18% 22%, rgba(56, 189, 248, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 82% 78%, rgba(99, 102, 241, 0.04) 0%, transparent 45%);
}

[data-theme="dark"] .article-card {
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ── THÈME CLAIR : header + footer sombres ─────────────────── */
/* Ciblage explicite light-mode uniquement (dark mode non affecté) */

html:not([data-theme="dark"]) .main-header {
    background: #0f172a;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html:not([data-theme="dark"]) .nav-left a,
html:not([data-theme="dark"]) .nav-right a {
    color: rgba(203, 213, 225, 0.85);
}

html:not([data-theme="dark"]) .nav-left a:hover,
html:not([data-theme="dark"]) .nav-right a:hover,
html:not([data-theme="dark"]) .nav-left a.active,
html:not([data-theme="dark"]) .nav-right a.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.10);
}

html:not([data-theme="dark"]) .theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(203, 213, 225, 0.85);
}

html:not([data-theme="dark"]) .theme-toggle:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.40);
    color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.20);
}

html:not([data-theme="dark"]) .nav-burger span {
    background: rgba(203, 213, 225, 0.85);
}

html:not([data-theme="dark"]) .dropdown-menu {
    background: #1e293b;
    border-color: rgba(56, 189, 248, 0.15);
}

html:not([data-theme="dark"]) .dropdown-menu a {
    color: rgba(203, 213, 225, 0.85);
}

html:not([data-theme="dark"]) .dropdown-menu a:hover {
    background: rgba(56, 189, 248, 0.10);
    color: #38bdf8;
}

html:not([data-theme="dark"]) .site-footer {
    background: #0f172a;
    border-top: 1px solid rgba(56, 189, 248, 0.12);
}

html:not([data-theme="dark"]) .footer-content {
    color: rgba(148, 163, 184, 0.80);
}

html:not([data-theme="dark"]) .footer-copy strong {
    color: rgba(203, 213, 225, 0.90);
}

html:not([data-theme="dark"]) .footer-links a,
html:not([data-theme="dark"]) .footer-section a {
    color: rgba(148, 163, 184, 0.75);
}

html:not([data-theme="dark"]) .footer-links a:hover,
html:not([data-theme="dark"]) .footer-section a:hover {
    color: #38bdf8;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.65;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover { color: var(--accent-hover); }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── FLASH INFO - bande "breaking news" sous la navbar (concept B) ──
   Bande pleine largeur (fond), contenu aligné au max-width comme la navbar.
   Tag "Flash Info" + point qui pulse + ticker qui défile ; clic = liste complète. */
.news-band {
    --band-color: var(--accent);
    --band-tint: rgba(14,165,233,0.10);
    border-top: 1px solid var(--border-light);
    background: linear-gradient(90deg, var(--band-tint), transparent 65%);
}
.news-band--info     { --band-color: var(--accent); --band-tint: rgba(14,165,233,0.10); }
.news-band--warning  { --band-color: #f59e0b;       --band-tint: rgba(245,158,11,0.12); }
.news-band--critical { --band-color: #ef4444;       --band-tint: rgba(239,68,68,0.13); }

/* Barre cliquable (contenu aligné au max-width) */
.news-band-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    height: 38px;
    padding: 0 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Reflet qui balaie la barre */
.news-band-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,0.06) 50%, transparent 58%);
    transform: translateX(-130%);
    animation: news-scan 6s ease-in-out infinite;
}
@keyframes news-scan { 0%,55% { transform: translateX(-130%); } 80%,100% { transform: translateX(130%); } }

/* Tag "Flash Info" + point qui pulse */
.news-band-live {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--band-color);
}
.news-band-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--band-color);
    box-shadow: 0 0 8px 1px var(--band-color);
    animation: news-live-pulse 1.4s ease-in-out infinite;
}
@keyframes news-live-pulse { 0%,100% { opacity: 0.4; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* Ticker : deux copies identiques pour une boucle sans couture */
.news-band-viewport {
    overflow: hidden;
    flex: 1;
    min-width: 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.news-band-track {
    display: inline-flex;
    white-space: nowrap;
}
/* Le defilement (et la duplication) ne s'active QUE si le contenu deborde */
.news-band.scroll .news-band-track {
    will-change: transform;
    animation: news-ticker 28s linear infinite;
}
.news-band.scroll .news-band-bar:hover .news-band-track { animation-play-state: paused; }
.tk-copy { display: inline-flex; gap: 44px; padding-right: 44px; }
.news-band-track .tk { display: inline-flex; align-items: center; gap: 9px; font-size: 0.85rem; color: var(--text-secondary); }
.news-band-track .tk-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
@keyframes news-ticker { to { transform: translateX(-50%); } }

.news-band-chevron {
    flex: none;
    display: inline-flex;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
.news-band.open .news-band-chevron { transform: rotate(180deg); color: var(--band-color); }

/* Panneau déroulant : liste complète, contenue et alignée à gauche */
.news-band-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.25, 0.8, 0.4, 1);
    background: var(--bg-card);
}
.news-band.open .news-band-panel {
    max-height: 60vh;
    border-top: 1px solid var(--border-light);
}
.news-band-list {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 8px 24px;
    list-style: none;
    max-height: 60vh;
    overflow-y: auto;
}
.news-band-list li { border-bottom: 1px solid var(--border-light); }
.news-band-list li:last-child { border-bottom: none; }

.news-band-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 8px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 8px;
    transition: background 0.15s ease, padding 0.15s ease;
}
.news-band-item:hover { background: var(--bg-hover); padding-left: 14px; }
.news-band-item .lvl { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.news-band-item .ttl { flex: 1; font-size: 0.92rem; font-weight: 600; }
.news-band-item .arr { color: var(--text-muted); flex: none; font-size: 1.1rem; line-height: 1; transition: transform 0.18s ease; }
.news-band-item:hover .arr { transform: translateX(3px); color: var(--band-color); }

.news-lvl--info     { background: var(--accent); }
.news-lvl--warning  { background: #f59e0b; }
.news-lvl--critical { background: #ef4444; }

@media (prefers-reduced-motion: reduce) {
    .news-band-track,
    .news-band-live-dot,
    .news-band-bar::after { animation: none; }
    .news-band-panel { transition: none; }
}


/* ── NAVBAR ─────────────────────────────────────────────────── */
.main-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

/* Ligne séparatrice luminescente */
.main-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--accent-border) 15%,
        var(--accent) 50%,
        var(--accent-border) 85%,
        transparent 100%
    );
    box-shadow: 0 0 12px 2px var(--accent-glow);
}

.navbar {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 24px;
    height: var(--nav-height);
    gap: 16px;
}

/* Boutons fixes hors max-width - extrême droite du header */
.nav-fixed-right {
    position: absolute;
    top: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    z-index: 1001;
}

/* Liens gauche */
.nav-left {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    justify-content: flex-start;
}

/* Logo centré - test D : pipes + logo agrandi + glow */
.nav-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    padding: 0 18px;
}

/* Séparateurs verticaux gauche/droite */
.nav-logo::before,
.nav-logo::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, transparent, var(--accent-border), transparent);
}

.nav-logo::before { left: 0; }
.nav-logo::after  { right: 0; }

.nav-logo img {
    height: 70px;
    width: 70px;
    object-fit: contain;
    transition: var(--transition);
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.nav-logo img:hover {
    transform: scale(1.06);
    filter: drop-shadow(0 0 10px var(--accent));
}

/* Liens droite */
.nav-right {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    justify-content: flex-end;
}


.nav-left a,
.nav-right a {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-left a:hover,
.nav-right a:hover,
.nav-left a.active,
.nav-right a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

/* Bouton Login - icône cadenas */
.nav-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-full);
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-login:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

/* Dropdown */
.dropdown { position: relative; }

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 0.75em;
    opacity: 0.6;
    transition: transform 0.2s;
}

.dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 2000;
}

/* Pont transparent qui comble le gap entre le lien et le menu */
.dropdown::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 6px;
    display: none;
}

.dropdown:hover::after,
.dropdown.open::after {
    display: block;
}

.nav-right .dropdown-menu { left: auto; right: 0; }

.dropdown-menu.show { display: block; }

/* Hover desktop natif */
@media (hover: hover) and (pointer: fine) {
    .dropdown:hover .dropdown-menu { display: block; }
    .dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.dropdown-menu li { list-style: none; }

.dropdown-menu li a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88em;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

/* ── BOUTON THEME ───────────────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    outline: none;
}

.theme-toggle:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Icônes soleil/lune */
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ── BURGER MOBILE ──────────────────────────────────────────── */
.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    border: none;
    background: none;
}

.nav-burger span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ── LAYOUT PRINCIPAL ───────────────────────────────────────── */
main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px;
}

/* ── HERO ───────────────────────────────────────────────────── */
.hero-section {
    text-align: center;
    padding: 64px 0 32px;
}

.hero-section h1 {
    font-size: 2.6em;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-section h1 span {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section p {
    font-size: 1.1em;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* ── BARRE DE RECHERCHE ─────────────────────────────────────── */
.search-section {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.98em;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ── GRILLE ARTICLES (HOME) ─────────────────────────────────── */
.home-layout {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.section-title {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Liste d'articles - colonne centrale */
.articles-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Carte article */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

.article-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow), 0 0 0 1px var(--accent-border);
    transform: translateY(-1px);
}

.article-card-body {
    flex: 1;
    min-width: 0;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.menu-badge {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85em;
}

.article-card-title {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-card:hover .article-card-title {
    color: var(--accent);
}

.article-card-excerpt {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Icône shield (droite de la carte) */
.card-shield {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.2em;
    transition: var(--transition);
}

.article-card:hover .card-shield {
    background: var(--accent);
    color: #fff;
}

/* Vignette couverture dans les cards */
.article-card-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    align-self: center;
}

/* ── Marquage IA des images de couverture (transparence AI Act art. 50) ── */
.article-card-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    align-self: center;
    line-height: 0;
}

.ai-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #fff;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: var(--radius-full);
    pointer-events: none;
}

.ai-badge svg { width: 9px; height: 9px; opacity: 0.9; }

/* Variante grande couverture (page Flash Info) */
.ai-badge--cover {
    right: 10px;
    bottom: 10px;
    padding: 4px 10px;
    font-size: 0.72rem;
    gap: 5px;
}
.ai-badge--cover svg { width: 12px; height: 12px; }

/* Legende sous une grande couverture generee par IA */
.ai-cover-caption {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -14px 0 24px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.ai-cover-caption svg { flex-shrink: 0; opacity: 0.8; }

/* ── VUE CATÉGORIE ───────────────────────────────────────────── */
.category-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.category-title {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.category-subtitle {
    font-size: 0.88em;
    color: var(--text-muted);
    margin: 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .articles-grid { grid-template-columns: 1fr; }
    .articles-list { grid-template-columns: 1fr; }
}

/* ── VUE ARTICLE UNIQUE ─────────────────────────────────────── */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

/* Colonne principale (70%) */
.article-main {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.article-header {
    padding: 32px 36px 24px;
    border-bottom: 1px solid var(--border-color);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.article-title {
    font-size: 1.9em;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Contenu Markdown rendu */
.article-content {
    padding: 32px 36px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content h1,
.article-content h2,
.article-content h3 {
    color: var(--text-primary);
    margin: 1.5em 0 0.6em;
    line-height: 1.3;
}

.article-content h2 { font-size: 1.4em; }
.article-content h3 { font-size: 1.15em; }

.article-content p   { margin-bottom: 1em; }
.article-content ul,
.article-content ol  { padding-left: 1.6em; margin-bottom: 1em; }
.article-content li  { margin-bottom: 0.4em; }

.article-content blockquote {
    border-left: 3px solid var(--accent);
    background: var(--accent-glow);
    padding: 12px 20px;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    margin: 1.2em 0;
}

/* Note ℹ️ - retrait suspendu : l'emoji dépasse à gauche, le texte (toutes lignes)
   s'aligne après lui. Générée par Markdown::tagNotes (paragraphe ouvert par « ℹ️ »). */
.article-content p.note {
    position: relative;
    padding-left: 1.8em;
}
.article-content p.note::before {
    content: "ℹ️";
    position: absolute;
    left: 0;
    top: 0;
}

.article-content code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--accent);
}

/* Bloc de code : fond sombre constant (le thème highlight.js atom-one-dark est
   conçu pour du sombre → lisible en thème clair comme sombre). */
.article-content pre {
    background: #282c34;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin: 1.2em 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #abb2bf;   /* couleur de base atom-one-dark (les tokens colorés viennent par-dessus) */
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-border);
}

.article-content img {
    border-radius: var(--radius);
    margin: 1.2em 0;
    box-shadow: var(--shadow-sm);
}

/* Sidebar sources (30%) */
.article-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 20px);
}

.sidebar-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-block-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.9em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
}

.sidebar-block-header svg,
.sidebar-block-header .icon {
    color: var(--accent);
}

.sources-list {
    list-style: none;
    padding: 12px;
}

.sources-list li {
    padding: 2px 0;
}

.sources-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88em;
    color: var(--text-secondary);
    transition: var(--transition);
    word-break: break-word;
}

.sources-list a:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

.sources-list .source-index {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78em;
    font-weight: 700;
    color: var(--text-muted);
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-size: 0.88em;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.footer-copy strong { color: var(--text-secondary); font-weight: 600; }

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a,
.footer-section a {
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-links a:hover,
.footer-section a:hover { color: var(--accent); }

.footer-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-section-title {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-right: 4px;
    border-right: 1px solid var(--border-color);
}

/* ── MENTIONS LÉGALES ────────────────────────────────────────── */
.legal-page { padding: 0 0 60px; }

.legal-hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 56px 24px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 50%, var(--accent-glow) 0%, transparent 60%),
        radial-gradient(circle at 70% 50%, rgba(99,102,241,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.legal-hero-inner { position: relative; max-width: 680px; margin: 0 auto; }

.legal-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    margin-bottom: 20px;
    background: var(--accent-glow);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Variantes de niveau pour Flash Info */
.bn-hero-badge--warning  { color: #f59e0b; border-color: rgba(245,158,11,0.30); background: rgba(245,158,11,0.10); }
.bn-hero-badge--critical { color: #ef4444; border-color: rgba(239,68,68,0.30);  background: rgba(239,68,68,0.10); }

/* Page Flash Info : image de couverture + bloc sources sous le texte */
.bn-cover {
    position: relative;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.bn-cover img { display: block; width: 100%; height: auto; }

.bn-sources {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}
.bn-sources h2 { font-size: 1.05rem; margin: 0 0 12px; }
.bn-sources ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bn-sources a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.92rem;
}
.bn-sources a:hover { text-decoration: underline; }

.legal-title {
    font-size: 2.4em;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.2;
}

.legal-title-accent {
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-subtitle {
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.7;
}

.legal-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.legal-card {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: border-color 0.2s;
}

.legal-card:hover { border-color: var(--accent-border); }

.legal-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid var(--accent-border);
    border-radius: 10px;
    color: var(--accent);
    margin-top: 2px;
}

.legal-card-body h2 {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.legal-card-body p {
    color: var(--text-secondary);
    font-size: 0.92em;
    line-height: 1.75;
    margin-bottom: 10px;
}

.legal-card-body p:last-child { margin-bottom: 0; }

.legal-dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 16px;
    font-size: 0.92em;
}

.legal-dl dt {
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 2px;
}

.legal-dl dd { color: var(--text-secondary); }

.legal-placeholder {
    color: var(--warning);
    font-style: normal;
    font-size: 0.9em;
}

.legal-update {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82em;
    margin-top: 12px;
}

/* ── UTILITAIRES ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent-border);
}

.btn-outline:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.84em;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78em;
    font-weight: 600;
}

.badge-accent {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger  { background: rgba(239, 68,  68, 0.1);  color: var(--danger); }

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 48px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.2em;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mt-16 { margin-top: 16px; }

/* ── PAGE LOGIN ADMIN ───────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo img   { width: 52px; height: 52px; }
.login-logo h1    { font-size: 1.4em; font-weight: 800; }
.login-logo span  { font-size: 0.85em; color: var(--text-muted); }

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95em;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9em;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .navbar {
        grid-template-columns: auto 1fr auto auto;
        padding: 0 16px;
    }

    .nav-left,
    .nav-right {
        display: none;
    }

    .nav-left.open,
    .nav-right.open {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 12px 16px;
        z-index: 999;
        box-shadow: var(--shadow);
    }

    .nav-burger { display: flex; }

    .nav-logo {
        grid-column: 1;
        justify-content: flex-start;
    }

    main { padding: 24px 16px; }

    .article-header,
    .article-content { padding: 24px 20px; }

    .article-title { font-size: 1.5em; }

    .hero-section { padding: 40px 0 20px; }
    .hero-section h1 { font-size: 2em; }

    .footer-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .login-card { padding: 28px 20px; }
    .article-card { padding: 16px; }
}

/* ── UTILITAIRES AUTH / LOGIN ───────────────────────────────── */
.btn-full { width: 100%; justify-content: center; margin-top: 8px; }

.login-footer         { text-align: center; margin-top: 16px; font-size: 0.82em; color: var(--text-muted); }
.login-footer--spaced { margin-top: 20px; }
.login-footer--tight  { margin-top: 8px; }
.login-footer a       { color: var(--text-muted); }

.login-info { text-align: center; margin-top: 20px; font-size: 0.82em; }

.login-card--wide { max-width: 480px; }

/* ── 2FA / TOTP ──────────────────────────────────────────────── */
.totp-icon {
    width: 52px;
    height: 52px;
    background: var(--accent-glow);
    border: 1.5px solid var(--accent-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.totp-display    { text-align: center; margin: 20px 0; }
.totp-qr-img    { display: block; margin: 0 auto; border-radius: 12px; border: 2px solid var(--border-color); background: #fff; padding: 10px; box-sizing: border-box; }
.totp-hint      { margin-top: 12px; font-size: 0.82em; color: var(--text-muted); }
.totp-code      { background: var(--bg-tertiary); padding: 8px 16px; border-radius: 8px; display: inline-block; margin-top: 6px; letter-spacing: 3px; font-size: 1em; color: var(--accent); }
.totp-divider   { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; }
.totp-input     { text-align: center; font-size: 1.4em; letter-spacing: 6px; }
.totp-input--lg { font-size: 1.5em; font-weight: 700; }

/* ── ARTICLE SHOW ────────────────────────────────────────────── */
.article-footer-bar  { padding: 20px 36px; border-top: 1px solid var(--border-color); }
.article-footer-meta { padding: 16px 20px; font-size: 0.88em; color: var(--text-muted); display: flex; flex-direction: column; gap: 8px; }
.sidebar-block-gap   { margin-top: 16px; }

/* ── PAGE MAINTENANCE ────────────────────────────────────────── */
.maintenance-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-hero {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px;
    text-align: center;
}

.maintenance-hero-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    box-shadow: var(--shadow);
}

.maintenance-logo {
    height: 56px;
    width: auto;
    margin: 0 auto 28px;
    display: block;
}

.maintenance-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-full);
    padding: 4px 16px;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

[data-theme="dark"] .maintenance-badge {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

.maintenance-title {
    font-size: 2.8em;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.maintenance-title-accent { color: var(--accent); }

.maintenance-message {
    font-size: 1em;
    color: var(--text-secondary);
    line-height: 1.75;
    margin: 0 0 28px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.maintenance-site {
    font-size: 0.85em;
    color: var(--text-muted);
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .maintenance-hero-inner { padding: 36px 24px; }
    .maintenance-title { font-size: 2em; }
}

/* ── PAGE À PROPOS ───────────────────────────────────────────── */
.about-section {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 0 64px;
}

.about-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-sm);
}

.about-photo-col {
    flex-shrink: 0;
}

.about-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-border);
    box-shadow: 0 0 0 6px var(--accent-glow);
    display: block;
}

.about-text-col {
    flex: 1;
    min-width: 0;
}

.about-name {
    font-size: 1.75em;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.2;
}

.about-role {
    font-size: 0.95em;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 24px;
    letter-spacing: 0.02em;
}

.about-bio p {
    font-size: 1em;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.about-bio p:last-child { margin-bottom: 0; }

.about-empty {
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 680px) {
    .about-layout {
        flex-direction: column;
        align-items: center;
        padding: 32px 24px;
        gap: 28px;
        text-align: center;
    }
    .about-section { padding: 28px 0 48px; }
}

/* ── Partage d'article ───────────────────────────────────────── */
.article-card-outer {
    position: relative;
}

.card-share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    z-index: 1;
}

.article-card-outer:hover .card-share-btn,
.article-card-outer:focus-within .card-share-btn {
    opacity: 1;
}

.card-share-btn:hover {
    color: var(--accent);
    background: var(--bg);
    border-color: var(--accent-border);
}

.card-share-btn.share-copied {
    color: var(--success, #22c55e);
    border-color: var(--success, #22c55e);
}

/* Bouton partage sur la page article */
.article-footer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Bannière aperçu brouillon ───────────────────────────────── */
.preview-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 0.88em;
    color: var(--text);
}

.preview-banner a {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent);
}
