/* ══════════════════════════════════════════════════════
   MOBILE.CSS — ElyseeScope
   Partagé entre toutes les pages.
   1. Barre de navigation fixe en bas (mobile uniquement)
   2. Scroll horizontal pour les sections de cartes
   3. Corrections de débordement général
   ══════════════════════════════════════════════════════ */

/* ────────────────────────────────────────
   BASE : fond de réserve pour la barre basse
   ──────────────────────────────────────── */
.mobile-bottom-nav {
    display: none; /* caché sur desktop */
}

/* Burger menu : caché sur desktop */
.burger-menu-btn {
    display: none;
}
.burger-overlay {
    display: none;
}
.burger-drawer {
    display: none;
}

@media (max-width: 768px) {

    /* Espace pour que le contenu ne passe pas sous la barre */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* ── Mobile search bar (full-width below header on mobile) ── */
    .gs-mobile-bar {
        display: flex;
        flex: 1;
        align-items: center;
    }

    /* ── Hamburger & sidebar (ancien système) supprimés sur mobile ── */
    .hamburger {
        display: none !important;
    }
    .sidebar {
        display: none !important;
    }
    .sidebar-overlay {
        display: none !important;
    }

    /* ══════════════════════════════════════════════════════
       BURGER MENU — nouveau système (toutes pages intérieures)
       Bouton ☰ dans le header, drawer plein écran opaque.
       z-index : overlay 9998, drawer 9999 (au-dessus de tout)
       ══════════════════════════════════════════════════════ */

    /* ── Bouton burger dans le header ── */
    .burger-menu-btn {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.45rem;
        margin-left: auto;
        gap: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .burger-menu-btn span {
        display: block;
        width: 20px;
        height: 2px;
        background: #111827;
        margin: 3px 0;
        border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
    }

    /* ── Overlay semi-transparent (fond) ── */
    .burger-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 9998;
        -webkit-tap-highlight-color: transparent;
    }
    .burger-overlay.visible {
        display: block;
    }

    /* ── Drawer (panneau de navigation) ── */
    .burger-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 82vw;
        max-width: 320px;
        background: #0f1b2d;
        color: #fff;
        z-index: 9999;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
    }
    .burger-drawer.open {
        transform: translateX(0);
    }

    /* ── Header du drawer ── */
    .burger-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
    }
    .burger-drawer-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 700;
        font-size: 1.05rem;
        color: #fff;
        text-decoration: none;
    }
    .burger-drawer-logo-icon {
        width: 28px;
        height: 28px;
        background: linear-gradient(135deg, #2563eb, #1e40af);
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .burger-close-btn {
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        font-size: 1.3rem;
        cursor: pointer;
        padding: 0.35rem;
        border-radius: 6px;
        transition: color 0.15s, background 0.15s;
        -webkit-tap-highlight-color: transparent;
        line-height: 1;
    }
    .burger-close-btn:active {
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
    }

    /* ── Navigation links ── */
    .burger-drawer-nav {
        flex: 1;
        padding: 0.75rem 0;
        overflow-y: auto;
    }
    .burger-nav-section {
        padding: 0.25rem 1.25rem;
    }
    .burger-nav-label {
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: rgba(255, 255, 255, 0.4);
        padding: 0.5rem 0 0.35rem;
    }
    .burger-nav-link {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.65rem 0.5rem;
        color: rgba(255, 255, 255, 0.85);
        text-decoration: none;
        font-size: 0.92rem;
        font-weight: 500;
        border-radius: 8px;
        transition: background 0.15s, color 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    .burger-nav-link:active {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }
    .burger-nav-icon {
        font-size: 1.05rem;
        flex-shrink: 0;
        width: 1.4rem;
        text-align: center;
    }
    .burger-nav-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.08);
        margin: 0.35rem 1.25rem;
    }

    /* ── Footer du drawer ── */
    .burger-drawer-footer {
        padding: 1rem 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.35);
        text-align: center;
        flex-shrink: 0;
    }

    /* ── Main content : pleine largeur quand sidebar cachée ── */
    .main-content {
        margin-left: 0 !important;
    }
    .site-footer {
        margin-left: 0 !important;
    }

    /* ── Liens de nav cachés (bottom nav prend le relais) ── */
    .nav-links {
        display: none !important;
    }
    .nav-cta {
        display: none !important;
    }
    /* index.html / gazette.html : actions de nav */
    .nav-actions .nav-link,
    .nav-actions .nav-cta,
    .nav-actions .nav-tag {
        display: none !important;
    }
    .nav-actions {
        flex: 0 !important;
        padding: 0 !important;
        min-width: 0 !important;
    }

    /* ── Hide desktop search button on mobile ── */
    .gs-btn {
        display: none !important;
    }

    /* ── Barre de navigation du bas ── */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(245, 244, 240, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid #dddbd6;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.07);
        z-index: 500;
        align-items: stretch;
    }

}

/* ── Styles des items (actifs même sur desktop pour éviter le FOUC) ── */
.mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #6b7280;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: color 0.15s;
    padding: 6px 2px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.mbn-item:active {
    background: rgba(0, 0, 0, 0.04);
}
.mbn-item.active {
    color: #2563eb;
}
.mbn-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2.5px;
    background: #2563eb;
    border-radius: 0 0 3px 3px;
}
.mbn-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.mbn-item.active .mbn-icon {
    transform: scale(1.08);
}
.mbn-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}
.mbn-item.active .mbn-icon svg {
    stroke-width: 2.2;
}
.mbn-label {
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════════
   BARRE NEWSLETTER STICKY — Mobile uniquement
   Positionnée juste au-dessus de la bottom nav.
   ══════════════════════════════════════════════════════ */

.newsletter-sticky-bar {
    display: none; /* caché sur desktop */
}

@media (max-width: 768px) {

    /* Quand la barre est active, on décale le padding du body */
    body.nsb-active {
        padding-bottom: calc(64px + 54px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .newsletter-sticky-bar {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 2px solid #2563eb;
        box-shadow: 0 -4px 18px rgba(37, 99, 235, 0.14);
        z-index: 490;
        padding: 0.52rem 0.85rem 0.48rem;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.28s ease;
    }

    .newsletter-sticky-bar.nsb-hidden {
        transform: translateY(calc(100% + 4px));
        opacity: 0;
        pointer-events: none;
    }

    .nsb-inner {
        display: flex;
        align-items: center;
        gap: 0.42rem;
    }

    .nsb-emoji {
        font-size: 1rem;
        flex-shrink: 0;
        line-height: 1;
    }

    .nsb-input {
        flex: 1;
        min-width: 0;
        padding: 0.44rem 0.7rem;
        border: 1.5px solid #dddbd6;
        border-radius: 8px;
        font-size: 0.82rem;
        font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
        background: #fff;
        color: #111827;
        outline: none;
        transition: border-color 0.15s;
    }
    .nsb-input:focus {
        border-color: #2563eb;
    }
    .nsb-input::placeholder {
        color: #9ca3af;
    }

    .nsb-btn {
        flex-shrink: 0;
        padding: 0.44rem 0.9rem;
        background: #2563eb;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 0.82rem;
        font-weight: 600;
        font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
        cursor: pointer;
        white-space: nowrap;
        transition: background 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    .nsb-btn:active {
        background: #1d4ed8;
    }

    .nsb-close {
        flex-shrink: 0;
        width: 28px;
        height: 28px;
        background: none;
        border: none;
        color: #9ca3af;
        font-size: 1.05rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s;
    }
    .nsb-close:active {
        color: #6b7280;
    }

    .nsb-msg {
        font-size: 0.76rem;
        margin-top: 0.28rem;
        padding: 0.22rem 0.55rem;
        border-radius: 5px;
        display: none;
        font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    }

}

/* ══════════════════════════════════════════════════════
   SECTION PILLS NAV — Homepage mobile uniquement
   Barre de pills scrollable sticky sous le header.
   z-index : 140 (sous search bar 150, sous top-nav 200)
   ══════════════════════════════════════════════════════ */

#section-pills-nav {
    display: none; /* caché par défaut (desktop) */
}

@media (max-width: 768px) {
    #section-pills-nav {
        display: flex;
        position: fixed;
        top: 56px; /* juste sous le header */
        left: 0;
        right: 0;
        height: 40px;
        z-index: 140;
        background: rgba(245, 244, 240, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid #dddbd6;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        align-items: center;
        padding: 0 0.75rem;
        gap: 0.4rem;
    }
    #section-pills-nav::-webkit-scrollbar {
        display: none;
    }
    /* Décalage du layout pour la homepage (tient compte de la pill nav) */
    body[data-page="index"] .layout {
        padding-top: calc(var(--nav-h) + 40px) !important;
    }
}

@media (max-width: 600px) {
    /* Sur ≤600px : se place sous la barre de recherche mobile */
    #section-pills-nav {
        top: calc(56px + 44px + 1.5rem);
    }
}

/* ── Pills — styles actifs même sur desktop pour éviter le FOUC ── */
.spn-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.28rem 0.65rem;
    border-radius: 20px;
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    color: #4b5563;
    text-decoration: none;
    background: #eae8e3;
    border: 1.5px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    gap: 0.25rem;
    line-height: 1;
}
.spn-pill:active {
    background: rgba(30, 58, 95, 0.12);
}
.spn-pill.spn-active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

/* ══════════════════════════════════════════════════════
   SCROLL HORIZONTAL POUR LES SECTIONS DE CARTES
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ─ Mixin utilitaire horizontal-scroll ─
       Appliqué via .hscroll ou directement sur les sélecteurs ci-dessous */
    .hscroll,
    .preview-grid,
    #homethemesGrid,
    .themes-grid,
    .actu-grid,
    .section-grid,
    .editions-grid {
        display: flex !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        gap: 0.85rem !important;
        padding-bottom: 1rem !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        margin-left: -1.25rem !important;
        margin-right: -1.25rem !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Réinitialise les propriétés de grille */
        grid-template-columns: unset !important;
    }

    .hscroll::-webkit-scrollbar,
    .preview-grid::-webkit-scrollbar,
    #homethemesGrid::-webkit-scrollbar,
    .themes-grid::-webkit-scrollbar,
    .actu-grid::-webkit-scrollbar,
    .section-grid::-webkit-scrollbar,
    .editions-grid::-webkit-scrollbar {
        display: none;
    }

    /* Taille des cartes dans les conteneurs scrollables */
    .preview-grid > *,
    .section-grid > *,
    .actu-grid > *,
    .editions-grid > *,
    .hscroll > * {
        flex: 0 0 264px !important;
        min-width: 0;
        scroll-snap-align: start;
    }

    #homethemesGrid > * {
        flex: 0 0 150px !important;
        min-height: 90px;
        scroll-snap-align: start;
    }

    .themes-grid > * {
        flex: 0 0 160px !important;
        min-width: 0;
        scroll-snap-align: start;
    }

    /* ─ Stats grid : garde 2×2 ─ */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        overflow-x: hidden;
    }

    /* ─ Pilier grid : 1 colonne ─ */
    .pillar-grid {
        grid-template-columns: 1fr !important;
    }

    /* ─ Sections intérieures : pas de débordement ─ */
    .content-section {
        overflow-x: hidden;
    }

    /* ─ Tableaux : scroll horizontal dans le wrapper ─ */
    .comp-table-outer {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* index.html : section accueil padding réduit */
    #accueil {
        min-height: auto;
        padding: 2.5rem 1.25rem 2rem !important;
    }

    /* padding général des sections sur mobile */
    .content-section {
        padding: 2.5rem 1.25rem !important;
    }

    /* ─ Filtres : scroll horizontal si trop longs ─ */
    .filters {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .filters::-webkit-scrollbar { display: none; }
    .filters .filter-btn {
        flex-shrink: 0;
    }

    /* ─ Barre de filtres top-actu ─ */
    .filters-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .filters-bar::-webkit-scrollbar { display: none; }

    /* ══════════════════════════════════════════════════════
       CAROUSEL ACTUS — pleine largeur, une carte à la fois
       ══════════════════════════════════════════════════════ */

    /* actu-grid (6 Top Actu homepage) — override 264px → 100% */
    .actu-grid {
        gap: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-bottom: 0 !important;
    }
    .actu-grid > * {
        flex: 0 0 100% !important;
        width: 100% !important;
        scroll-snap-align: center;
        border-radius: 14px;
    }

    /* actu-fil-list (9 articles fil homepage) — transform en carousel horizontal */
    .actu-fil-list {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        gap: 0 !important;
    }
    .actu-fil-list::-webkit-scrollbar { display: none; }
    .actu-fil-list > .actu-fil-item,
    .actu-fil-list > .actu-fil-skel {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 0;
        scroll-snap-align: center;
        border: 1px solid var(--border) !important;
        border-radius: 14px !important;
        border-bottom: 1px solid var(--border) !important;
    }

    /* articlesList (top-actu page) — carousel horizontal */
    #articlesList {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0 !important;
    }
    #articlesList::-webkit-scrollbar { display: none; }
    #articlesList > .article-card {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 0;
        scroll-snap-align: center;
        margin-bottom: 0 !important;
        /* Restore card look for mobile carousel */
        background: var(--card, #fff) !important;
        border: 1px solid var(--border) !important;
        border-bottom: 1px solid var(--border) !important;
        border-radius: 14px !important;
        padding: 1rem 1.125rem !important;
        box-shadow: var(--shadow, 0 1px 4px rgba(0,0,0,0.06)) !important;
    }

    /* ── Navigation du carousel ─────────────────────────── */
    .cmb-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.65rem;
        margin-top: 0.75rem;
        padding: 0 0.25rem;
    }
    .cmb-btn {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        border: 1.5px solid var(--border, #dddbd6);
        background: var(--card, #fff);
        color: var(--text, #111827);
        font-size: 1.3rem;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s, opacity 0.15s;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }
    .cmb-btn:active { background: var(--deep, #eae8e3); }
    .cmb-btn:disabled { opacity: 0.3; cursor: default; }
    .cmb-indicator {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    .cmb-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--border, #dddbd6);
        transition: background 0.2s, transform 0.2s;
        cursor: pointer;
        flex-shrink: 0;
    }
    .cmb-dot.active {
        background: var(--blue, #2563eb);
        transform: scale(1.45);
    }
    .cmb-counter {
        font-size: 0.82rem;
        color: var(--muted, #6b7280);
        font-weight: 500;
        font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    }
    .cmb-sep {
        margin: 0 2px;
        opacity: 0.5;
    }

    /* ══════════════════════════════════════════════════════
       TOP 5 LIST (top-actu) — carousel pleine largeur
       ══════════════════════════════════════════════════════ */

    #top5List {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0 !important;
        /* Annuler le flex-direction column du desktop */
        flex-wrap: nowrap !important;
    }
    #top5List::-webkit-scrollbar { display: none; }
    #top5List > .top5-item {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 0;
        scroll-snap-align: center;
        border-bottom: none !important;
        border: 1px solid var(--border, #dddbd6) !important;
        border-radius: 14px !important;
        padding: 1.35rem 1.15rem !important;
        background: var(--card, #fff) !important;
        box-shadow: var(--shadow, 0 1px 4px rgba(0,0,0,0.06)) !important;
        margin-bottom: 0 !important;
    }

    /* ══════════════════════════════════════════════════════
       SONDAGES R2 DUELS (top-actu) — carousel horizontal
       ══════════════════════════════════════════════════════ */

    .sondages-r2-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.75rem !important;
        padding-bottom: 0.5rem !important;
        /* Annuler la grille desktop */
        grid-template-columns: unset !important;
        flex-wrap: nowrap !important;
    }
    .sondages-r2-grid::-webkit-scrollbar { display: none; }
    .sondages-r2-grid > .duel-card {
        flex: 0 0 82% !important;
        min-width: 0;
        scroll-snap-align: start;
    }

    /* ══════════════════════════════════════════════════════
       SOND DUELS GRID (homepage) — carousel horizontal
       ══════════════════════════════════════════════════════ */

    .sond-duels-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.85rem !important;
        padding-bottom: 0.5rem !important;
        margin-left: -1.25rem !important;
        margin-right: -1.25rem !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        grid-template-columns: unset !important;
        flex-wrap: nowrap !important;
    }
    .sond-duels-grid::-webkit-scrollbar { display: none; }
    .sond-duels-grid > .sond-duel-card {
        flex: 0 0 82% !important;
        min-width: 0;
        scroll-snap-align: start;
    }

}


/* ══════════════════════════════════════════════════════
   REPASSE UX/UI MOBILE — Corrections globales
   Touch targets, typographie, espacement, cohérence
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── 1. TOUCH TARGETS — minimum 44px pour éléments interactifs ── */

    /* Boutons de filtre (candidats, top-actu, etc.) */
    .filter-btn,
    .theme-filter-btn {
        min-height: 40px;
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }

    /* Bouton burger close — agrandir zone tap */
    .burger-close-btn {
        padding: 0.55rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Bouton burger menu — agrandir zone tap */
    .burger-menu-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }

    /* Liens de navigation burger — hauteur min */
    .burger-nav-link {
        min-height: 44px;
        padding: 0.7rem 0.5rem;
    }

    /* Carousel nav buttons — agrandir */
    .cmb-btn {
        width: 40px;
        height: 40px;
    }

    /* Boutons compare / CTA dans les fiches candidats */
    .compare-cta,
    .compare-btn {
        padding: 0.5rem 0.9rem;
        min-height: 40px;
    }

    /* Newsletter sticky bar — inputs et boutons */
    .nsb-input {
        min-height: 44px;
        padding: 0.55rem 0.75rem;
        font-size: 0.88rem;
    }
    .nsb-btn {
        min-height: 44px;
        padding: 0.55rem 1rem;
        font-size: 0.88rem;
    }
    .nsb-close {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    /* Sélecteurs (comparer, etc.) */
    .selector-select,
    .comp-select {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Section pills — agrandir pour tactile */
    .spn-pill {
        padding: 0.4rem 0.75rem;
        font-size: 0.78rem;
        min-height: 36px;
    }

    /* Anchor pills (nav.css) */
    .es-anchor-pill {
        padding: 0.35rem 0.75rem;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    /* ── 2. TYPOGRAPHIE — plancher 0.72rem pour lisibilité ── */

    /* Micro-texte : badges, tags, métadonnées */
    .sond-tableau-header,
    .poll-meta-info,
    .sondage-duel-src,
    .sond-duel-src,
    .sondage-duel-cparti,
    .sond-duel-cparti,
    .tendance-badge,
    .parti-badge,
    .soutien-pill,
    .soutien-more,
    .badge-signatures-ok,
    .badge-signatures-non,
    .badge-primaire-oui,
    .badge-primaire-non {
        font-size: 0.72rem;
    }

    /* Labels et section labels */
    .burger-nav-label {
        font-size: 0.72rem;
    }

    /* Titres de sections — clamp pour mobile */
    .section-title {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
        line-height: 1.3;
    }

    /* Sous-titres */
    .section-desc,
    .section-subtitle {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* ── 3. ESPACEMENT — padding cohérent sur mobile ── */

    /* Wrapper et page-header — alignement avec nouveau nav system
       --nav-h = 98px (sans ancres) ou 138px (avec ancres)
       On utilise padding-top via var pour cohérence */
    .wrapper {
        padding-top: calc(var(--nav-h, 98px) + 0.75rem);
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .page-header {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Sections : padding latéral uniforme */
    .search-bar-wrap,
    .sections-wrap {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Cards — padding adapté mobile */
    .candidate-card,
    .skeleton-card {
        padding: 1.25rem;
    }

    /* Footer */
    .site-footer,
    footer {
        padding: 1.5rem 1.25rem;
        margin-left: 0 !important;
    }

    /* ── 4. GRILLES — passage 1 colonne si pas carousel ── */

    /* Grilles de sélection (comparer) — 1 col sur mobile */
    .selectors-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    /* Header de comparaison — empiler verticalement */
    .comp-header-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    /* Grilles de statistiques indicator (france-en-chiffres) */
    .indicator-grid,
    .indicators-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    /* ── 5. IMAGES — contraindre au conteneur ── */

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

    /* Avatars — taille adaptée mobile */
    .avatar-lg {
        width: 76px;
        height: 76px;
        font-size: 1.5rem;
    }

    /* ── 6. TABLEAUX — scroll horizontal avec momentum ── */

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    table::-webkit-scrollbar {
        display: none;
    }

    /* ── 7. FORMULAIRES — inputs lisibles et tappables ── */

    input[type="text"],
    input[type="email"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Empêche le zoom iOS sur focus */
    }

    /* Champ de recherche candidats / global */
    .search-input {
        min-height: 44px;
        padding: 0.6rem 1rem 0.6rem 2.8rem;
        font-size: 0.9rem;
    }

    /* ── 8. SCROLL — pas de scroll horizontal indésirable ── */

    html {
        overflow-x: hidden;
    }

    /* FAQ : accordéon lisible */
    .faq-question,
    .faq-toggle {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 0.92rem;
    }
    .faq-answer {
        padding: 0.75rem 1rem 1rem;
        font-size: 0.88rem;
        line-height: 1.65;
    }

    /* ── 9. BOTTOM NAV LABEL — légèrement plus lisible ── */

    .es-bn-label {
        font-size: 0.62rem;
    }

    .mbn-label {
        font-size: 0.7rem;
    }

}

/* ── PETIT MOBILE (≤480px) — ajustements supplémentaires ── */
@media (max-width: 480px) {

    /* Padding latéral réduit */
    .wrapper,
    .page-header,
    .search-bar-wrap,
    .sections-wrap {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .content-section {
        padding: 2rem 1rem !important;
    }

    /* Cards plus compactes */
    .candidate-card,
    .skeleton-card {
        padding: 1rem;
    }

    /* Titres */
    .section-title {
        font-size: clamp(1.15rem, 5vw, 1.5rem);
    }

    /* Hero homepage */
    #accueil {
        padding: 2rem 1rem 1.5rem !important;
    }

    /* Filtres — encore plus compact */
    .filter-btn,
    .theme-filter-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.82rem;
    }

    /* Stats grid — empiler sur très petit écran */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}
