/* ================================================================
   trajectoires_mobpro_dept.css — Style D "Extension"
   Couche fine par-dessus global.css + dashboard_mobpro.css
   + trajectoires_mobpro_shared.css. Seulement les additions spécifiques
   aux pages départementales (pill DRC, delta-badge, compare-bars,
   cta-epci, dept-chart-grid). Variables --cv-*, toggle FAB, scatter
   sont dans trajectoires_mobpro_shared.css.
   ================================================================ */

/* ── PILL DRC (header département) ──────────────────────────── */
.cv-drc-pill {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 800px;
    margin: 1rem auto 0;
    padding: 0.7rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(121, 167, 155, 0.25);
    border-radius: 10px;
    text-align: left;
}
.cv-drc-pill-badge {
    flex-shrink: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-territory);
    background: rgba(121, 167, 155, 0.18);
    border: 1px solid rgba(121, 167, 155, 0.35);
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
    white-space: nowrap;
}
.cv-drc-pill-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}
@media (max-width: 600px) {
    .cv-drc-pill { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ── POLICE CHIFFRES (kpi-value) ─────────────────────────────── */
/* Space Grotesk pour les valeurs chiffrées sur les pages Trajectoires
   uniquement (scope .cv-page). Dashboards EPCI MOBPRO/SIRENE
   conservent Orbitron. */
.cv-page .kpi-value {
    font-family: 'Space Grotesk', 'IBM Plex Mono', monospace;
    font-feature-settings: 'tnum' 1, 'lnum' 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* ── EMPILEMENT NAV + SOUS-NAV CONTEXT-BAR (pages départementales) ── */
/* La .cv-context-bar est sticky dans le flux avec margin-top:80px
   (trajectoires_mobpro_shared.css) → elle occupe elle-même l'offset de la nav
   fixe. Le dashboard-header ne doit plus ajouter de margin-top
   (dashboard_mobpro.css lui donne 80px par défaut → on l'annule). */
.cv-dept .dashboard-header {
    margin-top: 0;
}

/* ── SCATTER PLOT EXPLORATEUR ────────────────────────────────── */
/* Déplacé vers trajectoires_mobpro_shared.css (mutualisé avec theater/editorial). */

/* ── GRID CHARTS (2 colonnes) ────────────────────────────────── */
.cv-dept-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.cv-dept-chart-grid .card { padding: 1.5rem; }
.cv-dept-chart-grid .card.full { grid-column: 1 / -1; }
.cv-dept-chart-grid .card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem; font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.cv-dept-chart-grid .card h3 .badge {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.6rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem; border-radius: 4px;
    background: var(--accent-data); color: white;
}
.cv-chart-canvas { width: 100%; height: 260px; }
.cv-chart-canvas-tall { width: 100%; height: 320px; }

/* ── COMPARAISON DÉPT vs NATIONAL (déciles + moyenne) ────────── */
.cv-compare-intro {
    font-size: 0.85rem; color: var(--text-muted, rgba(14,62,73,0.55));
    line-height: 1.6; margin-bottom: 1.5rem;
}
.cv-compare-intro strong { color: var(--primary); font-weight: 600; }
.cv-compare-group {
    display: flex; flex-direction: column; gap: 2.25rem;
    margin-top: 0.5rem;
}
.cv-compare-metric { }
.cv-compare-metric-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1rem; margin-bottom: 0.85rem; flex-wrap: wrap;
}
.cv-compare-metric-label {
    font-size: 0.92rem; font-weight: 600; color: var(--primary);
}
.cv-compare-metric-dept-val {
    font-family: 'Space Grotesk', 'IBM Plex Mono', monospace;
    font-size: 1.1rem; font-weight: 700; color: var(--accent-data);
    font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.cv-compare-metric-sub {
    font-size: 0.78rem; color: var(--text-muted, rgba(14,62,73,0.55));
    margin-bottom: 0.7rem; font-style: italic;
}
.cv-decile-track {
    position: relative;
    height: 34px;
    background: linear-gradient(to right,
        rgba(14,62,73,0.05) 0%, rgba(14,62,73,0.05) 100%);
    border-radius: 6px;
    overflow: visible;
    border: 1px solid rgba(14,62,73,0.07);
}
/* Marqueurs déciles P10..P90 : fines barres verticales grises */
.cv-decile-tick {
    position: absolute; top: 0; bottom: 0;
    width: 1px;
    background: rgba(14,62,73,0.18);
    pointer-events: none;
}
.cv-decile-tick-label {
    position: absolute; top: 100%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem; color: var(--text-muted, rgba(14,62,73,0.45));
    margin-top: 3px; white-space: nowrap;
}
/* Marqueur moyenne nationale pondérée : ligne verticale orange */
.cv-decile-mean {
    position: absolute; top: -4px; bottom: -4px;
    width: 2px;
    background: var(--accent-territory);
    z-index: 2;
}
.cv-decile-mean::after {
    content: 'moy. nat.';
    position: absolute; top: -1.1rem; left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.58rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--accent-territory); white-space: nowrap;
}
/* Marqueur dept : pastille + flag valeur */
.cv-decile-dept {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent-data);
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(53,152,192,0.45);
    z-index: 3;
    transition: left 0.9s cubic-bezier(0.4,0,0.2,1);
}
/* Plage P10–P90 ombrée pour matérialiser la dispersion */
.cv-decile-range {
    position: absolute; top: 0; bottom: 0;
    background: rgba(53,152,192,0.08);
    border-left: 1px dashed rgba(53,152,192,0.25);
    border-right: 1px dashed rgba(53,152,192,0.25);
    z-index: 1;
}
.cv-compare-foot {
    display: flex; justify-content: space-between;
    margin-top: 1.6rem; padding-top: 0.85rem;
    border-top: 1px solid rgba(14,62,73,0.06);
    font-size: 0.78rem; color: var(--text-muted, rgba(14,62,73,0.55));
    flex-wrap: wrap; gap: 0.5rem;
}
.cv-compare-foot strong { color: var(--primary); font-weight: 600; }
.cv-compare-rank {
    font-family: 'Space Grotesk', 'IBM Plex Mono', monospace;
    color: var(--accent-data); font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── CTA FINAL (pour aller plus loin) ────────────────────────── */
.cv-cta-epci {
    margin-top: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    color: white;
}
.cv-cta-epci::before {
    content: '';
    position: absolute;
    top: -30%; right: -5%;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(53,152,192,0.22) 0%, transparent 70%);
    pointer-events: none;
}
.cv-cta-epci::after {
    content: '';
    position: absolute;
    bottom: -40%; left: -10%;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(121,167,155,0.16) 0%, transparent 70%);
    pointer-events: none;
}
.cv-cta-epci-inner {
    position: relative; z-index: 2;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem; align-items: center;
}
.cv-cta-epci-text { }
.cv-cta-epci-text .dash-section-label { color: var(--accent-territory); }
.cv-cta-epci-text .dash-section-title {
    color: white; margin-bottom: 1rem; line-height: 1.3;
}
.cv-cta-epci-desc {
    color: rgba(255,255,255,0.78); line-height: 1.7;
    font-size: 0.95rem;
}
.cv-cta-epci-desc strong { color: var(--accent-territory); font-weight: 600; }
.cv-cta-epci-actions {
    display: flex; flex-direction: column; gap: 0.85rem; align-items: flex-start;
}
.cv-cta-epci-btn {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.9rem 1.8rem;
    background: linear-gradient(135deg, var(--accent-data), var(--accent-territory));
    color: white;
    border-radius: 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700; font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 6px 20px var(--accent-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.cv-cta-epci-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--hover-glow);
}
.cv-cta-epci-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.2rem;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.25);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.88rem; font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}
.cv-cta-epci-link:hover {
    color: white; border-color: var(--accent-data);
}
@media (max-width: 768px) {
    .cv-cta-epci-inner { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* ── BADGE ÉVOLUTION (KPI dept) ──────────────────────────────── */
.cv-delta-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.78rem; font-weight: 600;
    padding: 0.2rem 0.6rem; border-radius: 100px;
    margin-top: 0.4rem;
}
.cv-delta-badge.pos {
    color: #c0392b; background: rgba(192,57,43,0.08);
}
.cv-delta-badge.neg {
    color: #27ae60; background: rgba(39,174,96,0.08);
}

/* ── DEPT INDEX GRID (page liste des départements) ──────────── */
.cv-dept-search {
    max-width: 400px; margin-bottom: 2rem;
}
.cv-dept-search input {
    width: 100%; padding: 0.8rem 1.2rem;
    border: 1px solid rgba(14,62,73,0.1);
    border-radius: 8px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 0.95rem;
    outline: none; background: white;
}
.cv-dept-search input:focus { border-color: var(--accent-data); }
.cv-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.cv-dept-card {
    background: white;
    border: 1px solid rgba(14,62,73,0.08);
    border-radius: 10px; padding: 1.25rem;
    transition: all 0.25s; text-decoration: none;
    display: flex; flex-direction: column; color: inherit;
}
.cv-dept-card:hover {
    border-color: var(--accent-data);
    box-shadow: 0 6px 20px rgba(53,152,192,0.1);
    transform: translateY(-2px);
}
.cv-dept-card-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem; color: var(--accent-data);
    text-transform: uppercase; letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}
.cv-dept-card-name {
    font-size: 0.95rem; font-weight: 600;
    color: var(--primary); margin-bottom: 0.5rem;
}
.cv-dept-card-stat {
    font-size: 0.78rem; color: var(--secondary);
    display: flex; justify-content: space-between;
    margin-top: auto; padding-top: 0.5rem;
    border-top: 1px solid rgba(14,62,73,0.06);
}
.cv-dept-card-stat strong { color: var(--primary); }

/* ── METHODO ACCORDION (override trajectoires, 13 items longs) ── */
/* dashboard_mobpro.css fixe .methodo-content.open à max-height: 1200px,
   insuffisant pour les 13 notes des pages départementales Trajectoires
   (body HTML structuré + note-grid multi-colonnes). Override scoped à
   .cv-dept pour ne pas impacter les dashboards EPCI MOBPRO/SIRENE. */
.cv-dept .methodo-content.open { max-height: 6000px; }
.methodo-body { font-size: 0.83rem; line-height: 1.65; color: var(--secondary); }
.methodo-body p { margin: 0 0 0.65rem; }
.methodo-body p:last-child { margin-bottom: 0; }
.methodo-body strong { color: var(--primary); font-weight: 600; }
.methodo-body a { color: var(--accent-data); text-decoration: none; border-bottom: 1px solid rgba(53,152,192,0.3); }
.methodo-body a:hover { color: var(--primary); }
.methodo-body ul,
.methodo-body ol { margin: 0.4rem 0 0.65rem; padding-left: 1.3rem; }
.methodo-body ul li,
.methodo-body ol li { margin-bottom: 0.35rem; }
.methodo-body ul li::marker { color: var(--accent-data); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cv-dept-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .cv-dept-chart-grid { grid-template-columns: 1fr; }
    .cv-decile-tick-label { font-size: 0.55rem; }
}
