/* ── Polices ── auto-hébergées via le gestionnaire de polices QuietCMS
   (fonts/fonts.css est chargé par layout.php). Aucune requête vers Google Fonts :
   conforme CSP 'self' et RGPD (pas de transmission d'IP des visiteurs à Google).
   Repli sur des polices système tant que les polices ne sont pas installées. */

/* ── Variables ── */
:root {
    color-scheme: light;
    --navy:       #0d3b66;   /* bleu acier — header / footer / aplats sombres */
    --navy-mid:   #0a2c4d;
    --navy-light: #123a5a;
    --gold:       #e8731c;   /* accent orange (charte Facem Web) */
    --gold-hover: #cf6410;
    --gold-pale:  #fff3e9;
    --parchment:  #eef2f7;   /* fond de page gris-bleu clair */
    --white:      #ffffff;
    --text:       #13202e;
    --text-muted: #64748b;
    --border:     #e7ecf2;
    --border-gold:#f3c9a8;
    --link:       #0d3b66;
    --link-hover: #0a2c4d;
    --shadow-sm:  0 1px 3px rgba(16,32,48,.06);
    --shadow:     0 6px 20px rgba(16,32,48,.10);
    --shadow-lg:  0 14px 34px rgba(16,32,48,.14);
    --radius:     10px;
    --max-w:      1180px;
    --content-w:  800px;
    --serif:      'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    --sans:       'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); color: var(--text); background: var(--parchment); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-hover); }

/* ── Top bar ── */
.top-bar {
    background: var(--navy);
    color: rgba(255,255,255,.7);
    font-size: .78rem;
    padding: .45rem 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.top-bar-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.top-bar a { color: rgba(255,255,255,.7); }
.top-bar a:hover { color: var(--gold); }
.top-bar-right { display: flex; gap: 1.5rem; }

/* ── Header ── */
.site-header {
    background: var(--header-bg, var(--navy));
    position: var(--header-position, sticky);
    top: 0;
    z-index: 510; /* > overlay (490) pour que le tiroir reste au-dessus */
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height, 72px);
    gap: 2rem;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
}
.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gold);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    color: var(--navy);
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.logo-text {
    font-family: var(--serif);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 600;
}
.logo-text span { display: block; font-size: .7rem; font-family: var(--sans); font-weight: 300; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }

/* ── Navigation ── */
.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav > li { list-style: none; position: relative; }
.site-nav > li > a {
    display: block;
    color: rgba(255,255,255,.88);
    font-size: .875rem;
    font-weight: 500;
    padding: .55rem .9rem;
    border-radius: var(--radius);
    transition: background .18s, color .18s;
    letter-spacing: .02em;
}
.site-nav > li > a:hover,
.site-nav > li.active > a {
    background: rgba(255,255,255,.1);
    color: var(--gold);
}
.site-nav > li.active > a { border-bottom: 2px solid var(--gold); }

/* Dropdown */
.sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    min-width: 200px;
    box-shadow: var(--shadow);
    list-style: none;
    z-index: 100;
}
.sub-menu li a {
    display: block;
    padding: .6rem 1.1rem;
    color: var(--text);
    font-size: .875rem;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.sub-menu li:last-child a { border-bottom: none; }
.sub-menu li a:hover { background: var(--gold-pale); color: var(--navy); }
.site-nav > li:hover > .sub-menu { display: block; }

/* Flèche ▾ sur les parents desktop */
.site-nav > li.has-children > a::after {
    content: '▾';
    font-size: .6rem;
    margin-left: .3rem;
    vertical-align: middle;
    opacity: .5;
    display: inline-block;
    transition: transform .2s;
}
.site-nav > li.has-children:hover > a::after { transform: rotate(-180deg); opacity: 1; }

/* Sub-toggle button — caché sur desktop */
.sub-toggle { display: none; }

.sub-menu li { position: relative; }

/* Flèche › sur les items parents dans les sous-menus */
.sub-menu li.has-children > a::after {
    content: '›';
    float: right;
    margin-left: .5rem;
    opacity: .5;
    font-size: 1rem;
    line-height: 1;
}

/* Flyout niveau 3+ : apparaît à droite du parent */
.sub-menu .sub-menu {
    display: none;
    position: absolute;
    top: -3px;
    left: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    min-width: 200px;
    box-shadow: var(--shadow);
    list-style: none;
    z-index: 100;
}
.sub-menu li:hover > .sub-menu { display: block; }

/* Flyout ouvert par JS (desktop hover fiable + débordement viewport) */
.sub-menu .sub-menu.js-open { display: block; }
.sub-menu li.flyout-left > .sub-menu { left: auto; right: 100%; }

/* Logo QuietCMS SVG (fallback quand aucun logo personnalisé) */
.logo-qcms-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 7px;
    display: block;
}

/* Hamburger */
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: .5rem; background: none; border: none; }
/* background-image (dégradé blanc uni) : empêche le « mode sombre forcé » des navigateurs
   mobiles d'assombrir les barres ; visuellement identique à un fond blanc. */
.nav-toggle span { display: block; width: 22px; height: 2px; background-color: #fff; background-image: linear-gradient(#fff, #fff); border-radius: 2px; transition: .3s; forced-color-adjust: none; }

/* ── Gold separator ── */
.gold-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--navy) 0%, var(--gold) 40%, var(--gold-pale) 100%);
}

/* ── Breadcrumb ── */
.breadcrumb-wrap {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: .65rem 0;
    font-size: .8rem;
}
.breadcrumb {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--border-gold); font-size: .7rem; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ── Hero ── */
.page-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1a3560 100%);
    color: #fff;
    padding: 4.5rem 1.5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero-inner { position: relative; max-width: 800px; margin: 0 auto; }
.page-hero h1 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.page-hero p {
    font-size: 1.05rem;
    color: rgba(255,255,255,.8);
    max-width: 560px;
    margin: 0 auto 1.5rem;
}
.hero-divider {
    width: 60px;
    height: 3px;
    background: var(--gold);
    margin: 1.25rem auto 0;
}

/* ── Layout principal ── */
.site-main { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.5rem; }
.site-main.with-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start; }

/* ── Cards ── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-padded { padding: 1.75rem; }

/* ── Page content ── */
.content-header { margin-bottom: 2rem; }
.content-header h1, .article-title {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--navy);
    margin-bottom: .6rem;
}
.content-header .lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    border-left: 3px solid var(--gold);
    padding-left: .9rem;
    margin-top: .9rem;
    font-style: italic;
}

.article-body h2 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin: 2.5rem 0 .9rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--gold-pale);
    position: relative;
}
.article-body h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--gold);
}
.article-body h3 {
    font-family: var(--serif);
    font-size: 1.15rem;
    color: var(--navy-mid);
    margin: 1.75rem 0 .6rem;
    font-weight: 600;
}
.article-body h4 { font-weight: 600; margin: 1.25rem 0 .4rem; }
.article-body p { margin-bottom: 1.1rem; line-height: 1.8; }
.article-body ul, .article-body ol { margin: .75rem 0 1.1rem 1.75rem; }
.article-body li { margin-bottom: .4rem; line-height: 1.7; }
.article-body strong { font-weight: 600; color: var(--navy); }
.article-body em { font-style: italic; }
/* Liens en plein texte (contenu éditorial du site) : bleu raffiné, souligné délicat */
.article-body a,
.blog-content a,
.cat-editorial a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: rgba(47, 84, 168, .4);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color .18s ease, text-decoration-color .18s ease, text-decoration-thickness .18s ease;
}
.article-body a:hover,
.blog-content a:hover,
.cat-editorial a:hover {
    color: var(--link-hover);
    text-decoration-color: var(--link-hover);
    text-decoration-thickness: 2px;
}
/* L'ancre enrobe souvent un <strong> : forcer l'héritage de la couleur du lien */
.article-body a strong,
.blog-content a strong,
.cat-editorial a strong { color: inherit; }
.article-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem 1rem 1.5rem;
    border-left: 4px solid var(--gold);
    background: var(--gold-pale);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--navy-mid);
}
.article-body figure { margin: 1.75rem 0; }
.article-body figure img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.article-body figcaption { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: .5rem; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .9rem; }
.article-body th { background: var(--navy); color: #fff; padding: .7rem 1rem; text-align: left; font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.article-body td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); }
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:nth-child(even) td { background: var(--parchment); }

/* ── Article meta ── */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
    align-items: center;
    padding: .9rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.75rem;
    font-size: .82rem;
    color: var(--text-muted);
}
.article-meta .meta-item { display: flex; align-items: center; gap: .35rem; }
.article-meta .meta-item svg { width: 14px; height: 14px; opacity: .6; }
.cat-badge {
    display: inline-flex;
    align-items: center;
    background: var(--navy);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .25rem .65rem;
    border-radius: 999px;
    text-decoration: none;
}
.cat-badge:hover { background: var(--gold); color: var(--navy); }
/* Badge de catégorie non cliquable (bandeau d'article) : même rendu, sans interaction */
.cat-badge--static { cursor: default; }
.cat-badge--static:hover { background: var(--navy); color: #fff; }

/* ── Disclaimer ── */
.legal-disclaimer {
    background: var(--gold-pale);
    border: 1px solid var(--border-gold);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    padding: .9rem 1.1rem;
    font-size: .82rem;
    color: #6b5820;
    margin: 2rem 0;
    display: flex;
    gap: .6rem;
}
.legal-disclaimer strong { color: var(--navy); }

/* ── TOC (Table des matières) ── */
.toc-box {
    background: var(--parchment);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin: 1.75rem 0;
    font-size: .875rem;
}
.toc-box .toc-title {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--navy);
    margin-bottom: .75rem;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.toc-list { list-style: none; }
.toc-list li { padding: .25rem 0; }
.toc-list a { color: var(--navy-mid); font-size: .85rem; display: flex; align-items: baseline; gap: .4rem; }
.toc-list a::before { content: '§'; color: var(--gold); font-size: .75rem; flex-shrink: 0; }
.toc-list a:hover { color: var(--gold); }
.toc-list:not(.toc-nested) .toc-h3 { padding-left: 1.1rem; }
.toc-list:not(.toc-nested) .toc-h4 { padding-left: 2.2rem; }
.toc-list .toc-h3 a::before { content: '›'; }
.toc-list .toc-h4 a::before { content: '·'; }
.toc-nested, .toc-nested ul { list-style: none; }
.toc-nested ul { padding-left: .9rem; margin: .15rem 0 .15rem .15rem; border-left: 1px solid var(--border); }

/* ── Blog listing ── */
.section-heading {
    font-family: var(--serif);
    font-size: 1.6rem;
    color: var(--navy);
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.section-heading::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--gold);
}
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.75rem;
}
.filter-btn {
    display: inline-block;
    padding: .35rem .9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .8rem;
    color: var(--text-muted);
    transition: all .18s;
    font-weight: 500;
}
.filter-btn:hover, .filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card-body { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }
.post-card-cat { margin-bottom: .6rem; }
.post-card h2 { font-family: var(--serif); font-size: 1.1rem; color: var(--navy); line-height: 1.4; margin-bottom: .6rem; font-weight: 600; }
.post-card h2 a { color: inherit; }
.post-card h2 a:hover { color: var(--gold); }
.post-card .excerpt { font-size: .875rem; color: var(--text-muted); line-height: 1.65; flex: 1; margin-bottom: .9rem; }
.post-card-footer {
    padding: .75rem 1.4rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--text-muted);
    background: var(--parchment);
}
.read-more { font-size: .82rem; font-weight: 600; color: var(--gold); display: flex; align-items: center; gap: .25rem; }
.read-more:hover { color: var(--gold-hover); }

/* Liste d'articles (vue listing) */
.post-list-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid transparent;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-left-color .2s, box-shadow .2s;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.post-list-item:hover { border-left-color: var(--gold); box-shadow: var(--shadow-sm); }
.post-list-date { flex-shrink: 0; text-align: center; background: var(--navy); color: #fff; border-radius: var(--radius); padding: .5rem .7rem; min-width: 52px; }
.post-list-date .day { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1; font-family: var(--serif); }
.post-list-date .month { display: block; font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.post-list-content { flex: 1; }
.post-list-content h2 { font-family: var(--serif); font-size: 1.1rem; color: var(--navy); margin-bottom: .35rem; font-weight: 600; }
.post-list-content h2 a { color: inherit; }
.post-list-content h2 a:hover { color: var(--gold); }
.post-list-content p { font-size: .875rem; color: var(--text-muted); line-height: 1.65; }

/* ── Sidebar ── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.widget-title {
    background: var(--navy);
    color: #fff;
    font-family: var(--serif);
    font-size: .9rem;
    font-weight: 600;
    padding: .75rem 1.1rem;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.widget-body { padding: 1rem 1.1rem; }
.widget-list { list-style: none; }
.widget-list li { border-bottom: 1px solid var(--border); }
.widget-list li:last-child { border-bottom: none; }
.widget-list a { display: flex; align-items: center; gap: .5rem; padding: .55rem 0; font-size: .875rem; color: var(--text); }
.widget-list a::before { content: '›'; color: var(--gold); font-weight: 700; }
.widget-list a:hover { color: var(--gold); }
.widget-list .count { margin-left: auto; background: var(--parchment); color: var(--text-muted); font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--border); }
.toc-widget .toc-list { padding: 0; }
.toc-widget .toc-list > li { border-bottom: 1px solid var(--border); }
.toc-widget .toc-list > li:last-child { border-bottom: none; }
.toc-widget .toc-nested ul li { border-bottom: none; }
.toc-widget .toc-list a { padding: .5rem 0; }

/* SidebarManager output classes (admin-configured widgets) */
.sidebar-widget-title { background: var(--navy); color: #fff; font-family: var(--serif); font-size: .9rem; font-weight: 600; padding: .75rem 1.1rem; letter-spacing: .03em; display: flex; align-items: center; gap: .5rem; }
.sidebar-list { list-style: none; padding: .25rem 0; margin: 0; }
.sidebar-list li { border-bottom: 1px solid var(--border); }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a { display: flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem; font-size: .875rem; color: var(--text); }
.sidebar-list a::before { content: '›'; color: var(--gold); font-weight: 700; }
.sidebar-list a:hover { color: var(--gold); }
.sidebar-search { display: flex; gap: .4rem; padding: .75rem 1.1rem; }
.sidebar-search input[type="search"] { flex: 1; border: 1px solid var(--border); border-radius: 4px; padding: .45rem .7rem; font-size: .875rem; background: var(--parchment); color: var(--text-dark); outline: none; }
.sidebar-search input[type="search"]:focus { border-color: var(--gold); }
.sidebar-search button { padding: .45rem .75rem; background: var(--navy); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: .85rem; line-height: 1; transition: background .15s; }
.sidebar-search button:hover { background: var(--gold); }
/* Zone "après le contenu" */
.after-content-widgets { max-width: var(--max-w); margin: 2rem auto 0; padding: 0 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }

/* Domaines du droit (homepage) */
.domains-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 1.5rem 0; }
.home-domains-inner--full { max-width: 100%; padding: 0 2rem; }
/* Style: image */
.home-domains--image .domain-card { padding: 0; overflow: hidden; border-top: none; }
.domain-card-img { width: 100%; height: 170px; background-size: cover; background-position: center; flex-shrink: 0; }
.home-domains--image .domain-card h3 { padding: .7rem 1rem .25rem; }
.home-domains--image .domain-card p  { padding: 0 1rem .85rem; }
.home-domains--image .domain-card .domain-icon { display: none; }
/* Style: minimal */
.home-domains--minimal .domain-card { background: transparent; border: 1.5px solid var(--border); border-top-color: var(--border); padding: .9rem 1.1rem; }
.home-domains--minimal .domain-card .domain-icon { font-size: 1.5rem; margin-bottom: .35rem; }
.home-domains--minimal .domain-card:hover { background: rgba(255,255,255,.7); }
.domain-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
    color: inherit;
}
.domain-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.domain-card .domain-icon { font-size: 2rem; margin-bottom: .6rem; }
.domain-card h3 { font-family: var(--serif); font-size: .95rem; color: var(--navy); font-weight: 600; margin-bottom: .25rem; }
.domain-card p { font-size: .78rem; color: var(--text-muted); }

/* ── Homepage ── */
.home-intro { max-width: var(--max-w); margin: 0 auto; padding: 3rem 1.5rem; }
.home-intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.home-intro-text h2 { font-family: var(--serif); font-size: 1.8rem; color: var(--navy); margin-bottom: 1rem; }
.home-intro-text p { color: var(--text-muted); line-height: 1.8; margin-bottom: .9rem; }
.home-intro-features { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.feature-item { display: flex; align-items: flex-start; gap: .6rem; font-size: .875rem; }
.feature-item::before { content: '✓'; color: var(--gold); font-weight: 700; margin-top: .1rem; flex-shrink: 0; }
.home-latest { background: var(--navy); padding: 3rem 1.5rem; color: #fff; }
.home-latest .section-heading { color: #fff; border-color: rgba(255,255,255,.15); }
.home-latest .section-heading::after { background: var(--gold); }
.home-latest-inner { max-width: var(--max-w); margin: 0 auto; }
.home-latest .post-card { border-color: rgba(255,255,255,.1); }
.home-latest .post-card h2 { color: var(--navy); }
.home-domains { background: var(--parchment); padding: 3rem 1.5rem; }
.home-domains-inner { max-width: var(--max-w); margin: 0 auto; }
.home-cta { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); padding: 3.5rem 1.5rem; text-align: center; }
.home-cta h2 { font-family: var(--serif); color: #fff; font-size: 1.8rem; margin-bottom: .75rem; }
.home-cta p { color: rgba(255,255,255,.75); margin-bottom: 1.5rem; }

/* ── Home grid section ── */
.home-section-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.hgs-header { text-align: center; margin-bottom: 2.5rem; }
.hgs-title { font-family: var(--serif); font-size: 1.9rem; margin-bottom: .5rem; }
.hgs-sub   { font-size: 1rem; opacity: .75; margin: 0; }
.hgs-row   { margin-bottom: 1.5rem; }
.hgs-row:last-child { margin-bottom: 0; }
.hgs-col   { min-width: 0; }
/* Text column */
.hgs-col-heading { font-family: var(--serif); font-size: 1.35rem; margin-bottom: .65rem; }
.hgs-col-body  { line-height: 1.75; }
.hgs-col-body h2, .hgs-col-body h3, .hgs-col-body h4 { font-family: var(--serif); margin: 1rem 0 .5rem; }
.hgs-col-body p  { margin-bottom: .75rem; }
.hgs-col-body ul, .hgs-col-body ol { padding-left: 1.4rem; margin-bottom: .75rem; }
.hgs-col-body a  { color: inherit; text-decoration: underline; }
/* Image column */
.hgs-col-figure { margin: 0; }
.hgs-col-figure img { width: 100%; height: auto; display: block; border-radius: 8px; }
.hgs-col-figure figcaption { font-size: .78rem; text-align: center; opacity: .65; margin-top: .4rem; }
/* Video column */
.hgs-col-video iframe,
.hgs-col-video video { width: 100%; aspect-ratio: 16/9; display: block; border-radius: 8px; border: none; }
.hgs-col-caption { font-size: .78rem; text-align: center; opacity: .65; margin-top: .4rem; }
/* Color modes */
.hgs-dark .hgs-title, .hgs-dark .hgs-col-heading, .hgs-dark .hgs-col-body { color: #fff; }
.hgs-dark .hgs-sub { color: rgba(255,255,255,.75); }
.hgs-dark .hgs-col-body a { color: rgba(255,255,255,.9); }
.hgs-light .hgs-title, .hgs-light .hgs-col-heading, .hgs-light .hgs-col-body { color: var(--navy); }
.hgs-light .hgs-sub { color: var(--text-muted); }
.section-sub { color: var(--text-muted); text-align: center; margin-bottom: 1.5rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .875rem;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
    letter-spacing: .02em;
}
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-hover); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-mid); color: #fff; }
.btn-outline { background: transparent; border: 2px solid currentColor; color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-outline-white { color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline-white:hover { background: var(--gold); border-color: var(--gold); }
.btn-lg { padding: .85rem 1.9rem; font-size: 1rem; }

/* ── Article actions ── */
.article-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 2rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all .18s;
    cursor: pointer;
    background: none;
}
.share-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── Footer ── */
.site-footer { background: var(--footer-bg, var(--navy)); color: rgba(255,255,255,.75); margin-top: 0; }
.footer-top { max-width: var(--max-w); margin: 0 auto; padding: 3.5rem 1.5rem 2rem; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-brand .logo-text { color: #fff; font-size: 1.15rem; }
.footer-brand p { font-size: .875rem; margin-top: .9rem; line-height: 1.7; color: rgba(255,255,255,.6); }
.footer-col h4 { font-family: var(--serif); color: #fff; font-size: .95rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .45rem; }
.footer-col ul a { color: rgba(255,255,255,.65); font-size: .85rem; transition: color .18s; }
.footer-col ul a:hover { color: var(--gold); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 1.25rem 1.5rem;
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    color: rgba(255,255,255,.45);
    flex-wrap: wrap;
    gap: .5rem;
}
.footer-bottom a { color: rgba(255,255,255,.45); }
.footer-bottom a:hover { color: var(--gold); }
.footer-divider { height: 1px; background: rgba(255,255,255,.07); }

/* ── 404 ── */
.error-page { text-align: center; padding: 5rem 1.5rem; max-width: 540px; margin: 0 auto; }
.error-page .error-code { font-family: var(--serif); font-size: 6rem; color: var(--gold); line-height: 1; font-weight: 700; opacity: .3; }
.error-page h1 { font-family: var(--serif); font-size: 1.8rem; color: var(--navy); margin: 1rem 0 .75rem; }
.error-page p { color: var(--text-muted); margin-bottom: 1.75rem; }

/* ── Progress bar (reading) ── */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--gold), #e8b84b); z-index: 9999; width: 0; transition: width .1s; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .site-main.with-sidebar { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr 1fr; }
    .home-intro-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 900px) {
    /* ── Top bar ── */
    .top-bar { display: none; }
    .top-bar.topbar-show-mobile { display: block; }

    /* ── Site header ── */
    .site-header {
        position: relative;
        z-index: 510; /* > overlay (490) : le stacking context du header englobe le tiroir */
    }
    .header-inner {
        height: var(--mobile-header-height, 60px);
        padding: 0 1rem;
        justify-content: flex-start;
        gap: 0;
    }

    /* ── Logo — fill space, centre its content ── */
    .site-header .site-logo {
        flex: 1;
        justify-content: center;
    }

    /* ── Hamburger — left, animated into × ── */
    .nav-toggle {
        display: flex;
        flex-shrink: 0;
        margin-right: .6rem;
        position: relative;
        z-index: 520;
    }
    .nav-toggle span { transition: transform .3s ease, opacity .25s ease; }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* ── NAV OVERLAY (drawer backdrop) ── */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 490;
    }
    .nav-overlay.open { display: block; animation: nvFadeIn .25s ease; }
    @keyframes nvFadeIn { from { opacity: 0; } to { opacity: 1; } }

    /* ══ Hamburger à DROITE (body.hamburger-right) ══ */
    .hamburger-right .header-inner {
        flex-direction: row-reverse;  /* Logo à gauche, hamburger à droite */
    }
    .hamburger-right .site-header .site-logo {
        justify-content: flex-start; /* Logo aligné à gauche */
    }
    .hamburger-right .nav-toggle {
        margin-right: 0;
        margin-left: .6rem;
    }
    /* Drawer depuis la droite quand hamburger est à droite */
    .hamburger-right.mobile-menu-drawer .site-nav {
        left: auto;
        right: 0;
        transform: translateX(100%);
        box-shadow: -6px 0 40px rgba(0,0,0,.45);
        border-right: none;
        border-left: 1px solid rgba(255,255,255,.08);
    }
    .hamburger-right.mobile-menu-drawer .site-nav.open {
        transform: translateX(0);
    }

    /* ══ Hamburger à GAUCHE (body.hamburger-left, défaut) ══ */
    .hamburger-left .header-inner {
        justify-content: flex-start;
    }
    .hamburger-left .site-header .site-logo {
        justify-content: center;
    }

    /* ══ DRAWER (slide from left) ══ */
    .mobile-menu-drawer .site-nav {
        display: flex !important; /* always in DOM, off-screen by default */
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(290px, 82vw);
        background: var(--header-bg, var(--navy));
        z-index: 500;
        padding-top: var(--mobile-header-height, 60px);
        padding-bottom: 2.5rem;
        gap: 0;
        transform: translateX(-100%);
        transition: transform .32s cubic-bezier(.4, 0, .2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 6px 0 40px rgba(0, 0, 0, .45);
        border-right: 1px solid rgba(255, 255, 255, .08);
    }
    .mobile-menu-drawer .site-nav.open { transform: translateX(0); }
    .mobile-menu-drawer .site-nav > li {
        border-bottom: 1px solid rgba(255, 255, 255, .07);
        list-style: none;
    }
    .mobile-menu-drawer .site-nav > li > a {
        padding: .85rem 1.5rem;
        font-size: .95rem;
        border-radius: 0;
        display: block;
    }
    .mobile-menu-drawer .site-nav > li.active > a {
        border-bottom: none;
        border-left: 3px solid var(--gold);
        padding-left: calc(1.5rem - 3px);
        color: var(--gold);
        background: rgba(255, 255, 255, .06);
    }

    /* ══ DROPDOWN (falls under header) ══ */
    .mobile-menu-dropdown .site-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--mobile-header-height, 60px);
        left: 0;
        right: 0;
        background: var(--header-bg, var(--navy));
        padding: .5rem 0;
        gap: 0;
        border-top: 2px solid var(--gold);
        box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
        z-index: 400;
        max-height: calc(100vh - var(--mobile-header-height, 60px));
        overflow-y: auto;
    }
    .mobile-menu-dropdown .site-nav.open { display: flex; }
    .mobile-menu-dropdown .site-nav > li { border-bottom: 1px solid rgba(255, 255, 255, .07); list-style: none; }
    .mobile-menu-dropdown .site-nav > li > a { padding: .8rem 1.5rem; font-size: .95rem; display: block; }

    /* ── Accordéon mobile : li parent → flex pour aligner lien + toggle ── */
    .site-nav li.has-children {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .site-nav li.has-children > a {
        flex: 1;
        min-width: 0;
    }
    .site-nav li.has-children > .sub-menu {
        flex-basis: 100%;
        width: 100%;
    }

    /* Bouton toggle ▾/▴ — visible uniquement sur mobile */
    .sub-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 46px;
        background: rgba(255, 255, 255, .07);
        border: none;
        border-left: 1px solid rgba(255, 255, 255, .07);
        cursor: pointer;
        color: rgba(255, 255, 255, .6);
        font-size: .95rem;
        transition: background .15s, color .15s;
        flex-shrink: 0;
        padding: 0;
    }
    .sub-toggle:hover,
    .sub-toggle[aria-expanded="true"] {
        background: rgba(255, 255, 255, .13);
        color: var(--gold);
    }

    /* ── Sous-menus → accordéon (fermés par défaut) ── */
    .site-nav .sub-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, .06);
        min-width: 0;
        background: rgba(0, 0, 0, .22);
        border-radius: 0;
    }
    .site-nav .sub-menu.open { display: block; }

    /* Liens dans les sous-menus (indentation progressive par niveau) */
    .site-nav .sub-menu li a {
        padding: .65rem 1.5rem .65rem 2.25rem;
        color: rgba(255, 255, 255, .7);
        font-size: .875rem;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
        display: block;
    }
    .site-nav .sub-menu .sub-menu li a          { padding-left: 3.25rem; }
    .site-nav .sub-menu .sub-menu .sub-menu li a { padding-left: 4.25rem; }
    .site-nav .sub-menu .sub-menu .sub-menu .sub-menu li a { padding-left: 5.25rem; }
    .site-nav .sub-menu li:last-child > a { border-bottom: none; }
    .site-nav .sub-menu li a:hover { background: rgba(255, 255, 255, .08); color: var(--gold); }

    /* Cacher la flèche › sur mobile (remplacée par le bouton sub-toggle) */
    .sub-menu li.has-children > a::after { display: none; }

    /* ── Footer ── */
    .footer-top {
        grid-template-columns: repeat(var(--mobile-footer-cols, 1), 1fr);
        gap: 1.75rem;
    }
    .footer-bottom { flex-direction: column; text-align: center; }

    /* ── Other layout ── */
    .posts-grid { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr; }
    .home-intro-features { grid-template-columns: 1fr; }
    .page-hero { padding: 3rem 1.25rem; }
    .domains-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .site-main { padding: 2rem 1.25rem; }
    .breadcrumb { padding: 0 1.25rem; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0 .75rem; }
    .post-list-item { flex-direction: column; gap: .75rem; }
    .post-list-date { display: none; }
    .domains-grid { grid-template-columns: 1fr !important; }
    .footer-top { grid-template-columns: 1fr !important; }
    .site-main { padding: 1.5rem 1rem; }
    .page-hero { padding: 2.5rem 1rem; }
    .home-intro-grid { gap: 1.5rem; }
}

/* ── Print ── */
@media print {
    .site-header, .site-footer, .sidebar, .article-actions, .reading-progress, .breadcrumb-wrap { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    a { color: #000; text-decoration: underline; }
    .article-body h2 { border-bottom: 1pt solid #000; }
    .legal-disclaimer { border: 1pt solid #ccc; }
}

/* ── Pagination ── */
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin: 2rem 0; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .6rem; border-radius: 4px; border: 1px solid var(--gold); background: transparent; color: var(--gold); text-decoration: none; font-size: .875rem; transition: background .15s, color .15s; }
.page-btn:hover { background: var(--gold); color: var(--navy); }
.page-btn.active { background: var(--gold); color: var(--navy); font-weight: 700; pointer-events: none; }

/* ── Category editorial blocks ── */
.cat-editorial { background: rgba(184,146,46,.07); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 1.5rem 1.75rem; margin: 1.75rem 0; line-height: 1.8; }
.cat-editorial h2, .cat-editorial h3 { color: var(--navy); font-family: 'Playfair Display', Georgia, serif; }
.cat-editorial-bottom { background: rgba(27,42,74,.05); border-left-color: var(--navy); }

/* ── Bouton « Revenir en haut » (mobile uniquement, apparaît au défilement) ── */
.back-to-top { display: none; }
@media (max-width: 900px) {
    .back-to-top {
        position: fixed; right: 24px; bottom: 84px; z-index: 2147482500;
        width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
        background: var(--navy, #1b2a4a); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.28);
        display: flex; align-items: center; justify-content: center; cursor: pointer;
        opacity: 0; visibility: hidden; transform: translateY(8px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }
    .back-to-top.show { opacity: 1; visibility: visible; transform: none; }
    .back-to-top svg { width: 22px; height: 22px; }
    .back-to-top:active { transform: scale(.94); }
}

/* ── Cartes d'articles de la page d'accueil (hp-*) ── */
.hp-home { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.25rem; }
.hp-home > p { line-height: 1.8; }
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; margin: 1rem 0 .25rem; }
.hp-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.hp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.hp-card-img { width: 100%; aspect-ratio: 16 / 9; max-height: 280px; object-fit: cover; display: block; }
.hp-car

/* ── Carte de localisation (Leaflet auto-hébergé, CSP-safe) ── */
.ei-map-wrap{margin:1.6rem 0;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm);background:var(--white)}
.ei-map{height:320px;width:100%}
.ei-map-label{margin:0;padding:.65rem .9rem;font-size:.85rem;color:var(--text-muted);background:#f7fafc;border-top:1px solid var(--border)}
.leaflet-container{font:inherit}

/* ── Raffinements industriels (accents sur le markup QuietCMS existant) ── */
.hp-card{transition:transform .15s,box-shadow .15s,border-color .15s}
.hp-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.article-body a{border-bottom:1px solid rgba(13,59,102,.25)}
.article-body a:hover{border-color:var(--gold)}

/* ── Héros illustré (accueil) ── */
.ei-hero{position:relative;background-size:cover;background-position:center;color:#fff;
padding:5.5rem 1.5rem 5rem;text-align:center}
.ei-hero-inner{max-width:860px;margin:0 auto;position:relative;z-index:1}
.ei-hero h1{font-size:2.5rem;font-weight:800;letter-spacing:-.6px;margin:0 0 .7rem;line-height:1.15;
text-shadow:0 2px 24px rgba(0,0,0,.35)}
.ei-hero p{font-size:1.18rem;color:#dbe6f2;max-width:660px;margin:0 auto 1.6rem}
.ei-hero-divider{width:76px;height:4px;background:var(--gold);border-radius:3px;margin:1.6rem auto 0}
.ei-hero-search{display:flex;max-width:600px;margin:0 auto;background:#fff;border-radius:14px;
box-shadow:0 18px 44px rgba(8,39,68,.4);overflow:hidden;padding:.4rem}
.ei-hero-search input{flex:1;border:0;background:transparent;padding:.85rem 1rem;font-size:1.02rem;
color:var(--text);font-family:inherit}
.ei-hero-search input:focus{outline:none}
.ei-hero-search button{display:inline-flex;align-items:center;gap:.5rem;background:var(--gold);color:#fff;
border:0;border-radius:10px;padding:.7rem 1.3rem;font-weight:700;font-size:1rem;cursor:pointer;
font-family:inherit;transition:background .15s}
.ei-hero-search button:hover{background:var(--gold-hover)}
.ei-hero-search button svg{width:20px;height:20px}
@media(max-width:768px){
  .ei-hero{padding:3.4rem 1.2rem 3rem}
  .ei-hero h1{font-size:1.85rem}
  .ei-hero p{font-size:1.02rem}
  .ei-hero-search button span{display:none}
  .ei-hero-search button{padding:.7rem .9rem}
}

/* ── Corps des cartes d'accueil ── */
.hp-card-img{border-radius:0}
.hp-card-body{display:flex;flex-direction:column;padding:1rem 1.1rem 1.2rem;gap:.35rem;flex:1}
.hp-card-title{font-weight:700;font-size:1.05rem;color:var(--navy);line-height:1.3}
.hp-card-exc{font-size:.9rem;color:var(--text-muted);line-height:1.5}
.hp-card-more{margin-top:auto;padding-top:.5rem;color:var(--gold);font-weight:600;font-size:.9rem}
.hp-card:hover .hp-card-more{color:var(--gold-hover)}

/* ── Listes d'index (pages Secteurs / Départements) ── */
.ei-index{list-style:none;margin:1rem 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:.5rem}
.ei-index.cols{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
.ei-index li{background:var(--white);border:1px solid var(--line);border-radius:10px;padding:.6rem .85rem;
display:flex;justify-content:space-between;align-items:center;gap:.6rem;transition:border-color .14s,box-shadow .14s}
.ei-index li:hover{border-color:#d3deea;box-shadow:var(--shadow-sm)}
.ei-index li a{font-weight:600;color:var(--navy)}
.ei-index li span{color:var(--text-muted);font-size:.82rem;white-space:nowrap}


/* ═══ Page d'accueil : infographies & animations (pilier 10k mots) ═══ */
.ei-home{--c1:#0d3b66;--c2:#0a2c4d;--acc:#e8731c;--ink:#13202e;--mut:#5b6472;--line:#e7ecf2;--soft:#f4f7fb;--card:#fff}
.ei-home{max-width:1080px;margin:0 auto;padding:0 1rem;color:var(--ink);font-size:1.05rem;line-height:1.75}
.ei-home section{padding:2.4rem 0;border-top:1px solid var(--line)}
.ei-home section:first-of-type{border-top:0}
.ei-home h2{font-size:1.7rem;font-weight:800;letter-spacing:-.4px;margin:.2rem 0 .3rem;color:var(--c1);display:flex;align-items:center;gap:.6rem}
.ei-home h2 .n{flex:none;width:2.1rem;height:2.1rem;border-radius:9px;background:linear-gradient(135deg,var(--c1),var(--c2));color:#fff;font-size:1rem;display:inline-flex;align-items:center;justify-content:center}
.ei-home h3{font-size:1.18rem;color:var(--acc);margin:1.4rem 0 .3rem}
.ei-home p{margin:.7rem 0}
.ei-home .lead{font-size:1.16rem;color:#28394a;border-left:4px solid var(--acc);padding-left:1rem;margin:.6rem 0 1.4rem}
.ei-home strong{color:#0f2942}
.ei-home a{color:var(--c1);font-weight:600;border-bottom:1px solid rgba(13,59,102,.25)}
.ei-home a:hover{border-color:var(--acc)}
/* Révélation — animation CSS autonome : le contenu reste visible même si le JS
   ne s'exécute pas (moteur bloqué, CSP, transition figée). Fondu montant au chargement. */
@keyframes eiReveal{from{opacity:0;transform:translateY(26px)}to{opacity:1;transform:none}}
.reveal{opacity:1;transform:none;animation:eiReveal .8s cubic-bezier(.2,.7,.2,1) both}
.reveal.d1{animation-delay:.08s}.reveal.d2{animation-delay:.16s}.reveal.d3{animation-delay:.24s}
.reveal.in{opacity:1;transform:none}
@media (prefers-reduced-motion: reduce){.reveal{animation:none;opacity:1;transform:none}}
/* KPI */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin:1.4rem 0}
.kpi{background:linear-gradient(160deg,#0e3f70,#0a2c4d);color:#fff;border-radius:16px;padding:1.3rem 1.2rem;position:relative;overflow:hidden;box-shadow:0 10px 26px rgba(10,44,77,.18)}
.kpi::after{content:"";position:absolute;right:-30px;top:-30px;width:120px;height:120px;border-radius:50%;background:radial-gradient(circle,rgba(232,115,28,.35),transparent 65%)}
.kpi b{display:block;font-size:2.2rem;font-weight:800;line-height:1;letter-spacing:-1px}
.kpi span{display:block;margin-top:.4rem;color:#cfe0f0;font-size:.9rem}
/* Graphe barres */
.chart{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:1.4rem 1.5rem;margin:1.4rem 0;box-shadow:0 4px 18px rgba(16,32,48,.05)}
.chart .ct{font-weight:700;color:var(--c1);margin-bottom:.2rem}
.chart .cs{color:var(--mut);font-size:.86rem;margin-bottom:1rem}
.barrow{display:grid;grid-template-columns:210px 1fr 54px;align-items:center;gap:.7rem;margin:.5rem 0;font-size:.92rem}
.barrow .lbl{color:#28394a;font-weight:600}
.bartrack{background:var(--soft);border-radius:999px;height:16px;overflow:hidden}
.barfill{height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,var(--c1),var(--acc));transition:width 1.1s cubic-bezier(.2,.7,.2,1)}
.barrow .val{text-align:right;font-weight:700;color:var(--c1)}
.chart .src{color:var(--mut);font-size:.78rem;margin-top:1rem;font-style:italic}
/* Donut */
.donutwrap{display:flex;gap:1.6rem;align-items:center;flex-wrap:wrap;justify-content:center}
.donut{--sz:200px;width:var(--sz);height:var(--sz);flex:none}
.donut circle{fill:none;stroke-width:20;transform:rotate(-90deg);transform-origin:50% 50%;transition:stroke-dasharray 1.2s cubic-bezier(.2,.7,.2,1)}
.legend{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.5rem;min-width:220px}
.legend li{display:flex;align-items:center;gap:.6rem;font-size:.92rem}
.legend .dot{width:14px;height:14px;border-radius:4px;flex:none}
.legend b{margin-left:auto;color:var(--c1)}
/* Frise */
.timeline{position:relative;margin:1.4rem 0;padding-left:1.6rem}
.timeline::before{content:"";position:absolute;left:6px;top:6px;bottom:6px;width:3px;background:linear-gradient(var(--c1),var(--acc))}
.tl{position:relative;margin:0 0 1.2rem;padding:.2rem 0 .2rem .4rem}
.tl::before{content:"";position:absolute;left:-1.6rem;top:.5rem;width:13px;height:13px;border-radius:50%;background:var(--acc);box-shadow:0 0 0 4px #fff,0 0 0 5px var(--line)}
.tl .yr{font-weight:800;color:var(--c1)}
/* Cartes / grille */
.cardgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem;margin:1.2rem 0}
.minicard{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:1.1rem 1.2rem;box-shadow:0 3px 14px rgba(16,32,48,.05)}
.minicard h4{margin:.1rem 0 .4rem;color:var(--c1);font-size:1.03rem}
.minicard p{font-size:.92rem;color:#3a4a5a;margin:.2rem 0}
/* Meter */
.meter{margin:.9rem 0}
.meter .mt{display:flex;justify-content:space-between;font-size:.92rem;font-weight:600;color:#28394a}
.metertrack{background:var(--soft);border-radius:999px;height:12px;margin-top:.3rem;overflow:hidden}
.meterfill{height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,var(--c2),var(--acc));transition:width 1.1s cubic-bezier(.2,.7,.2,1)}
.callout{background:linear-gradient(135deg,#fff5ec,#fdece0);border:1px solid #f4d6bd;border-radius:14px;padding:1.1rem 1.3rem;margin:1.3rem 0}
.callout strong{color:var(--acc)}
.ei-home .faq details{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:.2rem 1rem;margin:.6rem 0}
.ei-home .faq summary{cursor:pointer;font-weight:700;color:var(--c1);padding:.8rem 0;list-style:none}
.ei-home .faq summary::-webkit-details-marker{display:none}
.ei-home .faq summary::before{content:"+ ";color:var(--acc)}
.ei-home .faq details[open] summary::before{content:"– "}
@media(max-width:640px){.barrow{grid-template-columns:1fr;gap:.2rem}.barrow .val{text-align:left}.ei-home h2{font-size:1.4rem}}

/* ═══ Grille de départements avec vignettes (page /departements/) ═══ */
.ei-dep-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.7rem;margin:1.3rem 0}
.ei-dep-card{display:flex;flex-direction:column;background:#fff;border:1px solid var(--line,#e7ecf2);border-radius:12px;overflow:hidden;text-decoration:none;transition:transform .15s ease,box-shadow .15s ease;box-shadow:var(--shadow-sm,0 3px 14px rgba(16,32,48,.05))}
.ei-dep-card:hover{transform:translateY(-3px);box-shadow:0 10px 24px rgba(16,32,48,.14)}
.ei-dep-thumb{display:block;aspect-ratio:16/9;overflow:hidden;background:#eef2f7}
.ei-dep-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ei-dep-meta{display:flex;flex-direction:column;gap:.1rem;padding:.4rem .55rem .5rem}
.ei-dep-name{font-weight:700;font-size:.86rem;color:var(--navy,#0d3b66);line-height:1.2}
.ei-dep-name b{font-weight:600;color:var(--text-muted,#5b6472)}
.ei-dep-count{font-size:.72rem;color:var(--text-muted,#5b6472);white-space:nowrap}

/* ===== Recherche : formulaire + résultats en cartes ===== */
.ei-sr-form{display:flex;gap:.6rem;margin:0 0 1.6rem;flex-wrap:wrap}
.ei-sr-form input[type=search]{flex:1;min-width:240px;padding:.85rem 1.1rem;border:1px solid #cbd5e1;border-radius:12px;font-size:1.05rem;background:#fff}
.ei-sr-form input[type=search]:focus{outline:none;border-color:var(--acc,#e8731c);box-shadow:0 0 0 3px rgba(232,115,28,.18)}
.ei-sr-form button{padding:.85rem 1.6rem;border:0;border-radius:12px;background:var(--acc,#e8731c);color:#fff;font-weight:700;font-size:1rem;cursor:pointer;transition:filter .15s ease}
.ei-sr-form button:hover{filter:brightness(1.06)}
.ei-sr-hint{color:#5b6472;line-height:1.6}
.ei-sr-count{color:#5b6472;margin:0 0 1.2rem;font-size:.95rem}
.ei-sr-list{display:flex;flex-direction:column;gap:.9rem;margin:0 0 1rem}
.ei-sr-card{display:flex;gap:0;align-items:stretch;background:#fff;border:1px solid var(--line,#e7ecf2);border-radius:14px;overflow:hidden;text-decoration:none;box-shadow:var(--shadow-sm,0 3px 14px rgba(16,32,48,.05));transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}
.ei-sr-card:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(16,32,48,.14);border-color:#d5dde7}
.ei-sr-thumb{flex:0 0 190px;max-width:190px;background:#eef2f7;overflow:hidden;aspect-ratio:16/10}
.ei-sr-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ei-sr-body{display:flex;flex-direction:column;gap:.3rem;padding:.85rem 1.1rem;min-width:0}
.ei-sr-top{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.ei-sr-name{font-weight:800;color:var(--navy,#0d3b66);font-size:1.12rem;line-height:1.2}
.ei-sr-badge{font-size:.68rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:#0d3b66;background:#eef4fb;border-radius:20px;padding:.16rem .6rem;white-space:nowrap}
.ei-sr-badge-entreprise{color:#8a4310;background:#fdf0e5}
.ei-sr-badge-secteur{color:#0d3b66;background:#eaf1fb}
.ei-sr-badge-département,.ei-sr-badge-departement{color:#1f6b3a;background:#e8f6ec}
.ei-sr-badge-rubrique{color:#5b3fa0;background:#f0ebfb}
.ei-sr-sector{font-size:.82rem;color:#6b7480;font-weight:600}
.ei-sr-desc{font-size:.92rem;color:#5b6472;line-height:1.55}
.ei-sr-more{margin-top:.2rem;font-size:.85rem;font-weight:700;color:var(--acc,#e8731c)}
@media (max-width:640px){
  .ei-sr-card{flex-direction:column}
  .ei-sr-thumb{flex-basis:auto;max-width:none;width:100%;aspect-ratio:16/9}
}

/* ===== Autocomplétion barre de recherche (home) ===== */
.ei-hero-search{position:relative}
.ei-ac{position:absolute;top:calc(100% + .45rem);left:0;right:0;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 20px 46px rgba(8,28,58,.22);overflow:hidden;z-index:60;display:none;text-align:left}
.ei-ac.open{display:block}
.ei-ac-item{display:flex;flex-direction:column;gap:.08rem;padding:.6rem .95rem;text-decoration:none;border-bottom:1px solid #f1f5f9}
.ei-ac-item:last-child{border-bottom:0}
.ei-ac-item.on,.ei-ac-item:hover{background:#f5f9fe}
.ei-ac-n{font-weight:700;color:#0d3b66;font-size:.98rem;line-height:1.2}
.ei-ac-t{font-size:.74rem;color:#6b7480;text-transform:uppercase;letter-spacing:.02em}
@media (max-width:640px){.ei-ac{max-height:60vh;overflow-y:auto}}

/* Titres des cartes de fiches : jamais coupés */
.post-card h2,.post-card h2 a,.post-card-body h2,.post-card-body h2 a{white-space:normal!important;overflow:visible!important;text-overflow:clip;overflow-wrap:anywhere}
