/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #2563eb;
    --text: #1e293b;
    --muted: #64748b;
    --bg: #f8fafc;
    --border: #e2e8f0;
    --radius: 8px;
    --max-w: 1100px;
    --content-w: 740px;
}
body { font-family: system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.65; }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }

/* ── Nav ── */
.site-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 510; /* > overlay (490) pour que le tiroir reste cliquable */
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}
.logo-qcms-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 7px; display: block; }
.logo-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }

/* Hamburger — caché sur desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: .45rem;
    background: none;
    border: none;
    flex-shrink: 0;
    z-index: 520;
    position: relative;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    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); }

/* Sub-toggle — caché sur desktop */
.sub-toggle { display: none; }

/* Menu principal (desktop : flex horizontal) */
.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .15rem;
    margin-left: auto; /* pousse le menu vers la droite */
    flex-wrap: wrap;
}
.nav-menu > li { position: relative; list-style: none; }
.nav-menu > li > a {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    padding: .45rem .8rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.nav-menu > li > a:hover,
.nav-menu > li.active > a { background: #f1f5f9; color: var(--primary); }
.nav-menu > li.active > a { font-weight: 600; }

/* Flèche ▾ sur les parents desktop */
.nav-menu > li.has-children > a::after {
    content: '▾';
    font-size: .6rem;
    margin-left: .3rem;
    opacity: .5;
    vertical-align: middle;
}

/* Dropdown desktop — niveau 2 (apparaît sous le top-nav) */
.sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: .35rem 0;
    min-width: 210px;
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    list-style: none;
    z-index: 100;
}
.nav-menu > li:hover > .sub-menu { display: block; }
.sub-menu li { list-style: none; position: relative; }
.sub-menu a {
    display: block;
    padding: .55rem 1rem;
    color: var(--text);
    font-size: .875rem;
    text-decoration: none;
    transition: background .12s;
    border-bottom: 1px solid var(--border);
}
.sub-menu li:last-child > a { border-bottom: none; }
.sub-menu a:hover { background: #f1f5f9; color: var(--primary); }

/* 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;         /* aligne avec la bordure top */
    left: 100%;
    border-top: 2px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    box-shadow: 4px 4px 20px rgba(0,0,0,.10);
}
.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%;
    border-radius: var(--radius) 0 var(--radius) var(--radius);
}

/* Overlay (drawer backdrop) */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 490;
}
.nav-overlay.open { display: block; animation: navFadeIn .22s ease; }
@keyframes navFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Main ── */
#main { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.5rem; min-height: 60vh; }

/* ── Hero ── */
.hero { text-align: center; padding: 3rem 1rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .75rem; }
.hero .subtitle { color: var(--muted); font-size: 1.1rem; }

/* ── Page content ── */
.page-content, .single-post { max-width: var(--content-w); margin: 0 auto; }
.page-header h1, .post-header h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: .75rem; }
.content-body, .post-body { margin-top: 1.5rem; }
.content-body h2, .post-body h2 { font-size: 1.4rem; margin: 1.75rem 0 .75rem; }
.content-body h3, .post-body h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.content-body p, .post-body p { margin-bottom: 1rem; }
.content-body ul, .post-body ul, .content-body ol, .post-body ol { margin: .75rem 0 1rem 1.5rem; }

/* ── Blog listing ── */
.blog-listing .page-header { margin-bottom: 1.5rem; }
.category-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.category-nav a { background: #e2e8f0; padding: .3rem .75rem; border-radius: 999px; color: var(--text); text-decoration: none; font-size: .85rem; }
.category-nav a:hover { background: var(--primary); color: #fff; }
.posts-list { display: grid; gap: 1.25rem; }
.post-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.post-card h2, .post-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.post-card h2 a, .post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--primary); }
.post-meta { font-size: .8rem; color: var(--muted); margin-bottom: .5rem; display: flex; gap: .75rem; }
.cat-link { color: var(--primary); }
.excerpt { color: var(--muted); font-size: .9rem; margin: .4rem 0; }
.read-more { font-size: .85rem; color: var(--primary); text-decoration: none; }
.read-more:hover { text-decoration: underline; }

/* ── Latest posts grid ── */
.latest-posts { margin-top: 3rem; }
.latest-posts h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

/* ── Post ── */
.post-meta time { display: block; color: var(--muted); font-size: .85rem; margin-bottom: .4rem; }
.post-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ── Buttons ── */
.btn { display: inline-block; padding: .6rem 1.2rem; border-radius: 6px; text-decoration: none; font-size: .9rem; font-weight: 500; }
a.btn, button.btn { background: var(--primary); color: #fff; border: none; cursor: pointer; }
a.btn:hover, button.btn:hover { opacity: .9; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); background: #fff; margin-top: 4rem; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 1.5rem; color: var(--muted); font-size: .875rem; }

/* ── Error page ── */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 { font-size: 2rem; margin-bottom: 1rem; }

/* ── 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: 6px; border: 1px solid var(--border); background: #fff; color: var(--text); text-decoration: none; font-size: .875rem; transition: background .15s; }
.page-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; pointer-events: none; }
/* ── Category editorial blocks ── */
.cat-content { background: var(--bg); border-radius: 8px; padding: 1.5rem 1.75rem; margin: 1.5rem 0; line-height: 1.75; }
.cat-content h2, .cat-content h3 { color: var(--primary); }

/* ══ Layouts avec barre latérale ═══════════════════════════════════════════ */

/* Conteneur avec sidebar — remplace #main pour les pages qui en ont une */
#main.with-sidebar {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    min-height: 60vh;
    display: grid;
    gap: 2.5rem;
    align-items: start;
}
#main.with-sidebar.layout-sidebar-right { grid-template-columns: 1fr 300px; }
#main.with-sidebar.layout-sidebar-left  { grid-template-columns: 300px 1fr; }
#main.with-sidebar.layout-sidebar-left  .main-content { order: 2; }
#main.with-sidebar.layout-sidebar-left  .sidebar       { order: 1; }

/* Reset padding/max-width quand le contenu est dans .main-content */
#main.with-sidebar .main-content > .page-content,
#main.with-sidebar .main-content > .single-post,
#main.with-sidebar .main-content > .blog-listing { max-width: none; }

@media (max-width: 820px) {
    #main.with-sidebar { display: block; }
    #main.with-sidebar .main-content { order: 1 !important; }
    #main.with-sidebar .sidebar      { order: 2 !important; margin-top: 2rem; }
}

/* ── Sidebar styles ─────────────────────────────────────────────────────── */
.sidebar { min-width: 0; }

.sidebar-widget {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.sidebar-widget-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
}

.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li {
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a { color: var(--text); text-decoration: none; transition: color .12s; }
.sidebar-list a:hover { color: var(--primary); }

.sidebar-search {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 7px;
    overflow: hidden;
}
.sidebar-search:focus-within { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.sidebar-search input {
    flex: 1; border: none !important; outline: none !important;
    padding: .5rem .75rem; font-size: .875rem; color: var(--text);
    min-width: 0;
}
.sidebar-search button {
    padding: .5rem .7rem;
    background: var(--primary); color: #fff;
    border: none; cursor: pointer;
    font-size: .85rem; transition: opacity .12s;
}
.sidebar-search button:hover { opacity: .88; }

/* ══ Homepage template ══════════════════════════════════════════════════════ */

/* Reset du main sur la home : les sections gèrent leur propre layout */
body.page-home #main { max-width: none; margin: 0; padding: 0; min-height: 0; }

/* ── Héro ─────────────────────────────────────────────────────────────────── */
.hp-hero {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; text-align: center;
    background: #1e293b; /* fallback sans image */
}
.hp-hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    transform: scale(1.02); /* léger zoom évite le bord blanc au resize */
}
.hp-hero-overlay { position: absolute; inset: 0; }
.hp-hero-content {
    position: relative; z-index: 1;
    max-width: 820px; padding: 3.5rem 1.5rem; width: 100%;
}
.hp-hero-h1 {
    font-size: clamp(2rem, 5.5vw, 3.6rem);
    font-weight: 800; color: #fff; margin-bottom: 1rem;
    line-height: 1.12;
    text-shadow: 0 2px 16px rgba(0,0,0,.45);
    letter-spacing: -.01em;
}
.hp-hero-sub {
    font-size: clamp(.95rem, 2vw, 1.2rem);
    color: rgba(255,255,255,.88); margin-bottom: 2rem;
    line-height: 1.65; text-shadow: 0 1px 8px rgba(0,0,0,.3);
    max-width: 620px; margin-left: auto; margin-right: auto;
}
.hp-hero-cta {
    display: inline-block; padding: .85rem 2.25rem;
    background: var(--primary); color: #fff;
    border-radius: 8px; font-weight: 700; font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 24px rgba(0,0,0,.28);
    transition: opacity .15s, transform .15s;
}
.hp-hero-cta:hover { opacity: .9; transform: translateY(-2px); }

/* ── Sections communes ────────────────────────────────────────────────────── */
.hp-inner { max-width: var(--max-w); margin: 0 auto; padding: 4rem 1.5rem; }
.hp-section-hd {
    display: flex; align-items: baseline;
    justify-content: space-between; gap: 1rem;
    margin-bottom: 1.75rem; flex-wrap: wrap;
}
.hp-section-title { font-size: clamp(1.3rem, 2.5vw, 1.85rem); font-weight: 800; color: var(--text); }
.hp-section-cta { font-size: .875rem; color: var(--primary); text-decoration: none; font-weight: 600; white-space: nowrap; }
.hp-section-cta:hover { text-decoration: underline; }

/* ── Section contenu ─────────────────────────────────────────────────────── */
.hp-section-content { background: #fff; }
.hp-content-body { max-width: var(--content-w); margin: 0 auto; }
.hp-content-body h2 { font-size: 1.4rem; margin: 1.75rem 0 .75rem; }
.hp-content-body h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.hp-content-body p  { margin-bottom: 1rem; }
.hp-content-body ul,
.hp-content-body ol { margin: .75rem 0 1rem 1.5rem; }

/* ── Section articles ────────────────────────────────────────────────────── */
.hp-section-posts { background: var(--bg); }
.hp-posts-grid {
    display: grid;
    grid-template-columns: repeat(var(--hp-cols, 3), 1fr);
    gap: 1.5rem;
}
@media (max-width: 900px) { .hp-posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hp-posts-grid { grid-template-columns: 1fr; } }

.hp-post-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column;
    transition: box-shadow .18s, transform .18s;
}
.hp-post-card:hover { box-shadow: 0 6px 28px rgba(0,0,0,.09); transform: translateY(-2px); }
.hp-post-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--bg); }
.hp-post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.hp-post-card:hover .hp-post-thumb img { transform: scale(1.04); }
.hp-post-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; gap: .45rem; }
.hp-post-meta { display: flex; align-items: center; gap: .5rem; font-size: .77rem; color: var(--muted); flex-wrap: wrap; }
.hp-post-cat { color: var(--primary); text-decoration: none; font-weight: 600; }
.hp-post-cat:hover { text-decoration: underline; }
.hp-post-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.hp-post-title a { color: var(--text); text-decoration: none; }
.hp-post-title a:hover { color: var(--primary); }
.hp-post-excerpt { font-size: .875rem; color: var(--muted); line-height: 1.6; flex: 1; }
.hp-post-read { font-size: .82rem; color: var(--primary); text-decoration: none; font-weight: 600; margin-top: auto; }
.hp-post-read:hover { text-decoration: underline; }

/* ── Section catégories ──────────────────────────────────────────────────── */
.hp-section-cats { background: #fff; }
.hp-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.hp-cat-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 1.5rem 1rem; border: 1.5px solid var(--border); border-radius: 12px;
    text-decoration: none; color: var(--text); background: #fff;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}
.hp-cat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 18px rgba(37,99,235,.1);
    transform: translateY(-3px);
}
.hp-cat-img { width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 8px; margin-bottom: .85rem; }
.hp-cat-img img { width: 100%; height: 100%; object-fit: cover; }
.hp-cat-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.hp-cat-name { font-weight: 700; font-size: .93rem; color: var(--text); }
.hp-cat-desc { font-size: .77rem; color: var(--muted); line-height: 1.5; margin-top: .3rem; }

/* ── Bandeau CTA ─────────────────────────────────────────────────────────── */
.hp-cta-inner { text-align: center; padding-top: 3.5rem; padding-bottom: 3.5rem; }
.hp-cta-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin-bottom: .75rem; }
.hp-cta-text {
    font-size: 1rem; opacity: .88; margin-bottom: 1.75rem;
    max-width: 580px; margin-left: auto; margin-right: auto; line-height: 1.7;
}
.hp-cta-btn {
    display: inline-block; padding: .8rem 2.1rem;
    border: 2px solid; border-radius: 8px;
    font-weight: 700; font-size: 1rem; text-decoration: none;
    transition: opacity .15s, transform .15s;
}
.hp-cta-btn:hover { opacity: .85; transform: translateY(-2px); }

/* ── Cache bust : version générée automatiquement ─────────────────────── */

/* ══ NAV RESPONSIVE (mobile ≤ 900px) ═══════════════════════════════════════ */
@media (max-width: 900px) {

    /* Hauteur header mobile */
    .nav-inner { padding: 0 .85rem; }

    /* Hamburger visible */
    .nav-toggle { display: flex; }

    /* Sub-toggle visible (accordéon) */
    .sub-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 46px;
        background: rgba(0,0,0,.04);
        border: none;
        border-left: 1px solid var(--border);
        cursor: pointer;
        color: var(--muted);
        font-size: .95rem;
        flex-shrink: 0;
        transition: background .15s, color .15s;
        padding: 0;
    }
    .sub-toggle:hover,
    .sub-toggle[aria-expanded="true"] { background: rgba(0,0,0,.08); color: var(--primary); }

    /* ══ Tiroir coulissant (drawer) ══ */
    .nav-menu {
        /* Toujours dans le DOM, décalé hors écran par défaut */
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(290px, 82vw);
        background: #fff;
        flex-direction: column;
        padding-top: 60px; /* hauteur header */
        padding-bottom: 2rem;
        z-index: 500;
        box-shadow: 6px 0 32px rgba(0,0,0,.15);
        border-right: 1px solid var(--border);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        gap: 0;
        flex-wrap: nowrap;
        margin-left: 0;
    }
    .nav-menu.open { transform: translateX(0); }

    /* Items de premier niveau */
    .nav-menu > li {
        border-bottom: 1px solid var(--border);
        list-style: none;
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .nav-menu > li > a {
        flex: 1;
        padding: .85rem 1.25rem;
        font-size: .95rem;
        border-radius: 0;
        background: none;
    }
    .nav-menu > li.active > a {
        color: var(--primary);
        background: #eff6ff;
        border-left: 3px solid var(--primary);
        padding-left: calc(1.25rem - 3px);
    }
    /* Pas de flèche ▾ sur mobile (remplacée par le bouton sub-toggle) */
    .nav-menu > li.has-children > a::after { display: none; }

    /* Sous-menus → accordéon (fermés par défaut) */
    .nav-menu .sub-menu {
        position: static;
        display: none;
        flex-direction: column;
        flex-basis: 100%;
        width: 100%;
        border: none;
        border-top: 1px solid var(--border);
        box-shadow: none;
        border-radius: 0;
        background: #f8fafc;
        padding: 0;
        min-width: 0;
    }
    .nav-menu .sub-menu.open { display: flex; }
    .nav-menu .sub-menu li {
        border-bottom: 1px solid var(--border);
        list-style: none;
    }
    .nav-menu .sub-menu li:last-child { border-bottom: none; }
    .nav-menu .sub-menu a {
        padding: .65rem 1.25rem .65rem 2rem;
        color: var(--muted);
        font-size: .875rem;
        border-bottom: none;
    }
    .nav-menu .sub-menu a:hover { background: #e0e7ff; color: var(--primary); }

    /* Sous-menus profonds (niveau 3+) : indentation progressive */
    .nav-menu .sub-menu .sub-menu li a { padding-left: 3.25rem; }
    .nav-menu .sub-menu .sub-menu .sub-menu li a { padding-left: 4.25rem; }

    /* Flex pour les items parents au sein des sous-menus (sub-toggle aligné) */
    .nav-menu .sub-menu li.has-children {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .nav-menu .sub-menu li.has-children > a { flex: 1; }
    .nav-menu .sub-menu li.has-children > .sub-menu { flex-basis: 100%; width: 100%; }

    /* Cacher la flèche › sur mobile (remplacée par le bouton sub-toggle) */
    .sub-menu li.has-children > a::after { display: none; }

    /* ══ Hamburger à DROITE ══ */
    .hamburger-right .nav-inner { flex-direction: row-reverse; }
    .hamburger-right .site-logo { margin-right: auto; }
    .hamburger-right .nav-toggle { margin-left: .3rem; }
    .hamburger-right .nav-menu {
        left: auto;
        right: 0;
        transform: translateX(100%);
        box-shadow: -6px 0 32px rgba(0,0,0,.15);
        border-right: none;
        border-left: 1px solid var(--border);
    }
    .hamburger-right .nav-menu.open { transform: translateX(0); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   RCFlight — habillage sur-mesure « avions & drones télécommandés »
   Superposé au socle du thème par défaut : redéfinit les tokens + composants clés.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --primary:      #0E63D6;   /* azur */
    --primary-dark: #0B4FA8;
    --sky:          #38BDF8;
    --sky-soft:     #E7F2FF;
    --accent:       #FF7A18;   /* orange balise / CTA */
    --accent-dark:  #E9660A;
    --ink:          #0F1B2D;   /* titres */
    --text:         #223247;
    --muted:        #5B6B82;
    --bg:           #F4F8FF;
    --surface:      #FFFFFF;
    --border:       #E1EBF8;
    --radius:       14px;
    --radius-sm:    10px;
    --max-w:        1160px;
    --content-w:    760px;
    --shadow-sm:    0 1px 2px rgba(15,27,45,.06), 0 2px 8px rgba(15,27,45,.05);
    --shadow-md:    0 10px 30px -12px rgba(11,79,168,.28);
    --shadow-lg:    0 24px 60px -20px rgba(11,79,168,.35);
    --font-head:    'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --font-body:    system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body { font-family: var(--font-body); color: var(--text); background: var(--bg);
    background-image: radial-gradient(120% 60% at 50% -10%, #EAF3FF 0%, var(--bg) 60%); }
h1,h2,h3,h4 { font-family: var(--font-head); color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
a { color: var(--primary); text-decoration-color: color-mix(in srgb, var(--primary) 30%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }

/* Lien d'évitement accessibilité */
.skip-link { position:absolute; left:-999px; top:0; background:var(--primary); color:#fff; padding:.6rem 1rem; border-radius:0 0 8px 0; z-index:1000; }
.skip-link:focus { left:0; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav { background: rgba(255,255,255,.86); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(15,27,45,.04); }
.nav-inner { height: 68px; }
.site-logo img { max-height: 42px !important; }
.nav-menu > li > a { font-weight: 600; color: var(--ink); padding: .55rem .2rem; position: relative; }
.nav-menu > li > a::after { content:''; position:absolute; left:0; right:0; bottom:-2px; height:2px;
    background: linear-gradient(90deg, var(--sky), var(--primary)); border-radius:2px; transform: scaleX(0);
    transform-origin: left; transition: transform .22s ease; }
.nav-menu > li > a:hover::after, .nav-menu > li.active > a::after { transform: scaleX(1); }
.nav-menu > li.active > a { color: var(--primary); }

/* ── Boutons génériques ─────────────────────────────────────────────────── */
.hp-hero-cta, .hp-cta-btn, .read-more, .hp-post-read, .hp-section-cta, .btn-primary {
    font-family: var(--font-head); font-weight: 700; }
.hp-hero-cta, .btn-primary {
    display:inline-flex; align-items:center; gap:.5rem; background: var(--accent); color:#fff !important;
    padding: .9rem 1.7rem; border-radius: 999px; text-decoration:none; box-shadow: 0 10px 24px -8px rgba(255,122,24,.6);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.hp-hero-cta:hover, .btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px);
    box-shadow: 0 16px 30px -10px rgba(255,122,24,.7); color:#fff !important; }

/* ── HÉRO ────────────────────────────────────────────────────────────────── */
.hp-hero { position: relative; display:flex; align-items:center; justify-content:center; text-align:center;
    overflow:hidden; isolation:isolate; }
.hp-hero-bg { position:absolute; inset:0; background-size:cover; background-position:center; transform: scale(1.04); z-index:-2; }
.hp-hero-overlay { position:absolute !important; inset:0; z-index:-1 !important;
    background: linear-gradient(180deg, rgba(9,42,92,.62) 0%, rgba(11,79,168,.55) 45%, rgba(9,30,64,.78) 100%) !important; }
.hp-hero::after { content:''; position:absolute; inset:0; z-index:-1; pointer-events:none;
    background: radial-gradient(90% 60% at 50% 0%, rgba(56,189,248,.28), transparent 60%); }
.hp-hero-content { max-width: 860px; padding: 4.5rem 1.5rem; color:#fff; }
.hp-hero-h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); color:#fff; text-shadow: 0 2px 24px rgba(0,0,0,.35); margin-bottom: 1rem; }
.hp-hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: #EAF3FF; line-height:1.6; margin: 0 auto 1.9rem; max-width: 660px; }
.hp-hero-badge { display:inline-flex; align-items:center; gap:.5rem; font-size:.8rem; font-weight:700; letter-spacing:.08em;
    text-transform:uppercase; color:#DCEBFF; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.28);
    padding:.4rem .9rem; border-radius:999px; margin-bottom:1.4rem; }

/* ── Sections ──────────────────────────────────────────────────────────── */
.hp-section, .hp-cta { padding: 4rem 1.5rem; }
.hp-inner { max-width: var(--max-w); margin: 0 auto; }
.hp-section-hd { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom: 2rem; flex-wrap:wrap; }
.hp-section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); position:relative; padding-bottom:.6rem; }
.hp-section-title::after { content:''; position:absolute; left:0; bottom:0; width:56px; height:4px; border-radius:4px;
    background: linear-gradient(90deg, var(--sky), var(--primary)); }
.hp-section-cta { color: var(--primary); font-weight:700; text-decoration:none; white-space:nowrap; }
.hp-section-cta:hover { color: var(--primary-dark); }
.hp-section-content .hp-content-body { max-width: var(--content-w); margin:0 auto; font-size:1.06rem; color:var(--text); }

/* ── Cartes rubriques ──────────────────────────────────────────────────── */
.hp-cats-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:1.2rem; }
.hp-cat-card { position:relative; display:flex; flex-direction:column; gap:.55rem; padding:1.6rem 1.4rem;
    background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); text-decoration:none;
    color:var(--ink); box-shadow: var(--shadow-sm); overflow:hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.hp-cat-card::before { content:''; position:absolute; left:0; top:0; height:4px; width:100%;
    background: linear-gradient(90deg, var(--sky), var(--primary)); opacity:0; transition:opacity .2s; }
.hp-cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.hp-cat-card:hover::before { opacity:1; }
.hp-cat-icon { width:52px; height:52px; display:flex; align-items:center; justify-content:center; font-size:1.6rem;
    background: var(--sky-soft); border-radius: 14px; }
.hp-cat-img { border-radius:12px; overflow:hidden; aspect-ratio:16/10; }
.hp-cat-img img { width:100%; height:100%; object-fit:cover; }
.hp-cat-name { font-family:var(--font-head); font-weight:800; font-size:1.12rem; }
.hp-cat-desc { font-size:.9rem; color:var(--muted); line-height:1.55; }

/* ── Cartes articles (accueil) ─────────────────────────────────────────── */
.hp-posts-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap:1.5rem; }
.hp-post-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden;
    display:flex; flex-direction:column; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.hp-post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.hp-post-thumb { display:block; aspect-ratio:16/10; overflow:hidden; }
.hp-post-thumb img { width:100%; height:100%; object-fit:cover; transition: transform .4s ease; }
.hp-post-card:hover .hp-post-thumb img { transform: scale(1.06); }
.hp-post-body { padding:1.15rem 1.3rem 1.4rem; display:flex; flex-direction:column; gap:.6rem; flex:1; }
.hp-post-meta { display:flex; align-items:center; gap:.6rem; font-size:.78rem; color:var(--muted); }
.hp-post-cat { background:var(--sky-soft); color:var(--primary-dark) !important; font-weight:700; padding:.15rem .6rem;
    border-radius:999px; text-decoration:none; font-size:.72rem; }
.hp-post-title { font-size:1.12rem; line-height:1.35; margin:0; }
.hp-post-title a { color:var(--ink); text-decoration:none; }
.hp-post-title a:hover { color:var(--primary); }
.hp-post-excerpt { font-size:.9rem; color:var(--muted); line-height:1.55; margin:0; flex:1; }
.hp-post-read { color:var(--primary); text-decoration:none; font-size:.85rem; margin-top:auto; }
.hp-post-read:hover { color:var(--primary-dark); }

/* ── Bandeau CTA ───────────────────────────────────────────────────────── */
.hp-cta { background: linear-gradient(135deg, var(--primary), #0A3E86) !important; border-radius:0; position:relative; overflow:hidden; }
.hp-cta::before { content:''; position:absolute; inset:0; background: radial-gradient(70% 120% at 80% -20%, rgba(56,189,248,.4), transparent 55%); }
.hp-cta-inner { position:relative; text-align:center; max-width:720px; }
.hp-cta-title { color:#fff; font-size: clamp(1.5rem,3vw,2rem); }
.hp-cta-text { color:#DCEBFF; }
.hp-cta-btn { background:#fff !important; color:var(--primary-dark) !important; border:none !important; border-radius:999px !important;
    padding:.85rem 1.7rem !important; font-weight:800; box-shadow: 0 10px 26px -10px rgba(0,0,0,.5); }
.hp-cta-btn:hover { transform: translateY(-2px); }

/* ── En-tête de page / catégorie ───────────────────────────────────────── */
main#main, #main.with-sidebar { max-width: var(--max-w); margin: 0 auto; padding: 2.4rem 1.5rem 3.5rem; }
.page-header h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.cat-description { color:var(--muted); font-size:1.05rem; max-width:var(--content-w); }
.category-page > .page-header { border-bottom:1px solid var(--border); padding-bottom:1.2rem; margin-bottom:1.6rem; }

/* ── Article ───────────────────────────────────────────────────────────── */
.single-post { max-width: var(--content-w); margin: 0 auto; }
.single-post .post-header h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom:.4rem; }
.post-featured-image { box-shadow: var(--shadow-md); }
.post-body { font-size: 1.07rem; color: var(--text); }
.post-body p { margin: 0 0 1.15rem; }
.post-body h2 { font-size: 1.6rem; margin: 2.2rem 0 .9rem; padding-top:.4rem; }
.post-body h2::before { content:''; display:block; width:44px; height:4px; border-radius:4px; margin-bottom:.7rem;
    background: linear-gradient(90deg, var(--sky), var(--primary)); }
.post-body h3 { font-size: 1.22rem; color: var(--primary-dark); margin: 1.6rem 0 .6rem; }
.post-body ul, .post-body ol { margin: 0 0 1.2rem 1.3rem; }
.post-body li { margin: .35rem 0; }
.post-body strong { color: var(--ink); }
.post-body a { font-weight:600; }
.post-body blockquote { margin:1.4rem 0; padding:.9rem 1.3rem; border-left:4px solid var(--sky); background:var(--sky-soft);
    border-radius:0 10px 10px 0; color:var(--ink); }
/* ── Figures illustrées dans le contenu de l'accueil ─────────────────────── */
.hp-content-fig { margin:1.8rem 0; }
.hp-content-fig img {
    display:block; width:100%; height:auto; border-radius:16px;
    box-shadow:0 14px 40px -18px rgba(11,79,168,.45);
}

/* ── Tableaux de contenu (articles, catégories, accueil) ─────────────────── */
.post-body table,
.cat-content table,
.hp-content-body table {
    width:100%; border-collapse:separate; border-spacing:0; margin:1.9rem 0;
    font-size:.95rem; line-height:1.5; background:#fff;
    border:1px solid var(--border); border-radius:14px; overflow:hidden;
    box-shadow:0 6px 22px -12px rgba(11,79,168,.28);
}
.post-body thead,
.cat-content thead,
.hp-content-body thead {
    background:linear-gradient(135deg, var(--primary,#0B4FA8), var(--primary-dark,#083b7d));
}
.post-body th,
.cat-content th,
.hp-content-body th {
    color:#fff; text-align:left; padding:.85rem 1.1rem;
    font-family:var(--font-head,sans-serif); font-weight:700; letter-spacing:-.01em;
    font-size:.9rem; text-transform:uppercase; letter-spacing:.03em;
    border-bottom:none;
}
.post-body td,
.cat-content td,
.hp-content-body td {
    padding:.8rem 1.1rem; border-top:1px solid var(--border,#e6edf5); vertical-align:top;
}
.post-body tbody tr:nth-child(even) td,
.cat-content tbody tr:nth-child(even) td,
.hp-content-body tbody tr:nth-child(even) td { background:#F5F9FF; }
.post-body tbody tr:hover td,
.cat-content tbody tr:hover td,
.hp-content-body tbody tr:hover td { background:var(--sky-soft,#eaf3ff); }
.post-body tbody td:first-child,
.cat-content tbody td:first-child,
.hp-content-body tbody td:first-child { font-weight:600; color:var(--primary-dark,#083b7d); }
/* Défilement horizontal propre sur mobile si le tableau est large */
@media (max-width:560px){
    .post-body table, .cat-content table, .hp-content-body table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
}
.post-meta .cat-link { background:var(--sky-soft); color:var(--primary-dark); padding:.15rem .6rem; border-radius:999px; text-decoration:none; }

/* ── Cartes catégorie (grille) ─────────────────────────────────────────── */
.post-card, .post-list-has-thumb { border-radius: var(--radius); }
.post-card { box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.read-more { display:inline-block; color:var(--primary); font-weight:700; text-decoration:none; }
.read-more:hover { color:var(--primary-dark); }

/* ── Pied de page ──────────────────────────────────────────────────────── */
.site-footer { background: linear-gradient(180deg,#0F1B2D,#0A1626); color:#C7D6EA; margin-top:3rem; }
.footer-inner { max-width: var(--max-w); margin:0 auto; padding: 3rem 1.5rem 1.4rem; }
.footer-grid { display:grid; grid-template-columns: 1.8fr 1fr; gap:2rem; }
@media(max-width:720px){ .footer-grid{ grid-template-columns:1fr; gap:1.6rem; } }
.footer-brand img { height:44px; margin-bottom:.8rem; }
.footer-tagline { color:#9FB4CF; font-size:.92rem; line-height:1.6; max-width:34ch; }
.footer-col h3 { color:#fff; font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; margin-bottom:.9rem; }
.footer-col ul { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:.55rem; }
.footer-col a { color:#C7D6EA; text-decoration:none; font-size:.92rem; }
.footer-col a:hover { color:var(--sky); }
.footer-bottom { border-top:1px solid rgba(255,255,255,.1); margin-top:2.2rem; padding-top:1.2rem; font-size:.82rem; color:#8DA3C0;
    display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.footer-bottom a { color:#8DA3C0; }
.footer-bottom a:hover { color:var(--sky); }

/* ── Fil d'Ariane ──────────────────────────────────────────────────────── */
.breadcrumb, nav.breadcrumbs { font-size:.82rem; color:var(--muted); }

/* ── 404 ───────────────────────────────────────────────────────────────── */
.error-404, .page-404 { text-align:center; }

/* ── Divers responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px){ .hp-section, .hp-cta { padding: 2.6rem 1.1rem; } .hp-hero-content{ padding:3.2rem 1.1rem; } }

/* ═══ Effets & animations (JS-driven, CSP-safe) ═══════════════════════════ */
@media (prefers-reduced-motion: no-preference){
  .rc-reveal { opacity:0; transform: translateY(26px); }
  .rc-reveal.in { opacity:1; transform:none; transition: opacity .7s cubic-bezier(.16,.8,.28,1), transform .7s cubic-bezier(.16,.8,.28,1); }
}
.site-nav { transition: box-shadow .25s ease, background .25s ease; }
.site-nav.rc-scrolled { box-shadow: 0 6px 24px -10px rgba(11,79,168,.35); background: rgba(255,255,255,.94); }

/* Héro : ciel vivant */
.hp-hero { --rc-par: 0px; }
.hp-hero-bg { will-change: transform; transform: translate3d(0, var(--rc-par), 0) scale(1.08); }
.rc-clouds { position:absolute; inset:0; z-index:-1; overflow:hidden; pointer-events:none; }
.rc-cloud { position:absolute; background:rgba(255,255,255,.16); filter: blur(6px); border-radius:50%; }
.rc-cloud.c1 { width:220px; height:70px; top:22%; left:-260px; animation: rc-drift 34s linear infinite; }
.rc-cloud.c2 { width:150px; height:52px; top:58%; left:-200px; animation: rc-drift 26s linear infinite 6s; opacity:.7; }
.rc-cloud.c3 { width:300px; height:88px; top:38%; left:-360px; animation: rc-drift 46s linear infinite 12s; opacity:.5; }
@keyframes rc-drift { to { transform: translateX(140vw); } }
/* Avion en papier qui traverse */
.rc-fly { position:absolute; top:26%; left:-70px; z-index:-1; width:46px; height:46px; opacity:.9;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); animation: rc-fly 15s ease-in-out infinite; }
@keyframes rc-fly {
  0%   { transform: translate(-8vw, 40px) rotate(-6deg); opacity:0; }
  8%   { opacity:.95; }
  50%  { transform: translate(55vw, -30px) rotate(-14deg); }
  92%  { opacity:.95; }
  100% { transform: translate(118vw, -70px) rotate(-8deg); opacity:0; }
}
@media (prefers-reduced-motion: reduce){ .rc-cloud,.rc-fly{ animation:none; display:none; } }

/* Petit halo animé sur le badge rubrique au survol */
.hp-cat-card .hp-cat-icon { transition: transform .25s ease; }
.hp-cat-card:hover .hp-cat-icon { transform: translateY(-3px) rotate(-6deg) scale(1.06); }

/* Bouton héro : pulsation douce d'invitation */
@media (prefers-reduced-motion: no-preference){
  .hp-hero-cta { animation: rc-pulse 3.4s ease-in-out infinite; }
  @keyframes rc-pulse { 0%,100%{ box-shadow:0 10px 24px -8px rgba(255,122,24,.6);} 50%{ box-shadow:0 14px 30px -6px rgba(255,122,24,.85);} }
}

/* ═══ Sécurité anti-débordement horizontal + ajustements mobile ═══════════ */
html, body { overflow-x: hidden; max-width: 100%; }
.hp-hero-content, .hp-inner, .single-post { max-width: 100%; }
@media (max-width: 600px){
  .hp-hero-h1 { font-size: clamp(1.55rem, 7.5vw, 2.05rem); line-height: 1.15; }
  .hp-hero-sub { font-size: 1rem; }
  .hp-hero-content { padding: 3rem 1.1rem; }
  main#main { padding: 1.6rem 1.1rem; }
  .single-post .post-header h1, .page-header h1 { font-size: 1.65rem; }
  .post-body { font-size: 1rem; }
  .footer-bottom { flex-direction: column; gap:.4rem; }
}

/* ═══ Mini-jeu aviation (canvas) ══════════════════════════════════════════ */
.hp-game-section .hp-section-hd { margin-bottom: 1.4rem; }
.hp-game-hint { font-size: .85rem; color: var(--muted); font-weight:600; }
.hp-game-wrap { position: relative; max-width: 900px; margin: 0 auto; border-radius: 18px; overflow: hidden;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
#rcGame { width: 100%; height: auto; display: block; background: #93d4ff; touch-action: none; cursor: pointer; }
.rc-game-hud { position: absolute; top: .7rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between;
    align-items: center; font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 1.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.4); pointer-events: none; }
.rc-game-best { font-size: .78rem; font-weight: 700; background: rgba(9,27,45,.35); padding: .25rem .7rem;
    border-radius: 999px; letter-spacing:.02em; }
.rc-game-best b { color: #7fe0ff; }
.rc-game-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: linear-gradient(180deg, rgba(9,42,92,.30), rgba(9,42,92,.5)); backdrop-filter: blur(2px);
    transition: opacity .3s ease; }
.rc-game-overlay.hidden { opacity: 0; pointer-events: none; }
.rc-game-card { background: rgba(255,255,255,.96); border-radius: 18px; padding: 1.7rem 1.9rem; text-align: center;
    max-width: 430px; box-shadow: var(--shadow-lg); }
.rc-game-title { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--ink); margin-bottom: .5rem; }
.rc-game-sub { font-size: .92rem; color: var(--muted); line-height: 1.55; margin-bottom: 1.2rem; }
.rc-game-btn { background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: .85rem 2rem;
    font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; cursor: pointer;
    box-shadow: 0 10px 24px -8px rgba(255,122,24,.6); transition: transform .15s ease, background .15s ease; }
.rc-game-btn:hover { background: var(--accent-dark); transform: translateY(-2px); }
@media (max-width:600px){ .rc-game-hud{ font-size:1.15rem; } .rc-game-card{ padding:1.3rem 1.2rem; } .rc-game-sub{ font-size:.86rem; } }
