/* =================================================================
   RESPONSIVE.CSS — Commune de Louga
   Mobile-first · Breakpoints : 1024 | 900 | 768 | 600 | 480 | 360
   ================================================================= */

/* ═══════════════════════════════════════════════════════════════
   MOBILE NAV DRAWER
   ═══════════════════════════════════════════════════════════════ */

/* Overlay semi-transparent */
.mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 1998;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    cursor: pointer;
}
.mob-overlay.is-open { display: block; }

/* Drawer */
.mob-nav {
    position: fixed;
    top: 0; left: -100%;
    width: min(320px, 90vw);
    height: 100vh;
    height: 100dvh; /* dynamic viewport height */
    background: #fff;
    z-index: 1999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: left .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 6px 0 40px rgba(0,0,0,.28);
}
.mob-nav.is-open { left: 0; }

/* Drawer — header */
.mob-nav-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    background: var(--black);
    border-bottom: 3px solid var(--gold);
    flex-shrink: 0;
}
.mob-nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.mob-nav-logo img {
    height: 34px; width: auto;
}
.mob-nav-logo span {
    font-family: 'Cinzel', serif;
    font-size: .8rem; font-weight: 700;
    color: var(--gold);
    letter-spacing: .8px;
    line-height: 1.3;
}
.mob-close-btn {
    background: none; border: none;
    color: rgba(255,255,255,.7);
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.mob-close-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Drawer — scrollable body */
.mob-nav-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Links */
.mob-nav-list { list-style: none; padding: 6px 0; margin: 0; }
.mob-item { border-bottom: 1px solid #f0ece3; }

.mob-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    font-size: .875rem; font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase;
    color: var(--black); text-decoration: none;
    transition: background .15s, color .15s;
    min-height: 48px; /* 48px minimum touch target */
}
.mob-link:hover, .mob-link.active { background: #fdf8ec; color: var(--gold-dark); }
.mob-item.mn-open > .mob-link { background: #fdf8ec; color: var(--gold-dark); }

.mob-link-chevron {
    font-size: .6rem; color: #9ca3af;
    transition: transform .25s; flex-shrink: 0;
}
.mob-item.mn-open .mob-link-chevron { transform: rotate(180deg); }

/* Sub-menus (accordion) */
.mob-sub { display: none; background: #fcfbf8; border-top: 1px solid #f0ece3; padding: 4px 0; }
/* Visibilité des sous-menus gérée uniquement par jQuery slideDown/slideUp — pas de règle CSS display ici */

.mob-sub-link {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px 12px 38px;
    font-size: .83rem; font-weight: 500;
    color: #374151; text-decoration: none;
    transition: background .15s, color .15s;
    min-height: 44px;
}
.mob-sub-link i { color: var(--gold); width: 16px; font-size: .76rem; flex-shrink: 0; }
.mob-sub-link:hover { background: #fdf8ec; color: var(--gold-dark); }
.mob-sub-link + .mob-sub-link { border-top: 1px solid #f0ece3; }

/* Drawer — footer contact strip */
.mob-nav-ft {
    padding: 14px 20px;
    background: #fdf8ec;
    border-top: 2px solid var(--gold);
    flex-shrink: 0;
}
.mob-nav-ft p {
    display: flex; align-items: center; gap: 8px;
    font-size: .78rem; color: #6b7280; margin-bottom: 7px;
}
.mob-nav-ft p:last-child { margin-bottom: 0; }
.mob-nav-ft i { color: var(--gold); font-size: .78rem; width: 14px; flex-shrink: 0; }
.mob-nav-ft a { color: var(--black); font-weight: 600; }


/* ═══════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .top-bar { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════
   HEADER / NAV
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .nav-left, .nav-right { display: none !important; }
    .mobile-toggle { display: flex !important; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; min-width: 44px; padding: 10px 12px !important; }
    .nav-container {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
    }
    .logo-area {
        flex: 1;
        display: flex !important;
        justify-content: flex-start;
        padding-left: 6px;
    }
    .logo-img { height: 44px; }
}
@media (max-width: 480px) {
    .logo-img { height: 38px; }
    .logo-louga { font-size: 1.15rem; }
    .logo-commune { font-size: .55rem; letter-spacing: 3px; }
}


/* ═══════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .hero-section { height: 72vh !important; min-height: 440px; }
    .hero-title { font-size: 2.2rem !important; }
    .hero-buttons { flex-wrap: wrap; justify-content: center; gap: 10px; }
    .hero-buttons .btn { min-width: 200px; }
}
@media (max-width: 600px) {
    .hero-section { height: 65vh !important; min-height: 360px; }
    .hero-title { font-size: 1.75rem !important; line-height: 1.15 !important; }
    .hero-subtitle { font-size: .75rem; letter-spacing: 2px; }
    .hero-buttons .btn { width: 100%; max-width: 260px; text-align: center; }
    .hero-content { padding: 0 14px; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION — CHIFFRES CLÉS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .section-stats { padding: 28px 0 !important; }
    .section-stats .container {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 16px !important;
        justify-content: unset !important;
    }
    .counter-box { min-width: unset !important; flex: unset !important; }
}
@media (max-width: 380px) {
    .section-stats .container { gap: 10px !important; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION — MOT DU MAIRE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .intro-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }
    .intro-image { order: -1; }
    .intro-image > div { height: 260px !important; }
    .intro-text h2 { font-size: 1.5rem !important; }
}
@media (max-width: 480px) {
    .intro-image > div { height: 210px !important; }
    .intro-text h2 { font-size: 1.3rem !important; }
    .intro-text .btn { width: 100%; text-align: center; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION — SERVICES (Guichet unique)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .services-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .gu-card { padding: 24px 18px 20px !important; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION — DIVISIONS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Division grid uses auto-fit so it adapts; force 2 cols */
    .division-card { height: 230px !important; }
}
@media (max-width: 480px) {
    .division-card { height: 190px !important; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION — ACTUALITÉS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .news-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .news-img { height: 190px; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION — MÉDIAS (vidéos YouTube)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .media-vid-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
}
@media (min-width: 420px) and (max-width: 768px) {
    .media-vid-grid { grid-template-columns: 1fr 1fr !important; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION — CULTURE / FESFOP
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .fesfop-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
}


/* ═══════════════════════════════════════════════════════════════
   SECTION GENERIQUES — padding, typographie
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .section { padding: 44px 0 !important; }
    .section-title { font-size: 1.5rem !important; }
    .section-desc { font-size: .88rem; padding: 0 8px; }
    .btn { padding: 10px 20px; font-size: .84rem; }
    .container { padding: 0 16px; }
}
@media (max-width: 480px) {
    .section { padding: 32px 0 !important; }
    .section-title { font-size: 1.3rem !important; }
}


/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

/* Tablet : 2 colonnes */
@media (max-width: 1024px) {
    .ft-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 32px 28px !important;
    }
    /* Brand prend sa colonne normale */
    .ft-brand .ft-tagline { max-width: 100%; }
}

/* Phablet / petite tablette */
@media (max-width: 768px) {
    .site-footer { padding: 36px 0 0 !important; }
    .ft-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 28px 20px !important;
        padding-bottom: 32px !important;
    }
    /* La col contact prend toute la largeur */
    .ft-contact-col {
        grid-column: 1 / -1;
    }
    /* Newsletter inline sur tablette */
    .ft-newsletter-form {
        flex-direction: row !important;
    }
    .ft-newsletter-form input {
        flex: 1 !important;
        border-radius: 6px 0 0 6px !important;
    }
    .ft-newsletter-form button {
        border-radius: 0 6px 6px 0 !important;
        white-space: nowrap;
    }
}

/* Mobile */
@media (max-width: 580px) {
    .site-footer { padding: 28px 0 0 !important; }
    .ft-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding-bottom: 28px !important;
    }

    /* Brand centré */
    .ft-brand { text-align: center !important; }
    .ft-brand .ft-logo-link { justify-content: center !important; }
    .ft-brand .ft-tagline {
        margin: 10px auto 16px !important;
        max-width: 85% !important;
    }
    .ft-brand .ft-social { justify-content: center !important; }

    /* Contact col : plein largeur (déjà seule colonne, reset) */
    .ft-contact-col { grid-column: auto !important; }

    /* Newsletter : colonne sur mobile */
    .ft-newsletter-form {
        flex-direction: column !important;
    }
    .ft-newsletter-form input,
    .ft-newsletter-form button {
        border-radius: 6px !important;
        width: 100% !important;
    }

    /* Titres heading plus lisibles */
    .ft-heading { font-size: .82rem !important; }

    /* Copyright */
    .ft-copy-inner {
        flex-direction: column !important;
        gap: 4px !important;
        text-align: center !important;
        padding: 12px 0 !important;
    }
    .ft-copy-inner span {
        display: block;
        width: 100%;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — DÉMARCHES
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .dm-layout { grid-template-columns: 1fr !important; }
    .dm-cats-sidebar { position: static !important; }
}
@media (max-width: 640px) {
    .dm-layout { gap: 18px !important; }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — ACTUALITÉS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .actu-layout { grid-template-columns: 1fr !important; }
    .actu-sidebar { display: none; } /* hide sidebar on tablet/mobile */
}
@media (max-width: 640px) {
    .actu-grid { grid-template-columns: 1fr !important; }
    .actu-grid-small { grid-template-columns: 1fr !important; }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — CONTACT
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .ct-grid { grid-template-columns: 1fr !important; }
    .ct-hero { height: 40vh !important; min-height: 250px !important; }
}
@media (max-width: 480px) {
    .ct-hero { height: 36vh !important; min-height: 220px !important; }
    .ct-page { padding: 40px 0 60px !important; }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — ÉLUS (table scrollable horizontalement)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    #elusTable { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    #elusTable > div { min-width: 580px; }
    /* scrollbar fine */
    #elusTable::-webkit-scrollbar { height: 4px; }
    #elusTable::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }
}
@media (max-width: 768px) {
    .elus-stats-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
    .elus-filters { flex-direction: column !important; align-items: stretch !important; }
    .elus-filters input, .elus-filters select, .elus-filters button {
        width: 100%; box-sizing: border-box;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — BUREAU MUNICIPAL
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .bm-maire-card { grid-template-columns: 1fr !important; min-height: unset !important; }
    .bm-maire-photo { width: 100% !important; min-width: unset !important; max-height: 280px !important; object-fit: cover !important; }
    .bm-members-grid { grid-template-columns: 1fr 1fr !important; gap: 18px !important; }
    .bm-role-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
    .bm-role-inner { grid-template-columns: 1fr !important; }
}
@media (max-width: 580px) {
    .bm-members-grid { grid-template-columns: 1fr !important; }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — HÉROS génériques (toutes les pages intérieures)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .page-hero, [class*="page-hero"],
    section[style*="height:46vh"],
    section[style*="height:40vh"],
    section[style*="height:52vh"],
    section[style*="height:56vh"] {
        min-height: 220px !important;
    }
    /* Breadcrumbs on small screens */
    .breadcrumb { font-size: .75rem; }
}
@media (max-width: 480px) {
    section[style*="height:46vh"],
    section[style*="height:40vh"],
    section[style*="height:52vh"],
    section[style*="height:56vh"] {
        height: auto !important;
        padding: 50px 0 30px !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — COMMISSIONS / MUNICIPALITÉ / DOCUMENTATION / MÉDIAS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Generic 2-col grids → 1 col */
    .comm-grid,
    .muni-grid,
    .doc-grid,
    .plans-grid { grid-template-columns: 1fr !important; }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — COMMISSIONS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .comm-legal-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .comm-cta-grid   { grid-template-columns: 1fr !important; gap: 14px !important; }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — MUNICIPALITÉ
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .muni-members-grid { grid-template-columns: 1fr 1fr !important; gap: 18px !important; }

    /* CTA : colonne unique, centré */
    .muni-cta-grid {
        grid-template-columns: 1fr !important;
        padding: 32px 24px !important;
        text-align: center;
        gap: 20px !important;
    }
    .muni-cta-grid > *:first-child { display: none !important; } /* cache photo */
    .muni-cta-grid > *:last-child { display: flex; justify-content: center; }
    .muni-cta-grid a { justify-content: center; }
}

@media (max-width: 580px) {
    /* Cartes : 1 colonne */
    .muni-members-grid { grid-template-columns: 1fr !important; gap: 16px !important; }

    /* Réduire la bannière colorée des cartes */
    .muni-members-grid > a > div:first-child { height: 120px !important; }

    /* Réduire le padding interne des cartes */
    .muni-members-grid > a > div:last-child { padding: 18px 16px 20px !important; }

    /* Pills : wrap naturel déjà ok, on réduit juste la taille */
    .muni-members-grid span { font-size: 0.68rem !important; padding: 3px 8px !important; }

    /* CTA padding mobile */
    .muni-cta-grid { padding: 24px 18px !important; }
    .muni-cta-grid p { font-size: 0.88rem !important; }
}

/* Désactiver l'effet hover translateY sur appareils tactiles */
@media (hover: none) {
    .muni-members-grid > a:hover {
        transform: none !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.05) !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE — DOCUMENTATION
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .doc-nav-grid { grid-template-columns: 1fr 1fr !important; }
    .year-grid    { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
    .doc-nav-grid { grid-template-columns: 1fr !important; }
    .year-grid    { grid-template-columns: 1fr !important; }
}

.tbl-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
    .tbl-scroll > * { min-width: 560px; }
    .tbl-scroll::-webkit-scrollbar { height: 4px; }
    .tbl-scroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE — ACTUALITÉS
   ═══════════════════════════════════════════════════════════════ */

/* Tablette : sidebar tombe en bas, grilles ajustées */
@media (max-width: 1024px) {
    /* sidebar passe en grille 2 cols horizontale */
    .actu-layout > aside {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    .actu-layout > aside .sidebar-block {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    /* Hero : masquer stats droite, grille 1 col */
    .hero-actu-inner {
        grid-template-columns: 1fr !important;
    }
    .hero-actu-stats {
        display: none !important;
    }

    /* Ticker : label plus court */
    .ticker-label {
        padding: 0 10px !important;
        font-size: 0.52rem !important;
        letter-spacing: 1.5px !important;
    }
    .ticker-item {
        font-size: 0.65rem !important;
        padding: 0 18px !important;
    }

    /* Barre résultats : en colonne */
    .actu-results-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 12px 14px !important;
    }
    .filter-select {
        min-width: 100% !important;
        width: 100% !important;
    }
    .actu-results-right {
        width: 100%;
        justify-content: space-between;
    }

    /* Sidebar : 1 colonne */
    .actu-layout > aside {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 580px) {
    /* Hero body : padding réduit */
    .hero-actu-body {
        padding: 28px 0 24px !important;
    }

    /* Cards vedettes : image moins haute */
    .card-vedette .img-wrap { height: 190px !important; }
    .card-std    .img-wrap { height: 145px !important; }

    /* Footer carte : stack */
    .card-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Pagination : boutons plus petits */
    .pagination .page-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.72rem !important;
    }
    .pagination .page-btn.arrow {
        padding: 0 10px !important;
        font-size: 0.65rem !important;
    }

    /* Désactiver hover sur cartes (tactile) */
    @media (hover: none) {
        .card-vedette:hover, .card-std:hover {
            transform: none !important;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
        }
    }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE — MAIRE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .maire-layout {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    .maire-aside {
        position: static !important;
        /* Photo + carte en ligne côte à côte sur tablette */
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 20px;
        align-items: start;
    }
    /* La photo prend toute la hauteur de la carte */
    .maire-aside > div:first-child {
        margin-bottom: 0 !important;
    }
    /* Bouton contact en bas, pleine largeur */
    .maire-aside > a {
        grid-column: 1 / -1;
    }
}
@media (max-width: 580px) {
    .maire-aside {
        grid-template-columns: 1fr !important;
    }
    /* Photo max-width sur mobile */
    .maire-aside > div:first-child img {
        max-height: 320px;
        object-fit: cover;
        object-position: top center;
    }
    .maire-services-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE — MA COMMUNE
   ═══════════════════════════════════════════════════════════════ */

/* Tablette : sidebar passe en bas */
@media (max-width: 1024px) {
    .mc-layout {
        grid-template-columns: 1fr !important;
    }
    .mc-sidebar {
        position: static !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 16px !important;
    }
    .mc-geo-stats {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Phablet */
@media (max-width: 768px) {
    /* Hero stats : wrap propre */
    .mc-hero-stats {
        gap: 8px !important;
    }
    .mc-hero-stats > div {
        padding: 6px 10px !important;
        font-size: 0.78rem !important;
    }

    /* Sidebar en 1 colonne */
    .mc-sidebar {
        grid-template-columns: 1fr !important;
    }

    /* Geo stats 3 → 2 colonnes */
    .mc-geo-stats {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Saisons 2 → 1 colonne */
    .mc-saisons {
        grid-template-columns: 1fr !important;
    }

    /* Scrollbar tables */
    .mc-tbl-wrap {
        padding: 12px !important;
    }
    .mc-tbl-wrap table {
        min-width: 480px;
    }
    .mc-tbl-wrap::-webkit-scrollbar { height: 4px; }
    .mc-tbl-wrap::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }
}

/* Mobile */
@media (max-width: 580px) {
    /* Barre ancres : padding réduit + icônes masquées */
    .mc-anchor-nav a {
        padding: 10px 11px !important;
        font-size: 0.71rem !important;
        gap: 5px !important;
    }
    .mc-anchor-nav a i {
        display: none !important;
    }

    /* Supprime l'overflow caché du hero */
    .page-hero .container > div {
        max-width: 100% !important;
    }

    /* Quartiers 3 → 2 colonnes */
    .mc-quartiers {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Délégations 2 → 1 colonne */
    .mc-delegations {
        grid-template-columns: 1fr !important;
    }

    /* Geo stats 2 → 1 colonnes */
    .mc-geo-stats {
        grid-template-columns: 1fr !important;
    }

    /* Barre d'ancres : padding réduit */
    .mc-layout ~ * .container > div a,
    [style*="sticky"][style*="top:78px"] a {
        padding: 11px 12px !important;
        font-size: 0.72rem !important;
    }

    /* Timeline maires : badge période en dessous du nom */
    .mc-layout div[style*="justify-content:space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    /* Tables scrollables sur mobile */
    .mc-tbl-wrap table {
        min-width: 400px;
        font-size: 0.75rem !important;
    }
    .mc-tbl-wrap th,
    .mc-tbl-wrap td {
        padding: 7px 8px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTIONS — RESPONSIVE MOBILE
   Tous les héros de pages intérieures (inline-style → .page-hero,
   et ceux avec classes CSS dédiées)
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero générique (class="page-hero" ajoutée aux sections inline) ── */
@media (max-width: 768px) {
    .page-hero {
        height: auto !important;
        min-height: 220px !important;
        padding: 60px 0 36px !important;
    }
    .page-hero h1,
    .page-hero h2 {
        font-size: clamp(1.2rem, 5vw, 1.6rem) !important;
        line-height: 1.3 !important;
    }
    .page-hero p {
        font-size: .85rem !important;
        line-height: 1.5 !important;
    }
    /* Breadcrumb à l'intérieur du hero */
    .page-hero nav[aria-label="breadcrumb"],
    .page-hero .breadcrumb-nav {
        font-size: .75rem !important;
    }
}
@media (max-width: 480px) {
    .page-hero {
        min-height: 190px !important;
        padding: 55px 0 28px !important;
    }
}

/* ── Heroes avec classes CSS dédiées ── */
@media (max-width: 768px) {
    .dm-hero,
    .ct-hero,
    .md-hero,
    .detail-hero,
    .pai-hero,
    .pti-hero,
    .pdc-hero,
    .doc-hero,
    .plans-hero {
        height: auto !important;
        min-height: 220px !important;
        padding: 60px 0 36px !important;
    }
    .dm-hero h1, .dm-hero h2,
    .ct-hero h1,  .ct-hero h2,
    .md-hero h1,  .md-hero h2,
    .detail-hero h1, .detail-hero h2,
    .pai-hero h1, .pai-hero h2,
    .pti-hero h1, .pti-hero h2,
    .pdc-hero h1, .pdc-hero h2,
    .doc-hero h1, .doc-hero h2,
    .plans-hero h1, .plans-hero h2 {
        font-size: clamp(1.2rem, 5vw, 1.6rem) !important;
        line-height: 1.3 !important;
    }
    .dm-hero p,  .ct-hero p,  .md-hero p,
    .detail-hero p, .pai-hero p, .pti-hero p,
    .pdc-hero p,  .doc-hero p, .plans-hero p {
        font-size: .85rem !important;
    }
}
@media (max-width: 480px) {
    .dm-hero,  .ct-hero,  .md-hero,  .detail-hero,
    .pai-hero, .pti-hero, .pdc-hero, .doc-hero,
    .plans-hero {
        min-height: 190px !important;
        padding: 55px 0 28px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE — SERVICES
   ═══════════════════════════════════════════════════════════════ */

/* Tablette paysage : les 2 cartes restent côte à côte */
@media (max-width: 900px) {
    .svc-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    /* KPIs chiffres : 4 → 2 colonnes */
    .svc-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    /* Remet la séparation KPI 2e ligne */
    .svc-kpi-grid > div:nth-child(3) {
        border-left: none !important;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    .svc-kpi-grid > div:nth-child(4) {
        border-top: 1px solid rgba(255,255,255,0.08);
    }
}

@media (max-width: 580px) {
    /* KPIs : 2 → 1 colonne */
    .svc-kpi-grid {
        grid-template-columns: 1fr !important;
    }
    .svc-kpi-grid > div:nth-child(n) {
        border-left: none !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
    }
    .svc-kpi-grid > div:first-child {
        border-top: none !important;
    }
    /* Organigramme : rétrécit les boîtes */
    .svc-cards-grid a[href],
    .svc-cards-grid > div {
        font-size: 0.78rem !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE — SECRÉTAIRE MUNICIPAL
   ═══════════════════════════════════════════════════════════════ */

/* Tablette : grille mission|activités → 1 colonne */
@media (max-width: 900px) {
    .sec-poste-grid {
        grid-template-columns: 1fr !important;
    }
    /* Supprime la bordure droite de la colonne mission */
    .sec-poste-grid > div:first-child {
        border-right: none !important;
        border-bottom: 1px solid #f3f4f6 !important;
    }
    /* Activités : 2 colonnes max sur tablette */
    .sec-act-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    /* CTA bas → 1 colonne */
    .sec-cta-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* Mobile : tout en 1 colonne */
@media (max-width: 600px) {
    .sec-act-grid {
        grid-template-columns: 1fr !important;
    }
    /* Entête poste : photo + infos en colonne sur très petits écrans */
    .sec-poste-grid ~ div,
    .sec-poste-grid > div {
        padding: 18px 16px !important;
    }
    /* Photo + identité dans l'entête poste */
    [style*="border-left:5px solid"][style*="display:flex"][style*="align-items:center"] {
        flex-wrap: wrap !important;
        gap: 12px !important;
        padding: 16px !important;
    }
    /* Contact links : wrap */
    [style*="display:flex;flex-wrap:wrap;gap:10px;margin-top:4px"] {
        flex-direction: column !important;
        gap: 6px !important;
    }
    /* CTA : texte + bouton en colonne */
    .sec-cta-grid > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — PLANS (plans.php)
   ══════════════════════════════════════════════════════ */

/* Hero */
@media (max-width: 768px) {
    /* Plans hero handled by inline style height:60vh — OK at 768 */
    /* Sticky section headers */
    .plans-section-header {
        padding: 14px 16px !important;
    }
}

@media (max-width: 600px) {
    /* Plans hero */
    .plans-hero {
        min-height: 300px !important;
        height: 54vh;
    }
    /* Inner page padding */
    .plans-page {
        padding: 36px 0 60px !important;
    }
    /* Process steps : labels */
    .step-icon-ring {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.3rem !important;
    }
    /* CTA bottom : full-width buttons */
    .plans-cta-inner {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .plans-cta-btns {
        width: 100%;
    }
    .plans-cta-btns a {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — PLAN ANNUEL (plan-annuel.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Archive cards : head info */
    .archive-card-head {
        padding: 18px 18px 14px !important;
    }
    .archive-card-year {
        font-size: 1.6rem !important;
    }
    .archive-card-body {
        padding: 16px 18px 18px !important;
    }
}

@media (max-width: 600px) {
    /* Bottom navigation row */
    .pai-nav-row {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    .pai-nav-row a {
        justify-content: center !important;
        text-align: center;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — PDC (pdc.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Axe card content */
    .pdc-axe-card {
        margin-bottom: 24px !important;
    }
    .pdc-axe-desc {
        padding: 14px 18px !important;
    }
    /* Projects table cells */
    .pdc-projets-table th,
    .pdc-projets-table td {
        padding: 10px 12px !important;
        font-size: 0.78rem !important;
    }
}

@media (max-width: 500px) {
    /* Hero */
    .pdc-hero {
        min-height: 300px !important;
        height: 52vh;
    }
    /* Stats bar: single column on very small screens */
    .pdc-statsbar {
        grid-template-columns: 1fr 1fr !important;
    }
    /* Axe header wraps budget label nicely */
    .pdc-axe-icon {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.1rem !important;
    }
    /* PDF section inner padding */
    .pdc-pdf-section {
        padding: 18px 14px !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — PLAN TRIENNAL (plan-triennal.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Stats cards */
    .pti-stat {
        padding: 18px 16px 14px !important;
    }
    .pti-stat-val {
        font-size: 1.25rem !important;
    }
    /* Year header badges */
    .year-nb {
        font-size: 0.60rem !important;
    }
    /* Table : reduce cell padding */
    .pti-table th,
    .pti-table td {
        padding: 10px 10px !important;
        font-size: 0.76rem !important;
    }
    .proj-name {
        font-size: 0.78rem !important;
    }
    .pti-montant {
        font-size: 0.76rem !important;
    }
}

@media (max-width: 600px) {
    /* Hero */
    .pti-hero {
        min-height: 280px !important;
        height: 52vh;
    }
    /* Total box sub breaks cleanly */
    .pti-total-sub {
        max-width: 100%;
        word-break: break-word;
    }
    /* Source badges stack */
    .pti-total-right > div:first-child {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    /* Nav buttons full width */
    .pti-nav-row a {
        width: 100%;
        box-sizing: border-box;
        justify-content: center !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — DOCUMENTATION (documentation.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Modal rapports : texte lisible */
    .rmodal-texte {
        font-size: 0.82rem !important;
        line-height: 1.75 !important;
    }
    .rmodal-hd {
        padding: 16px 16px 12px !important;
    }
    .rmodal-body {
        padding: 18px 16px !important;
    }
    .rmodal-ft {
        padding: 12px 16px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    /* Galerie photos : tiles plus grandes */
    .rmodal-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }
    /* Section header */
    .section-head {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
}

@media (max-width: 640px) {
    /* Nav cards */
    .doc-nav-icon {
        width: 44px !important;
        height: 44px !important;
    }
    .doc-nav-title {
        font-size: 0.92rem !important;
    }
    /* Doc row action buttons : full row */
    .doc-row-action > * {
        min-width: 0;
    }
    /* Year card grid : 2 colonnes (hover cards section) */
    .year-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .year-card {
        height: 150px !important;
    }
    .year-num {
        font-size: 2rem !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — CONTACT (contact.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    /* Grille principale déjà en 1 colonne — ajuster les paddings */
    .ct-form-wrap {
        padding: 30px 24px !important;
    }
}

@media (max-width: 640px) {
    /* Hero */
    .ct-hero {
        min-height: 290px !important;
        height: 52vh;
    }
    /* Quick access cards en haut : texte centré sur 3 colonnes → 1 */
    .ct-quick-card {
        text-align: left !important;
    }
    .ct-quick-icon {
        margin: 0 0 12px !important;
    }
    /* Infos horaires */
    .ct-hor-row {
        font-size: 0.78rem !important;
    }
    /* Réseaux sociaux : icônes légèrement plus grandes (touch target) */
    .ct-social-links a {
        width: 44px !important;
        height: 44px !important;
    }
    /* Bouton submit */
    .ct-btn-submit {
        padding: 14px 20px !important;
        font-size: 0.78rem !important;
    }
    /* Map titre */
    .ct-map-section h2 {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 420px) {
    /* Page padding */
    .ct-page {
        padding: 30px 0 50px !important;
    }
    /* Form wrap */
    .ct-form-wrap {
        padding: 22px 14px !important;
    }
    /* Alert messages */
    .ct-alert {
        font-size: 0.80rem !important;
        padding: 12px 14px !important;
    }
    /* Form labels */
    .ct-label {
        font-size: 0.70rem !important;
    }
    /* Inputs */
    .ct-input, .ct-select, .ct-textarea {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — ACTUALITE DETAIL (actualite-detail.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Sidebar sticky → positionée en haut */
    .detail-layout .detail-sidebar {
        position: static !important;
    }
    /* Hero title smaller */
    .detail-hero-content h1 {
        font-size: clamp(1.4rem, 5vw, 2rem) !important;
    }
    /* Share bar */
    .share-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
}

@media (max-width: 480px) {
    /* Art nav: single column already handled inline; padding */
    .detail-wrap {
        padding: 28px 0 50px !important;
    }
    /* Comments section */
    .comments-header {
        padding: 14px 16px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — BUREAU MUNICIPAL (bureau-municipal.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Titre section */
    .bm-role-grid h3 {
        font-size: 0.95rem !important;
    }
    /* Attributions items: reduce padding */
    .bm-role-grid [style*="padding:12px 14px"],
    .bm-role-grid [style*="padding:11px 13px"] {
        padding: 10px 12px !important;
    }
}

@media (max-width: 580px) {
    /* Members grid hero photos smaller */
    .bm-members-grid > div [style*="height:210px"] {
        height: 170px !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — COMMISSIONS (commissions.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Commission cards: full height on mobile */
    .comm-legal-grid > div,
    .comm-cta-grid > div {
        min-height: 0 !important;
    }
    /* Modal membres: full width */
    #modal-membres > div {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px auto !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — DÉMARCHES (demarches.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Sidebar hidden (already in inline @media 1024px) */
    .dm-topbar {
        max-width: 100% !important;
    }
    /* Cards grid */
    .dm-card-header {
        padding: 18px 18px 14px !important;
    }
}

@media (max-width: 420px) {
    .dm-page {
        padding: 28px 0 50px !important;
    }
    .dm-card-icon {
        width: 42px !important;
        height: 42px !important;
        font-size: 1rem !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — ÉLUS (elus.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Table wrapper: horizontal scroll */
    #elusTable {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    /* Filter buttons: smaller */
    .elus-filters button {
        font-size: 0.72rem !important;
        padding: 8px 12px !important;
    }
    /* Pagination */
    #paginationBar {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

@media (max-width: 480px) {
    /* Stats: 2 colonnes */
    .elus-stats-grid > div {
        padding: 16px 14px !important;
    }
    [style*="font-size:1.7rem"][style*="font-weight:700"] {
        font-size: 1.35rem !important;
    }
}

/* ══════════════════════════════════════════════════════
   PAGE — MÉDIAS (medias.php)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Lightbox header */
    .md-lb-header {
        padding: 12px 16px !important;
        gap: 10px !important;
    }
    .md-lb-title {
        font-size: 0.80rem !important;
    }
    /* Album card body */
    .md-card-body {
        padding: 14px 16px 16px !important;
    }
}

@media (max-width: 480px) {
    /* Lightbox full screen adjustments */
    .md-lb-img {
        max-height: calc(100vh - 220px) !important;
    }
    /* Stats mobile */
    .md-stat-num {
        font-size: 1.2rem !important;
    }
}
