/* ===========================
   Variables & Reset
   Charte : famille Psycajour (doré #F7B330) + bleu nuit institutionnel.
   Tout passe par les variables :root — ne pas coder de valeur en dur.
   =========================== */

:root {
    /* Couleurs de marque — charte Psycajour / Klustomer (officielle) */
    --primary-color: #6A1BC3;   /* violet — titres, nav, footer */
    --primary-deep: #4c159c;
    --secondary-color: #7FA3FF; /* bleu mauve — liens, accents secondaires */
    --accent-color: #F7B330;    /* jaune — signature */
    --accent-light: #ffc857;
    --ink: #2a2340;

    /* Textes */
    --text-color: #2f2a3d;
    --text-body: #55506a;
    --text-light: #666;
    --text-soft: #888;
    --text-muted: #9a94a8;

    /* Fonds & bordures */
    --white: #ffffff;
    --light-bg: #f5f4f8;
    --tint: #faf8fd;            /* voile violet très clair */
    --border-color: #ece7f4;
    --border-soft: #f0ecf7;
    --chip-border: #e0d5f0;

    /* Dégradés */
    --gradient-brand: linear-gradient(135deg, #6A1BC3 0%, #7FA3FF 100%);
    --gradient-veil: linear-gradient(135deg, rgba(106, 27, 195, .08), rgba(127, 163, 255, .14));
    --gradient-gold: linear-gradient(135deg, #f7b330, #ffc857);

    /* Typographie */
    --font-primary: 'Roboto', system-ui, sans-serif;
    --font-secondary: 'Montserrat', sans-serif;

    /* Espacements */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Rayons */
    --radius-pill: 50px;
    --radius-card: 15px;
    --radius-item: 10px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;

    /* Ombres */
    --shadow-nav: 0 2px 8px rgba(0, 0, 0, .06);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, .06);
    --shadow-card: 0 4px 14px rgba(42, 35, 64, .08);
    --shadow-card-hover: 0 14px 34px rgba(106, 27, 195, .18);
    --shadow-cta: 0 6px 16px rgba(247, 179, 48, .35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

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

/* Les règles auteur (display:flex/grid) écrasent le display:none de l'attribut
   hidden : le JS s'appuie dessus pour filtrer les entrées. */
[hidden] { display: none !important; }

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

:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 3px; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--primary-color); color: var(--white);
    padding: var(--spacing-xs) var(--spacing-sm); border-radius: 0 0 var(--radius-item) 0;
}
.skip-link:focus { left: 0; color: var(--white); }

section[id], header[id] { scroll-margin-top: 5.5rem; }

/* ===========================
   Typographie
   =========================== */

h1, h2, h3, h4 { font-family: var(--font-secondary); font-weight: 700; line-height: 1.2; }

.section-title {
    font-size: clamp(1.625rem, 3.5vw, 2.125rem);
    color: var(--primary-color);
    margin-bottom: 0.625rem;
}

.section-intro {
    font-size: 1.0625rem;
    font-weight: 300;
    color: var(--text-light);
    max-width: 64ch;
    margin-bottom: var(--spacing-md);
}

/* ===========================
   Utilitaires
   =========================== */

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--spacing-md); }
.container-narrow { max-width: 940px; }
.container-cta { max-width: 760px; text-align: center; }

.section { padding: var(--spacing-xl) 0; }
.section-muted { background-color: var(--light-bg); }
.section-head-centered { text-align: center; margin-bottom: var(--spacing-lg); }
.section-head-centered .section-intro { margin-left: auto; margin-right: auto; }

.eyebrow {
    display: inline-block;
    font-family: var(--font-secondary);
    font-size: 0.75rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
    color: var(--secondary-color); margin-bottom: 0.5rem;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: var(--font-secondary); font-weight: 600; font-size: 0.9375rem;
    padding: 0.9375rem 1.75rem; border-radius: var(--radius-pill); border: none;
    cursor: pointer; text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                background-color var(--transition-fast), color var(--transition-fast);
}
.btn-accent { background-color: var(--accent-color); color: var(--ink); box-shadow: var(--shadow-cta); }
.btn-accent:hover { color: var(--ink); transform: translateY(-2px); }
.btn-translucent {
    background-color: rgba(255, 255, 255, .12); color: var(--white);
    border: 1px solid rgba(255, 255, 255, .4);
}
.btn-translucent:hover { background-color: rgba(255, 255, 255, .22); color: var(--white); }
.btn-outline { background-color: var(--white); color: var(--primary-color); border: 2px solid var(--primary-color); }
.btn-outline:hover { background-color: var(--primary-color); color: var(--white); }

/* ===========================
   Navigation
   =========================== */

.navbar { position: sticky; top: 0; z-index: 100; background-color: var(--white); box-shadow: var(--shadow-nav); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.8125rem 0; }
.nav-brand { display: flex; align-items: center; gap: 0.625rem; }
.nav-mark {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent-color); box-shadow: 0 0 0 4px rgba(247, 179, 48, .18);
    flex-shrink: 0;
}
.nav-name { font-family: var(--font-secondary); font-weight: 700; font-size: 1.0625rem; color: var(--primary-color); }
.nav-name b { color: var(--accent-color); font-weight: 700; }

.nav-toggle {
    display: none; flex-direction: column; gap: 3px; background: transparent; border: none;
    cursor: pointer; padding: var(--spacing-xs);
}
.nav-toggle span { display: block; width: 25px; height: 3px; border-radius: 2px; background-color: var(--primary-color); transition: var(--transition-fast); }

.nav-menu { display: flex; align-items: center; gap: var(--spacing-xs); list-style: none; }
.nav-menu a {
    display: inline-block; font-family: var(--font-secondary); font-size: 0.875rem; font-weight: 500;
    color: var(--primary-color); padding: var(--spacing-xs) 0.75rem; border-radius: var(--radius-pill);
}
.nav-menu a:hover, .nav-menu a.active { color: var(--secondary-color); }
.nav-menu .nav-cta { background-color: var(--accent-color); color: var(--ink); font-weight: 600; padding: 0.625rem 1.25rem; }
.nav-menu .nav-cta:hover { background-color: var(--accent-light); color: var(--ink); }

/* ===========================
   Hero
   =========================== */

.hero { background: var(--gradient-brand); color: var(--white); padding: 4.75rem var(--spacing-md) 5.25rem; position: relative; overflow: hidden; }
.hero::after {
    content: ''; position: absolute; right: -12%; top: -30%; width: 46%; height: 160%;
    background: radial-gradient(circle, rgba(247, 179, 48, .16), transparent 62%); pointer-events: none;
}
.hero-inner { max-width: 880px; margin: 0 auto; position: relative; }
.hero-eyebrow {
    font-family: var(--font-secondary); font-size: 0.75rem; font-weight: 600; letter-spacing: 2.5px;
    text-transform: uppercase; color: var(--accent-color); margin-bottom: 1.125rem;
}
.hero-title { font-size: clamp(2.125rem, 5.2vw, 3.375rem); line-height: 1.1; margin-bottom: 0.75rem; }
.hero-title .gold { color: var(--accent-color); }
.hero-subtitle {
    font-size: clamp(1.0625rem, 2vw, 1.25rem); font-weight: 300; color: rgba(255, 255, 255, .9);
    max-width: 60ch; margin: 0 0 var(--spacing-md);
}
.hero-actions { display: flex; gap: 0.875rem; flex-wrap: wrap; }
.hero-meta { margin-top: 1.75rem; font-size: 0.875rem; color: rgba(255, 255, 255, .65); }

/* ===========================
   Manifeste (piliers)
   =========================== */

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1.25rem; }
.pillar {
    background: var(--white); border: 1px solid var(--border-color); border-radius: var(--radius-card);
    border-top: 4px solid var(--accent-color); padding: 1.75rem 1.625rem; box-shadow: var(--shadow-sm);
}
.pillar h3 { font-size: 1.0625rem; color: var(--primary-color); margin-bottom: 0.5rem; }
.pillar p { font-size: 0.9375rem; line-height: 1.7; font-weight: 300; color: var(--text-body); }

/* ===========================
   Veille — filtres
   =========================== */

.veille-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--spacing-xs); margin-bottom: 1.25rem; }
.veille-count { font-size: 0.875rem; color: var(--text-soft); }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.filters-label { font-size: 0.8125rem; color: var(--text-soft); font-family: var(--font-secondary); font-weight: 600; align-self: center; margin-right: 0.25rem; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-secondary); font-size: 0.84rem; font-weight: 500; color: var(--primary-color);
    background-color: var(--white); border: 2px solid var(--chip-border); border-radius: var(--radius-pill);
    padding: 0.5rem 1rem; cursor: pointer; transition: all var(--transition-fast);
}
.filter-chip:hover { border-color: var(--secondary-color); }
.filter-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #999); }
.filter-chip .n { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.filter-chip[aria-pressed="true"] { font-weight: 600; color: var(--white); background-color: var(--primary-color); border-color: var(--primary-color); }
.filter-chip[aria-pressed="true"] .n { color: rgba(255, 255, 255, .7); }

/* ===========================
   Couleurs par thème (taxonomie de veille)
   Ajouter un thème : lui donner une clé ici + un chip dans le HTML.
   =========================== */

.filter-chip[data-theme="coupure"],        .entry[data-theme="coupure"]        { --c: #c02a2a; --tc: #c02a2a; }
.filter-chip[data-theme="donnees"],        .entry[data-theme="donnees"]        { --c: #a13c8f; --tc: #a13c8f; }
.filter-chip[data-theme="juridique"],      .entry[data-theme="juridique"]      { --c: #2f4b86; --tc: #2f4b86; }
.filter-chip[data-theme="reglementation"], .entry[data-theme="reglementation"] { --c: #0f7b7b; --tc: #0f7b7b; }
.filter-chip[data-theme="difficulte"],     .entry[data-theme="difficulte"]     { --c: #b26a00; --tc: #b26a00; }
.filter-chip[data-theme="alternative"],    .entry[data-theme="alternative"]    { --c: #1f8f4e; --tc: #1f8f4e; }
.filter-chip[data-theme="miseengarde"],    .entry[data-theme="miseengarde"]    { --c: #5b52c4; --tc: #5b52c4; }
.filter-chip[data-theme="geopolitique"],   .entry[data-theme="geopolitique"]   { --c: #4a5568; --tc: #4a5568; }

/* ===========================
   Veille — cartes
   =========================== */

.feed { display: grid; gap: 1.25rem; }
.entry {
    background: var(--white); border: 1px solid var(--border-color); border-radius: var(--radius-card);
    padding: 1.75rem 1.875rem; box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-medium), transform var(--transition-medium);
}
.entry:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; margin-bottom: 0.75rem; font-size: 0.8125rem; color: var(--text-muted); }
.entry-tag {
    display: inline-flex; align-items: center; gap: 0.4375rem;
    font-family: var(--font-secondary); font-weight: 600; font-size: 0.72rem; letter-spacing: .02em;
    padding: 0.25rem 0.6875rem; border-radius: var(--radius-pill);
    color: var(--tc, #333); background: color-mix(in srgb, var(--tc, #333) 12%, #fff);
}
.entry-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tc, #333); }
.entry-meta .sep { color: var(--chip-border); }
.entry-meta .src { font-weight: 600; color: var(--text-light); font-family: var(--font-secondary); }

.entry-title { font-size: 1.25rem; line-height: 1.3; margin-bottom: 0.625rem; }
.entry-title a { color: var(--primary-color); }
.entry-title a:hover { color: var(--secondary-color); }
.entry-title a .ext { font-size: 0.7em; color: var(--text-muted); vertical-align: super; margin-left: 4px; }

.entry-analyse { font-size: 0.96875rem; line-height: 1.7; font-weight: 300; color: var(--text-body); margin-bottom: 1.125rem; }

.entry-decideur {
    display: flex; gap: 0.875rem; align-items: flex-start;
    background: var(--tint); border-left: 4px solid var(--accent-color);
    border-radius: 0 var(--radius-item) var(--radius-item) 0; padding: 0.875rem 1.125rem;
}
.entry-decideur .k {
    font-family: var(--font-secondary); font-size: 0.68rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: #b6801a; white-space: nowrap; padding-top: 2px;
}
.entry-decideur .v { font-size: 0.9375rem; line-height: 1.6; color: var(--text-color); }

.feed-empty { text-align: center; color: var(--text-soft); font-weight: 300; padding: var(--spacing-lg) 0; }

/* ===========================
   CTA
   =========================== */

.cta { background: var(--gradient-brand); color: var(--white); }
.cta-title { font-size: clamp(1.625rem, 3.5vw, 2.125rem); margin-bottom: 0.625rem; }
.cta-text { font-size: 1.125rem; font-weight: 300; color: rgba(255, 255, 255, .9); margin-bottom: 1.875rem; }
.cta-actions { display: flex; gap: 0.875rem; justify-content: center; flex-wrap: wrap; }

/* ===========================
   Footer
   =========================== */

.footer { background-color: var(--primary-deep); color: var(--white); padding: 3.25rem 0 1.75rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; }
.footer-brand { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.875rem; }
.footer-brand .nav-name { color: var(--white); }
.footer-tagline { color: rgba(255, 255, 255, .78); font-weight: 300; max-width: 46ch; line-height: 1.7; }
.footer-col h2 { font-family: var(--font-secondary); font-weight: 600; font-size: 1rem; color: var(--white); margin-bottom: 0.75rem; }
.footer-col a { display: block; color: rgba(255, 255, 255, .8); font-size: 0.9375rem; margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--accent-color); }
.footer-bottom {
    max-width: 1120px; margin: 1.75rem auto 0; padding: 1.25rem var(--spacing-md) 0;
    border-top: 1px solid rgba(255, 255, 255, .16); text-align: center;
    font-size: 0.8125rem; color: rgba(255, 255, 255, .6);
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 860px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
        gap: 0; background-color: var(--white); box-shadow: var(--shadow-nav);
        padding: var(--spacing-xs) var(--spacing-md) var(--spacing-sm); display: none;
    }
    .nav-menu.active { display: flex; }
    .nav-menu a { padding: 0.875rem 0; }
    .nav-menu .nav-cta { text-align: center; margin-top: var(--spacing-xs); padding: 0.875rem; }
    .navbar .container { position: relative; }
    .footer-grid { grid-template-columns: 1fr; gap: var(--spacing-md); }
}

@media (max-width: 640px) {
    .hero { padding: 3.25rem var(--spacing-sm) 3.75rem; }
    .container { padding: 0 var(--spacing-sm); }
    .section { padding: 2.75rem 0; }
    .entry { padding: 1.375rem 1.25rem; }
    .entry-decideur { flex-direction: column; gap: 0.375rem; }
    .hero-actions .btn, .cta-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .entry:hover, .btn-accent:hover { transform: none; }
}
