:root {
    --bg: #faf5f0;
    --rojo: #AA151B;
    --accent: #d97706;
    --accent-text: #b45309;
    --accent-light: #fef3c7;
    --rouge: #ef4444;
    --fonce: #78524e;
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(255, 255, 255, 0.3);
    --card-shadow: 0 1px 4px rgba(170, 21, 27, 0.06);
    --glass-blur: 12px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 100px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======= ACCESSIBILITY: Skip link ======= */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--rojo);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    text-decoration: none;
    transition: top 0.15s ease;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    color: #fff;
}

/* ======= ACCESSIBILITY: Focus styles ======= */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
/* Light outline on dark backgrounds */
.site-header :focus-visible,
.site-mega-menu :focus-visible,
.site-dropdown :focus-visible {
    outline-color: #fff;
}

/* ======= RESET & BASE ======= */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: #1e293b;
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a, button { transition: all var(--transition); }
a { color: var(--rojo); text-decoration: none; }
a:hover { color: var(--accent-text); text-decoration: none; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; }

.br-25, .br { border-radius: var(--radius); }
.bg-rojo { background-color: var(--rojo); color: #fff; }

/* ======= LAYOUT ======= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.row > [class*="col-"] { padding: 0 15px; }

.col-12 { width: 100%; }
.col-sm-4 { width: 33.333%; }
.col-sm-6 { width: 50%; }
.col-md-4 { width: 33.333%; }
.col-md-6 { width: 50%; }
.col-lg-3 { width: 25%; }
.col-lg-4 { width: 33.333%; }
.col-lg-6 { width: 50%; }
.col-lg-8 { width: 66.666%; }

@media (max-width: 991px) {
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8 { width: 100%; }
}
@media (max-width: 767px) {
    .col-md-4, .col-md-6 { width: 100%; }
    .col-sm-4, .col-sm-6 { width: 50%; }
}
@media (max-width: 575px) {
    .col-sm-4, .col-sm-6 { width: 100%; }
}

.m-auto { margin: auto; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-3 { padding: 1rem; }
.pe-lg-5 { padding-right: 3rem; }
@media (max-width: 991px) { .pe-lg-5 { padding-right: 15px; } }

/* ======= HEADER / NAV ======= */
.site-header {
    background: rgba(170, 21, 27, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 60px;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}
.site-logo-mark {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; color: var(--accent); }

/* Nav menu (horizontal list) */
.site-nav { flex: 1; min-width: 0; }
.site-nav-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
.site-nav-item { position: relative; }
.site-nav-link {
    display: flex; align-items: center; gap: 4px;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.9);
    font-family: 'Outfit', sans-serif;
    font-weight: 500; font-size: 0.88rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}
.site-nav-link:hover,
.site-nav-item.open .site-nav-link {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.site-nav-chevron {
    transition: transform 0.2s ease;
    opacity: 0.5;
}
.site-nav-item.open .site-nav-chevron {
    transform: rotate(180deg);
    opacity: 0.9;
}

/* ─── Dropdown (Découvrir, Classements) ─── */
.site-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: rgba(170, 21, 27, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 12px 0;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    z-index: 200;
}
.site-nav-item.open > .site-dropdown { display: block; animation: navFadeIn 0.15s ease; }

.site-dropdown-group { padding: 8px 16px; }
.site-dropdown-group + .site-dropdown-group { border-top: 1px solid rgba(255,255,255,0.08); }
.site-dropdown-heading {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    margin: 0 0 6px;
    padding: 0;
}
.site-dropdown-link {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    margin: 0 -12px;
    color: rgba(255,255,255,0.9);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}
.site-dropdown-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}
.site-dropdown-link--sub { padding-left: 24px; font-size: 0.84rem; color: rgba(255,255,255,0.75); }
.site-dropdown-link--sub:hover { color: #fff; }
.site-dropdown-link--all {
    margin: 0 16px 4px;
    padding: 8px 12px;
    background: rgba(0, 180, 216, 0.12);
    border: 1px solid rgba(0, 180, 216, 0.2);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.site-dropdown-link--all:hover { background: rgba(0, 180, 216, 0.2); color: #fff; }
.site-dropdown-divider { height: 1px; background: rgba(255,255,255,0.12); margin: 6px 16px; }
.site-dropdown-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.6; }
/* Dropdown search + tags */
.site-dropdown-search { padding: 0 0 8px; }
.site-dropdown-search-input {
    width: 100%; padding: 7px 12px; font-size: 0.85rem;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-pill); color: #fff; outline: none;
    font-family: inherit; transition: border-color var(--transition);
}
.site-dropdown-search-input::placeholder { color: rgba(255,255,255,0.4); }
.site-dropdown-search-input:focus { border-color: var(--accent); }
.site-dropdown-link[data-tag="new"]::after {
    content: 'NEW'; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
    background: var(--accent); color: var(--rojo); padding: 1px 6px;
    border-radius: var(--radius-pill); margin-left: auto;
}
.site-dropdown--classements { max-height: 70vh; overflow-y: auto; }
.site-dropdown--classements::-webkit-scrollbar { width: 4px; }
.site-dropdown--classements::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* ─── Mega-menu (Départements) ─── */
.site-mega-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: rgba(170, 21, 27, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    z-index: 200;
}
.site-nav-item.open > .site-mega-menu { display: block; animation: navFadeIn 0.15s ease; }
.site-mega-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 28px;
}
.site-mega-region {}
.site-mega-region-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-mega-region-title a {
    color: inherit;
    text-decoration: none;
}
.site-mega-region-title a:hover {
    color: #fff;
}
.site-mega-region ul { list-style: none; margin: 0; padding: 0; }
.site-mega-region li { margin-bottom: 2px; }
.site-mega-region a {
    display: block;
    padding: 4px 8px;
    margin: 0 -8px;
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    font-weight: 400;
    border-radius: 6px;
    transition: all var(--transition);
    text-decoration: none;
}
.site-mega-region a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}
.site-mega-dept-code { color: rgba(255,255,255,0.35); font-size: 0.78rem; }

@keyframes navFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Integrated search bar ─── */
.site-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-pill);
    padding: 0 4px 0 14px;
    height: 36px;
    transition: all var(--transition);
    flex-shrink: 0;
    max-width: 240px;
}
.site-search:focus-within {
    background: rgba(255,255,255,0.12);
    border-color: rgba(0, 180, 216, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}
.site-search-input {
    background: none;
    border: none;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.84rem;
    outline: none;
    width: 140px;
    padding: 0;
}
.site-search-input::placeholder { color: rgba(255,255,255,0.4); }
.site-search-btn {
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.5);
    padding: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: color var(--transition);
}
.site-search-btn:hover { color: var(--accent); }

/* Mobile search toggle (hidden on desktop) */
.site-search-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.7);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.site-search-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Mobile nav toggle */
.site-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}
.site-nav-toggle:hover { background: rgba(255,255,255,0.1); }

/* ─── Mobile responsive ─── */
@media (max-width: 767px) {
    .site-nav-toggle { display: flex; align-items: center; justify-content: center; }
    .site-search-toggle { display: flex; align-items: center; justify-content: center; margin-left: auto; }

    /* --- Mobile search bar --- */
    .site-search {
        display: none;
        position: fixed;
        top: 60px;
        left: 0; right: 0;
        max-width: none;
        height: 54px;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        background: rgba(170, 21, 27, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 0 20px;
        z-index: 201;
    }
    .site-search--open { display: flex; }
    .site-search-input { width: 100%; flex: 1; font-size: 1rem; }

    /* --- Mobile nav: fullscreen panel --- */
    .site-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0; right: 0;
        bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--rojo);
        padding: 12px 0 120px;
        z-index: 200; min-height:100vh;
    }
    .site-nav--open { display: flex; flex-direction: column; }
    .site-nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        padding: 0 24px;
    }

    /* --- Top-level nav items --- */
    .site-nav-item {
        width: 100%;
    }
    .site-nav-link {
        width: 100%;
        padding: 18px 0;
        font-size: 1.1rem;
        font-weight: 700;
        border-radius: 0;
        justify-content: space-between;
        color: #fff;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        background: none;
        letter-spacing: -0.01em;
    }
    .site-nav-link:hover,
    .site-nav-item.open .site-nav-link {
        background: none;
        color: var(--accent);
    }
    .site-nav-chevron {
        width: 14px;
        height: 14px;
        opacity: 0.4;
        transition: all 0.25s ease;
    }
    .site-nav-item.open .site-nav-chevron {
        opacity: 1;
        color: var(--accent);
    }

    /* --- Shared: all mobile sub-panels --- */
    .site-dropdown,
    .site-mega-menu {
        display: none !important;
        position: static !important;
        max-height: none;
        overflow: visible;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: none;
        padding: 0;
        animation: none !important;
        width: 100%;
    }
    .site-nav-item.open > .site-dropdown,
    .site-nav-item.open > .site-mega-menu {
        display: block !important;
    }

    /* --- Dropdown panels (Découvrir, Classements) --- */
    .site-dropdown {
        padding: 4px 0 12px !important;
    }
    .site-dropdown-group {
        padding: 8px 0 4px;
    }
    .site-dropdown-group + .site-dropdown-group {
        border-top: 1px solid rgba(255,255,255,0.06);
        margin-top: 6px;
        padding-top: 12px;
    }
    .site-dropdown-heading {
        font-size: 0.65rem;
        letter-spacing: 0.12em;
        color: rgba(255,255,255,0.35);
        margin-bottom: 6px;
        padding: 0;
        text-transform: uppercase;
    }

    /* --- Dropdown links --- */
    .site-dropdown-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 0;
        margin: 0;
        font-size: 0.95rem;
        font-weight: 500;
        color: rgba(255,255,255,0.75);
        border-radius: 0;
        min-height: 44px;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .site-dropdown-link:last-child { border-bottom: none; }
    .site-dropdown-link:hover,
    .site-dropdown-link:active {
        background: none;
        color: #fff;
    }
    .site-dropdown-link--sub {
        padding-left: 12px;
        font-size: 0.9rem;
        color: rgba(255,255,255,0.5);
        min-height: 40px;
    }
    .site-dropdown-link--sub:hover {
        color: rgba(255,255,255,0.9);
    }
    .site-dropdown-icon {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.4;
    }

    /* --- "Tous les classements" CTA --- */
    .site-dropdown-link--all {
        margin: 8px 0;
        padding: 12px 0;
        background: none;
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.04);
        color: var(--accent);
        border-radius: 0;
        font-weight: 600;
        justify-content: flex-start;
    }
    .site-dropdown-link--all:hover {
        background: none;
        color: #fff;
    }

    /* --- Mega-menu: Départements --- */
    .site-mega-menu {
        background: none !important;
    }
    .site-mega-menu-inner {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 4px 0 12px;
        max-width: none;
        margin: 0;
    }
    .site-mega-region {
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 10px 0;
    }
    .site-mega-region:last-child {
        border-bottom: none;
    }
    .site-mega-region-title {
        margin-bottom: 6px;
        font-size: 0.65rem;
        letter-spacing: 0.12em;
        color: rgba(255,255,255,0.35);
    }
    .site-mega-region ul {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 4px;
    }
    .site-mega-region a {
        padding: 5px 10px;
        font-size: 0.84rem;
        border-radius: 6px;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .site-mega-menu-inner { grid-template-columns: repeat(3, 1fr); }
    .site-search { max-width: 180px; }
    .site-search-input { width: 100px; }
}

/* ======= FOOTER ======= */
.site-footer { background: var(--rojo); color: #fff; padding: 48px 0 32px; margin-top: 60px; }
.site-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.site-footer a:hover { color: var(--accent-text); text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 36px; }
.footer-col h4 { font-size: 0.78rem; margin-bottom: 14px; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 5px; }
.footer-col li a { font-size: 0.88rem; }
.footer-desc { font-size: 0.88rem; color: rgba(255,255,255,0.85); line-height: 1.6; margin-bottom: 8px; }
.footer-sources { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.footer-regions { column-count: 2; column-gap: 12px; }
.footer-regions li { break-inside: avoid; }
.footer-regions li a { font-size: 0.82rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 36px; padding-top: 20px; text-align: center; font-size: 0.82rem; color: rgba(255,255,255,0.75); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.footer-legal { display: flex; gap: 16px; }
.footer-legal a { color: rgba(255,255,255,0.5); text-decoration: none; }
.footer-legal a:hover { color: #fff; }

/* Legal pages */
.legal-page { max-width: 780px; margin: 0 auto; padding: 40px 20px 60px; }
.legal-page h1 { color: var(--rojo); font-size: 1.8rem; margin-bottom: 1.5rem; }
.legal-page h2 { color: var(--rojo); font-size: 1.15rem; font-weight: 700; margin: 2rem 0 0.6rem; }
.legal-page p, .legal-page li { color: var(--fonce); font-size: 0.95rem; line-height: 1.7; }
.legal-page ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.legal-page a { color: var(--accent-text); }
.legal-page section { margin-bottom: 0.5rem; }

@media (max-width: 991px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 575px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-regions { column-count: 2; }
}

/* ======= BUTTONS ======= */
.btn { display: inline-block; padding: 10px 24px; background: var(--rojo); color: #fff; border: none; border-radius: var(--radius-pill); font-size: 0.92rem; cursor: pointer; font-weight: 600; text-decoration: none; font-family: 'Outfit', sans-serif; letter-spacing: 0.01em; }
.btn:hover { background: var(--accent); color: #fff; text-decoration: none; box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3); }

/* ======= FORMS ======= */
.search-form { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; padding: 12px 18px; border: 2px solid #e2e8f0; border-radius: var(--radius-pill); font-size: 0.95rem; font-family: 'Outfit', sans-serif; background: #fff; transition: all var(--transition); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15); }

/* ======= INFO BOXES ======= */
.info-box { background: var(--accent-light); border-left: 3px solid var(--accent); padding: 14px 18px; margin: 20px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.92rem; }
.warning-box { background: #fffbeb; border-left: 3px solid #f59e0b; padding: 14px 18px; margin: 20px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.92rem; }
.error-box { background: #fef2f2; border-left: 3px solid var(--rouge); padding: 14px 18px; margin: 20px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.92rem; }

/* ======= LISTS ======= */
.list-unstyled { list-style: none; padding: 0; margin: 0; }
.list-group { list-style: none; padding: 0; margin: 0; }
.list-group-item { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; background: #fff; }
.list-group-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-group-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.list-group-item a { color: var(--rojo); text-decoration: none; font-weight: 600; }
.list-group-item a:hover { color: var(--accent-text); }

.communes-list { list-style: none; padding: 0; margin: 0; }
.communes-list li { padding: 10px 0; border-bottom: 1px solid #eee; }
.communes-list li:last-child { border-bottom: none; }
.communes-list a { color: var(--rojo); font-weight: 600; text-decoration: none; }
.communes-list a:hover { color: var(--accent-text); }
.communes-list .cp { color: var(--fonce); font-size: 0.9rem; }

/* ======= RESULTS ======= */
.results-count { color: var(--fonce); margin-bottom: 20px; }
.no-results { color: var(--fonce); font-style: italic; }

/* ======= COMMUNE PAGE ======= */
.communes h1 { color: var(--rojo); }

/* ======= HERO IMAGE (full-width banner) ======= */
.commune-hero-banner {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 340px;
    overflow: hidden;
    margin-bottom: 0;
}
.commune-hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.commune-hero-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 43, 70, 0.85) 0%, rgba(15, 43, 70, 0.2) 50%, transparent 100%);
}
.commune-hero-banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 0 28px;
}
.commune-hero-banner-content .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.commune-hero-banner-content .commune-title { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.commune-hero-banner-content .commune-hero-dept { color: rgba(255,255,255,0.85); }
.commune-hero-banner-content .commune-hero-dept a { color: #fff; }
.commune-hero-banner-content .commune-hero-cp { color: rgba(255,255,255,0.9); }
.commune-hero-banner-content .commune-hero-stat {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
}
.commune-hero-banner-content .commune-hero-stat-value { color: #fff; }
.commune-hero-banner-content .commune-hero-stat-label { color: rgba(255,255,255,0.8); }
.commune-hero-banner-content .commune-hero-label {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.commune-hero-banner-content .commune-hero-label:hover { background: rgba(255,255,255,0.25); }
.commune-hero-banner-content .commune-hero-label-text { color: #fff; }

@media (max-width: 991px) { .commune-hero-banner { height: 280px; } }
@media (max-width: 767px) {
    .commune-hero-banner { height: 240px; }
    .commune-hero-banner-content { padding: 20px 0 20px; }
}

/* ======= COMMUNE INTRO — Unified header/intro block ======= */

/* Gradient banner (case 3: no images) */
.commune-gradient-banner {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 48px 0 36px;
    background: linear-gradient(135deg, var(--rojo) 0%, #0d3a5c 50%, #0a4a6e 100%);
    margin-bottom: 0;
}
.commune-gradient-banner .commune-title { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.commune-gradient-banner .commune-hero-dept { color: rgba(255,255,255,0.85); }
.commune-gradient-banner .commune-hero-dept a { color: #fff; }
.commune-gradient-banner .commune-hero-cp { color: rgba(255,255,255,0.9); }
.commune-gradient-banner .commune-hero-label {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.commune-gradient-banner .commune-hero-label:hover { background: rgba(255,255,255,0.25); }
.commune-gradient-banner .commune-hero-label-text { color: #fff; }
@media (max-width: 767px) {
    .commune-gradient-banner { padding: 32px 0 24px; }
}

/* Shared title & meta styles */
.commune-title {
    font-size: 2.4rem;
    color: var(--rojo);
    margin: 0 0 6px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.025em;
}
.commune-hero-dept {
    font-size: 1rem;
    color: var(--fonce);
    margin: 0 0 14px;
    font-weight: 400;
}
.commune-hero-dept a { color: var(--rojo); text-decoration: none; }
.commune-hero-dept a:hover { color: var(--accent-text); text-decoration: none; }

/* Label badges */
.commune-hero-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.commune-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    padding: 5px 12px 5px 6px;
    text-decoration: none;
    font-size: 0.82rem;
    color: var(--fonce);
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
}
.commune-hero-label:hover {
    box-shadow: 0 4px 16px rgba(15, 43, 70, 0.12);
    border-color: var(--accent);
    color: var(--rojo);
}
.commune-hero-label img {
    flex-shrink: 0;
    border-radius: 50%;
}
.commune-hero-label-text {
    font-weight: 600;
    white-space: nowrap;
}
.commune-hero-label-distinction {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.commune-hero-cp {
    font-size: 0.85rem;
    color: var(--fonce);
    letter-spacing: 0.02em;
    font-weight: 400;
}

/* Case 2: Intro header (carousel + info side by side) */
.commune-intro-header {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-bottom: 1.5rem;
}
.commune-intro-header .commune-intro-media {
    flex: 0 0 auto;
    width: 100%;
    max-width: 520px;
}
.commune-intro-info {
    flex: 1;
    min-width: 0;
}

/* Intro body: 2-col (media + text) */
.commune-intro-body {
    display: flex;
    gap: 32px;
    margin-bottom: 2.5rem;
}
.commune-intro-body .commune-intro-media {
    flex: 0 0 auto;
    width: 100%;
    max-width: 520px;
}
.commune-intro-body--no-media {
    display: block;
}
.commune-intro-text {
    flex: 1;
    min-width: 0;
}
.commune-intro-text > p {
    font-size: 1.08rem;
    line-height: 1.7;
    margin: 0 0 0.75rem 0;
}
.commune-intro-text > p:last-child {
    margin-bottom: 0;
}

/* Map row (case 2 lower section) */
.commune-intro-map-row {
    display: flex;
    gap: 24px;
    margin-top: 1.5rem;
}
.commune-intro-map-row .carte-section {
    flex: 1;
    min-width: 0;
}
.commune-intro-map-row .infos-pratiques {
    flex: 0 0 320px;
}
.commune-intro-lower {
    margin-bottom: 2.5rem;
}

/* Carte section inside intro */
.commune-intro-body .carte-section,
.commune-intro-text .carte-section {
    margin-top: 1.2rem;
    margin-bottom: 1rem;
}
.commune-intro-body #commune-map,
.commune-intro-text #commune-map,
.commune-intro-map-row #commune-map {
    height: 300px;
    border-radius: var(--radius);
}

/* ======= INLINE CAROUSEL (4/3 in hero) ======= */
.carousel-img-single {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(15, 43, 70, 0.12);
}
.carousel--inline {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(15, 43, 70, 0.12);
}
.carousel--inline .carousel-track {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
}
.carousel--inline .carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.carousel--inline .carousel-slide.active { opacity: 1; }

/* Carousel controls */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--rojo);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.carousel-btn--prev { left: 12px; }
.carousel-btn--next { right: 12px; }

/* Carousel thumbnails strip */
.carousel-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
}
.carousel-thumbs::-webkit-scrollbar { display: none; }
.carousel-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 48px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: none;
    opacity: 0.45;
    transition: all var(--transition);
}
.carousel-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-thumb.active,
.carousel-thumb:hover {
    opacity: 1;
    border-color: var(--accent);
}
.carousel-thumb.active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.25);
}

@media (max-width: 767px) {
    .carousel-thumb { width: 56px; height: 42px; border-radius: 6px; }
    .carousel-thumbs { gap: 6px; }
}

/* Carousel counter */
.carousel-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(15, 43, 70, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

/* ======= COMMUNE INTRO: responsive ======= */
@media (max-width: 991px) {
    .commune-intro-header { gap: 24px; }
    .commune-intro-header .commune-intro-media { max-width: 45%; }
    .commune-intro-body .commune-intro-media { max-width: 45%; }
    .commune-title { font-size: 2rem; }
}

@media (max-width: 767px) {
    .commune-gradient-header {
        flex-direction: column;
    }
    .commune-title-practical--on-hero {
        flex: 1 1 auto;
        width: 100%;
        margin-top: 8px;
    }
    .commune-intro-header {
        flex-direction: column;
        gap: 20px;
    }
    .commune-intro-header .commune-intro-media {
        max-width: 100%;
        order: -1;
    }
    .commune-intro-body {
        flex-direction: column;
        gap: 20px;
    }
    .commune-intro-body .commune-intro-media {
        max-width: 100%;
    }
    .commune-intro-map-row {
        flex-direction: column;
        gap: 16px;
    }
    .commune-intro-map-row .infos-pratiques {
        flex: 1 1 auto;
    }
    .carousel--inline { border-radius: var(--radius); }
    .carousel-img-single { border-radius: var(--radius); }
    .carousel-btn { width: 44px; height: 44px; font-size: 1rem; }
    .commune-hero-labels { gap: 6px; margin-bottom: 12px; }
    .commune-hero-label { font-size: 0.75rem; padding: 4px 10px 4px 5px; }
    .commune-hero-label img { width: 22px; height: 22px; }
    .carousel-btn--prev { left: 8px; }
    .carousel-btn--next { right: 8px; }
    .commune-title { font-size: 1.7rem; }
    .commune-quick-facts { grid-template-columns: 1fr; }
}

/* ======= SCROLL REVEAL ANIMATIONS ======= */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger cards */
.kpi-card.reveal-on-scroll { transition-delay: 0.04s; }
.kpi-card.reveal-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.kpi-card.reveal-on-scroll:nth-child(3) { transition-delay: 0.12s; }
.kpi-card.reveal-on-scroll:nth-child(4) { transition-delay: 0.16s; }

/* Section blocks */
.guide-section-block {
    scroll-margin-top: 70px;
}

/* Collapsible sections */
.guide-section-block--collapsible {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    background: #fff;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.guide-section-block--collapsible:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.guide-collapse-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.guide-collapse-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rojo);
}
.guide-collapse-chevron {
    flex-shrink: 0;
    color: var(--rojo);
    transition: transform 0.3s ease;
}
.guide-collapse-trigger[aria-expanded="true"] .guide-collapse-chevron {
    transform: rotate(180deg);
}
.guide-collapse-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.guide-collapse-panel--open {
    overflow: visible;
}
.guide-collapse-panel > .commune-section {
    border-top: 1px solid #f1f5f9;
    padding: 0 1.25rem 1.25rem;
}
.guide-collapse-panel > .commune-section > h2 {
    display: none; /* Title already in the trigger */
}

/* Scroll anchor offset for nav links */
.commune-section[id] {
    scroll-margin-top: 70px;
}

/* Universal section spacing (separator between sections) */
.commune-section {
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}
.guide-group .guide-section-block:first-child .commune-section,
.guide-section-block:first-child .commune-section,
.commune-section-content .commune-section {
    border-top: none;
    padding-top: 0;
}

/* ── Group wrappers ── */
.guide-group {
    padding: 3.5rem 0 2rem;
    border-top: 4px solid var(--rojo);
    margin-top: 1rem;
}
.guide-group:first-child {
    padding-top: 0;
    border-top: none;
    margin-top: 0;
}
.guide-group--alt {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}
.guide-group-header {
    margin-bottom: 2rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.guide-group-header::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent 80%);
}
.guide-group-label {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rojo);
    white-space: nowrap;
}

/* ── Collapsible sections ── */
.commune-section h2 {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.section-heading-button {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font: inherit;
    margin: 0;
    padding: 0;
    text-align: left;
    width: 100%;
}
.section-heading-text {
    display: flex;
    flex-direction: column;
}
.commune-section h2 .section-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all var(--transition);
    transform: rotate(0deg);
}
.commune-section.section-collapsed h2 .section-toggle {
    transform: rotate(-90deg);
}
.commune-section h2:hover .section-toggle {
    border-color: var(--accent-text);
    color: var(--accent-text);
}
.section-heading-button:hover .section-toggle {
    border-color: var(--accent-text);
    color: var(--accent-text);
}
.commune-section .section-collapsible {
    overflow: hidden;
    max-height: 8000px;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}
.commune-section.section-collapsed .section-collapsible {
    max-height: 0;
    opacity: 0;
}

/* Enhanced section titles */
.commune-section h2 {
    color: var(--rojo);
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.commune-section h2 span {
    display: block;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--accent-text);
    margin-top: 2px;
    letter-spacing: 0;
}
.commune-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.commune-section:hover h2::after {
    width: 80px;
}

/* (photos-communes legacy styles removed – using commune-hero layout now) */

.fiche-intro { list-style: none; padding-left: 0; margin: 0 0 20px 0; }
.fiche-intro li { font-size: 1.4rem; color: var(--rojo); padding: 5px 0; }
.fiche-intro li span { font-size: 1.5rem; color: var(--rojo); font-weight: 700; }
.fiche-intro li span a { color: var(--rojo); text-decoration: none; }
.fiche-intro li a:hover, .fiche-intro li span a:hover { color: var(--rouge); }

.commune-introduction { font-size: 1.08rem; }
.commune-introduction a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
.commune-introduction a:hover { text-decoration-color: var(--rojo); }

/* Stat blocs (population, superficie, densite) */
.bloc-commune-intro { border-radius: var(--radius); text-align: center; height: 160px; display: flex; flex-direction: column; justify-content: center; align-items: center; margin-bottom: 25px; }
.bloc-commune-intro img { height: auto; max-width: 50px; margin-bottom: 10px; }
.bloc-commune-intro span { display: block; }
.bloc-commune-intro span.text-1 { font-size: 0.7rem; color: rgba(255,255,255,0.7); }
.bloc-commune-intro span.text-2 { font-size: 1.4rem; font-weight: 700; }
.bloc-commune-intro span.text-3 a { font-size: 0.7rem; color: rgba(255,255,255,0.7); text-decoration: none; }
.bloc-commune-intro span.text-3 a:hover { color: var(--accent-text); }

/* Generic bloc commune */
.bloc-commune { border-radius: var(--radius); text-align: center; height: 160px; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: all var(--transition); padding: 15px; }
.bloc-commune img { height: auto; max-width: 100px; margin-bottom: 15px; }
.bloc-commune span { display: block; }
.bloc-commune .text-1 { font-size: 0.7rem; color: rgba(255,255,255,0.7); }
.bloc-commune .text-2 { font-size: 1.4rem; font-weight: 700; }

/* Commune info dl */
.commune-info { margin: 20px 0; }
.commune-info dt { font-weight: 600; color: var(--rojo); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.commune-info dd { margin: 0 0 15px 0; font-size: 1.1rem; }

.commune-title-practical {
    margin-top: 10px;
}
.commune-gradient-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.commune-gradient-main {
    flex: 1 1 auto;
    min-width: 0;
}
.commune-title-practical--on-hero {
    flex: 0 0 360px;
    margin-top: 4px;
}
.commune-quick-facts {
    margin: 0;
    padding: 10px 12px;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dbe4ef;
    border-radius: 12px;
}
.commune-quick-facts li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.35;
}
.commune-quick-facts li strong {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}
.commune-quick-facts li span {
    color: #0f172a;
}
.commune-quick-facts li small {
    color: #64748b;
    font-size: 0.74rem;
}
.commune-quick-facts a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed #93a4b8;
}
.commune-quick-facts a:hover {
    color: var(--rojo);
    border-bottom-color: var(--rojo);
}
.commune-title-practical--on-hero .commune-quick-facts {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}
.commune-title-practical--on-hero .commune-quick-facts li {
    color: rgba(255, 255, 255, 0.95);
}
.commune-title-practical--on-hero .commune-quick-facts li strong {
    color: rgba(255, 255, 255, 0.75);
}
.commune-title-practical--on-hero .commune-quick-facts li span,
.commune-title-practical--on-hero .commune-quick-facts li small {
    color: #fff;
}
.commune-title-practical--on-hero .commune-quick-facts a {
    border-bottom-color: rgba(255, 255, 255, 0.65);
}
.commune-title-practical--on-hero .commune-quick-facts a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* Editorial */
.commune-editorial { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #e2e8f0; }
.commune-editorial h2 { color: var(--rojo); }
.commune-editorial h3 { color: var(--rojo); font-size: 1.4rem; }

/* ======= MAP FAB & MODAL ======= */
.map-fab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    background: var(--rojo);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    box-shadow: -2px 2px 16px rgba(15, 43, 70, 0.3);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all var(--transition);
}
.map-fab:hover { background: var(--accent); padding-right: 14px; }
.map-fab svg { width: 22px; height: 22px; fill: currentColor; }
.map-fab-label { writing-mode: vertical-rl; text-orientation: mixed; }
.map-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.map-modal--open { display: flex; }
.map-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 43, 70, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.map-modal-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 1400px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 20px 60px rgba(15, 43, 70, 0.3);
    overflow: hidden;
}
.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.map-modal-title { margin: 0; font-size: 1.1rem; color: var(--rojo); font-weight: 700; }
.map-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.map-modal-close:hover { background: #f1f5f9; color: var(--rouge); }
.map-modal-filters {
    padding: 12px 24px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.map-modal-filters .commune-map-filters { margin: 0; }
.map-modal-filters .commune-map-filters--secondary { margin-bottom: 0; margin-top: 8px; }
.map-modal-body { flex: 1; min-height: 0; }
.communes-voisines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15,43,70,0.06);
}
.communes-voisines-label {
    font-weight: 600;
    color: var(--rojo);
    font-size: 0.85rem;
    margin-right: 0.25rem;
}
.communes-voisines-link {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    color: var(--rojo);
    background: rgba(15,43,70,0.05);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.communes-voisines-link:hover {
    background: var(--accent);
    color: #fff;
}
.commune-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin: 0 0 10px;
}
.commune-map-filters label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #475569;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 10px;
}
.commune-map-filters input {
    accent-color: var(--rojo);
}
.commune-map-filter-select {
    gap: 4px;
}
.commune-map-filters--secondary {
    margin-bottom: 12px;
}
.commune-map-filter-count {
    color: #64748b;
    font-size: 0.75rem;
}
.commune-map-filter-select select {
    border: 1px solid #d5ddea;
    background: #fff;
    color: #334155;
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 2px 8px;
}
#commune-map { width: 100%; height: 100%; z-index: 0; overflow: hidden; }
#commune-map .leaflet-control-attribution { font-size: 0.7rem; }
.neighbor-tooltip { font-family: 'Outfit', sans-serif; font-size: 0.85rem; }
@media (max-width: 767px) {
    .map-fab {
        top: auto;
        right: 80px;
        bottom: 20px;
        transform: none;
        flex-direction: row;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    .map-fab-label { display: none; }
    .map-fab:hover { padding-right: 0; }
    .map-modal { padding: 0; }
    .map-modal-container {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        max-width: 100%;
    }
    .map-modal-filters { padding: 8px 12px; }
    .map-modal-header { padding: 12px 16px; }
}

/* ======= CLASSEMENT PAGE ======= */
.classement-page h1 { color: var(--rojo); margin-bottom: 0.5rem; }
.classement-page > .container > .row > div { max-width: 100%; flex: 0 0 100%; }

.classement-intro { font-size: 1.05rem; color: var(--fonce); line-height: 1.7; margin-bottom: 1.5rem; }

.classement-section-title { color: var(--rojo); font-size: 1.3rem; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }

.classement-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.classement-nav .btn { font-size: 0.9rem; padding: 8px 16px; }

.classement-form-select { background: var(--rojo); color: #fff; width: 100%; padding: 10px 15px; border-radius: var(--radius-sm); border: none; font-family: 'Outfit', sans-serif; font-size: 0.95rem; cursor: pointer; margin-bottom: 15px; }

/* Filtre population */
.pop-filter { background: rgba(255,255,255,0.72); backdrop-filter: blur(12px); border: 1px solid rgba(15,43,70,0.08); border-radius: var(--radius); padding: 16px 20px; }
.pop-filter__title { display: block; font-size: 0.85rem; color: var(--fonce); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.pop-filter__options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pop-filter__label { cursor: pointer; user-select: none; }
.pop-filter__label input { display: none; }
.pop-filter__chip { display: inline-block; padding: 6px 14px; border-radius: var(--radius-pill); font-size: 0.85rem; font-family: 'Outfit', sans-serif; font-weight: 500; background: #e2e8f0; color: var(--rojo); border: 2px solid transparent; transition: all 0.2s ease; }
.pop-filter__label input:checked + .pop-filter__chip { background: var(--rojo); color: #fff; border-color: var(--accent); }
.pop-filter__label:hover .pop-filter__chip { border-color: var(--accent); }
.pop-filter__actions { display: flex; gap: 10px; }
.pop-filter__btn { background: none; border: none; color: var(--accent-text); font-family: 'Outfit', sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.pop-filter__btn:hover { color: var(--rojo); }

/* Top 9 - liste enrichie */
.classement-top-list { margin-bottom: 40px; }

.classement-item { display: flex; align-items: flex-start; gap: 20px; padding: 20px 0; border-bottom: 1px solid #e2e8f0; }
.classement-item:first-child { padding-top: 0; }
.classement-item:last-child { border-bottom: none; }

.classement-item__rank { flex-shrink: 0; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--rojo); color: #fff; font-weight: 700; font-size: 0.85rem; border-radius: 50%; margin-top: 4px; }
.classement-item--first .classement-item__rank { width: 42px; height: 42px; font-size: 1rem; background: var(--accent); }

.classement-item__image-link { flex-shrink: 0; display: block; border-radius: var(--radius-sm); overflow: hidden; }
.classement-item__image { display: block; width: 150px; height: 105px; object-fit: cover; transition: transform 0.3s ease; }
.classement-item__image-link:hover .classement-item__image { transform: scale(1.05); }
.classement-item--first .classement-item__image { width: 200px; height: 140px; }

.classement-item__content { flex: 1; min-width: 0; }

.classement-item__header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.classement-item__name { font-size: 1.05rem; font-weight: 700; margin: 0; }
.classement-item__name a { color: var(--rojo); text-decoration: none; }
.classement-item__name a:hover { color: var(--accent-text); }
.classement-item--first .classement-item__name { font-size: 1.2rem; }
.classement-item__cp { font-size: 0.82rem; color: var(--fonce); }

.classement-item__value { display: inline-block; font-size: 0.88rem; font-weight: 600; color: var(--accent-text); background: var(--accent-light); padding: 2px 10px; border-radius: var(--radius-pill); margin-bottom: 6px; }

.classement-item__text { font-size: 0.9rem; color: var(--fonce); line-height: 1.6; margin: 6px 0 0; }
/* Classement list */
.classement-list { display: flex; flex-direction: column; gap: 0; }
.classement-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.classement-row:last-child { border-bottom: none; }
.classement-row__rank { flex-shrink: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--rojo); color: #fff; font-weight: 700; font-size: 0.78rem; border-radius: 50%; }
.classement-row__main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.classement-row__name { color: var(--rojo); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.classement-row__name:hover { color: var(--accent-text); }
.classement-row__meta { font-size: 0.8rem; color: var(--fonce); }
.classement-row__details { display: flex; gap: 14px; flex-shrink: 0; }
.classement-row__detail { font-size: 0.82rem; color: var(--fonce); white-space: nowrap; }
.classement-row__detail-label { font-weight: 600; margin-right: 2px; }
.classement-row__value { flex-shrink: 0; font-size: 0.85rem; font-weight: 600; color: var(--accent-text); background: var(--accent-light); padding: 2px 12px; border-radius: var(--radius-pill); white-space: nowrap; }

/* ======= CLASSEMENT: STATS & CHART ======= */
.classement-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
}
.classement-stats .kpi-card { flex: 1 1 140px; }
.classement-updated {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--fonce);
    margin-left: 8px;
}
.classement-updated time { font-weight: 600; }

/* ======= DVF: DERNIÈRES VENTES ======= */
.dvf-ventes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.dvf-vente-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(15,43,70,0.06);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: border-color var(--transition);
}
.dvf-vente-card:hover { border-color: var(--accent); }
.dvf-vente-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fonce);
    margin-bottom: 4px;
}
.dvf-vente-prix {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rojo);
}
.dvf-vente-details {
    font-size: 0.82rem;
    color: var(--fonce);
    margin-top: 4px;
}
.dvf-vente-date {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 6px;
}
@media (max-width: 575px) {
    .dvf-ventes-grid { grid-template-columns: 1fr 1fr; }
}

/* ======= CLASSEMENTS INDEX PAGE ======= */
.classements-index h1 { color: var(--rojo); margin-bottom: 0.5rem; }
.classements-intro { font-size: 1.05rem; color: var(--fonce); line-height: 1.7; margin-bottom: 2rem; max-width: 700px; }

.classements-theme { margin-bottom: 2.5rem; }
.classements-theme-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.classements-theme-icon svg {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}
.classements-theme-desc {
    color: var(--fonce);
    font-size: 0.9rem;
    margin: 0 0 1rem;
    line-height: 1.5;
}
/* Dept filter on classements index */
.classements-dept-filter {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 2rem; padding: 1.2rem 1.5rem;
    background: rgba(255,255,255,0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(15,43,70,0.08); border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(15,43,70,0.04);
}
.classements-dept-filter label {
    font-weight: 700; font-size: 0.92rem; color: var(--rojo); white-space: nowrap;
}
.classements-dept-filter select {
    flex: 1; max-width: 360px; padding: 10px 16px; font-size: 0.9rem; font-family: inherit;
    border: 2px solid rgba(15,43,70,0.12); border-radius: var(--radius-sm);
    background: #fff; color: var(--rojo); cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.classements-dept-filter select:hover { border-color: rgba(15,43,70,0.25); }
.classements-dept-filter select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,180,216,0.15); outline: none; }
@media (max-width: 600px) {
    .classements-dept-filter { flex-direction: column; align-items: stretch; gap: 8px; padding: 1rem; }
    .classements-dept-filter select { max-width: 100%; }
}
/* Feature 2: Recherche commune */
.classements-commune-search {
    background: var(--rojo); color: #fff; border-radius: var(--radius);
    padding: 2rem; margin-bottom: 2rem; text-align: center;
}
.classements-commune-search h2 { color: #fff; font-size: 1.3rem; margin: 0 0 0.5rem; }
.classements-commune-search p { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin: 0 0 1.2rem; }
.classements-commune-search-wrap { position: relative; max-width: 420px; margin: 0 auto; }
.classements-commune-search-input {
    width: 100%; padding: 12px 20px; font-size: 1rem; font-family: inherit;
    border: 2px solid rgba(255,255,255,0.2); border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.1); color: #fff; outline: none;
    transition: border-color var(--transition);
}
.classements-commune-search-input::placeholder { color: rgba(255,255,255,0.45); }
.classements-commune-search-input:focus { border-color: var(--accent); }
.classements-commune-suggest {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    background: #fff; border-radius: var(--radius-sm); box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    overflow: hidden; text-align: left;
}
.classements-commune-suggest-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 16px; color: var(--rojo); text-decoration: none; font-size: 0.9rem;
    transition: background var(--transition);
}
.classements-commune-suggest-item:hover,
.classements-commune-suggest-item--active { background: var(--bg); }
.classements-commune-suggest-item span { color: var(--fonce); font-size: 0.8rem; }
/* ======= FOCUS DU JOUR (commune + classement) ======= */
.cdu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 2rem;
}
.cdu-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition);
}
.cdu-card:hover { box-shadow: 0 12px 32px rgba(15,43,70,0.12); }

/* Commune du jour */
.cdu-card--commune {
    position: relative;
    display: block;
    text-decoration: none;
    color: #fff;
    min-height: 220px;
}
.cdu-card__img {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute; inset: 0;
}
.cdu-card__overlay {
    position: relative; z-index: 1;
    padding: 24px;
    height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(0deg, rgba(15,43,70,0.85) 0%, transparent 60%);
}
.cdu-card__badge {
    display: inline-block; width: fit-content;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--accent); color: #fff;
    padding: 3px 10px; border-radius: var(--radius-pill);
    margin-bottom: 8px;
}
.cdu-card__title { font-size: 1.4rem; font-weight: 700; margin: 0 0 2px; }
.cdu-card__sub { font-size: 0.9rem; opacity: 0.8; }

/* Classement du jour */
.cdu-card--classement {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    padding: 24px;
    display: flex; flex-direction: column;
}
.cdu-card--classement .cdu-card__header { margin-bottom: 14px; }
.cdu-card--classement .cdu-card__title { font-size: 1.2rem; font-weight: 700; color: var(--rojo); margin: 4px 0 2px; }
.cdu-card--classement .cdu-card__sub { font-size: 0.85rem; color: var(--fonce); }

.cdu-top5 {
    list-style: none; margin: 0; padding: 0;
    flex: 1;
}
.cdu-top5__item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15,43,70,0.06);
    font-size: 0.92rem;
}
.cdu-top5__item:last-child { border-bottom: none; }
.cdu-top5__rank {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem; font-weight: 700;
    background: var(--bg); color: var(--rojo);
}
.cdu-top5__item:nth-child(1) .cdu-top5__rank { background: #ffd700; color: #fff; }
.cdu-top5__item:nth-child(2) .cdu-top5__rank { background: #c0c0c0; color: #fff; }
.cdu-top5__item:nth-child(3) .cdu-top5__rank { background: #cd7f32; color: #fff; }
.cdu-top5__name {
    flex: 1;
    color: var(--rojo); font-weight: 600;
    text-decoration: none;
}
.cdu-top5__name:hover { color: var(--accent); }
.cdu-top5__val { font-size: 0.82rem; color: var(--fonce); white-space: nowrap; }

.cdu-card__link {
    display: inline-block; margin-top: 12px;
    font-size: 0.85rem; font-weight: 600;
    color: var(--accent); text-decoration: none;
}
.cdu-card__link:hover { text-decoration: underline; }

/* Classements populaires */
.cdu-featured { margin-bottom: 2rem; }
.cdu-featured__grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.75rem; }
.cdu-featured__pill {
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    font-size: 0.9rem; font-weight: 600;
    color: var(--rojo); text-decoration: none;
    transition: all var(--transition);
}
.cdu-featured__pill:hover {
    background: var(--accent); color: #fff; border-color: var(--accent);
    text-decoration: none;
}

/* Départements */
.cdu-depts { margin: 2.5rem 0; }
.cdu-depts__grid {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.75rem;
}
.cdu-depts__chip {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    font-size: 0.78rem; font-weight: 500;
    color: var(--rojo); text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.cdu-depts__chip:hover {
    background: var(--rojo); color: #fff; border-color: var(--rojo);
    text-decoration: none;
}

/* Le saviez-vous */
.cdu-saviez {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px 32px;
    border-left: 4px solid var(--accent);
}
.cdu-saviez__title {
    font-size: 1.2rem; font-weight: 700; color: var(--rojo);
    margin: 0 0 16px;
}
.cdu-saviez__list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 12px;
}
.cdu-saviez__list li {
    font-size: 0.95rem; line-height: 1.6; color: var(--rojo);
}
.cdu-saviez__link {
    font-size: 0.82rem; font-weight: 600;
    color: var(--accent); text-decoration: none;
    margin-left: 6px;
}
.cdu-saviez__link:hover { text-decoration: underline; }

@media (max-width: 767px) {
    .cdu-grid { grid-template-columns: 1fr; }
    .cdu-card--commune { min-height: 180px; }
    .cdu-saviez { padding: 20px; }
}

/* Feature 3: Toggle grille/palmarès */
.classements-view-toggle {
    display: flex; gap: 4px; margin-bottom: 1.5rem;
    background: var(--bg); border-radius: var(--radius-pill); padding: 4px; width: fit-content;
}
.classements-view-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 18px; border: none; border-radius: var(--radius-pill);
    background: transparent; color: var(--fonce); font-size: 0.88rem; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all var(--transition);
}
.classements-view-btn:hover { color: var(--rojo); }
.classements-view-btn--active { background: #fff; color: var(--rojo); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
/* Palmarès cards */
.palmares-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 1.5rem;
}
.palmares-card {
    background: rgba(255,255,255,0.72); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6); border-radius: var(--radius);
    padding: 1.2rem; transition: transform var(--transition), box-shadow var(--transition);
}
.palmares-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.palmares-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 0.8rem; }
.palmares-card-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--rojo); margin: 0; }
.palmares-card-header .classement-card-icon { width: 22px; height: 22px; }
.palmares-podium { list-style: none; padding: 0; margin: 0; }
.palmares-podium-item {
    display: flex; align-items: center; gap: 8px; padding: 5px 0;
    font-size: 0.88rem; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.palmares-podium-item:last-child { border-bottom: none; }
.palmares-podium-medal { font-size: 1.1rem; width: 1.5em; text-align: center; flex-shrink: 0; }
.palmares-podium-item a { color: var(--rojo); font-weight: 600; text-decoration: none; flex: 1; }
.palmares-podium-item a:hover { color: var(--accent); }
.palmares-podium-value { color: var(--fonce); font-size: 0.8rem; white-space: nowrap; }
.palmares-card-link {
    display: inline-block; margin-top: 0.8rem; font-size: 0.82rem; font-weight: 600;
    color: var(--accent); text-decoration: none;
}
.palmares-card-link:hover { text-decoration: underline; }

.classements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 1rem;
}
.classement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 28px 20px 24px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.classement-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition);
}
.classement-card:hover {
    box-shadow: 0 12px 32px rgba(15, 43, 70, 0.12);
    text-decoration: none;
}
.classement-card:hover::before { opacity: 1; }

.classement-card-icon {
    width: 40px; height: 40px;
    color: var(--accent);
}
.classement-card-icon svg { width: 100%; height: 100%; }
.classement-card-title { font-size: 1.1rem; font-weight: 700; color: var(--rojo); margin: 0; }
.classement-card-desc { font-size: 0.85rem; color: var(--fonce); line-height: 1.5; margin: 0; }
.classement-card-unit { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(15, 43, 70, 0.4); }

/* Podium — classements départementaux */
.dept-ranking-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 2rem;
    align-items: end;
}
.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
    position: relative;
}
.podium-card:hover { box-shadow: 0 12px 32px rgba(15, 43, 70, 0.12); }
.podium-gold {
    border-top: 3px solid #f59e0b;
    padding-top: 32px;
    min-height: 200px;
}
.podium-silver {
    border-top: 3px solid #94a3b8;
    min-height: 170px;
}
.podium-bronze {
    border-top: 3px solid #d97706;
    min-height: 170px;
}
.podium-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--rojo);
    line-height: 1;
    margin-bottom: 8px;
}
.podium-gold .podium-rank { font-size: 2rem; color: #f59e0b; }
.podium-silver .podium-rank { color: #64748b; }
.podium-bronze .podium-rank { color: #d97706; }
.podium-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rojo);
    text-decoration: none;
    margin-bottom: 2px;
}
.podium-name:hover { color: var(--accent); text-decoration: underline; }
.podium-gold .podium-name { font-size: 1.3rem; }
.podium-code { font-size: 0.82rem; color: var(--fonce); margin-bottom: 8px; }
.podium-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}
.podium-gold .podium-value { font-size: 1.2rem; }
.podium-meta { font-size: 0.78rem; color: var(--fonce); }

@media (max-width: 640px) {
    .dept-ranking-podium {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .podium-gold, .podium-silver, .podium-bronze { min-height: auto; }
}

/* ======= CLASSEMENT CRITERE PAGE ======= */
.classement-critere-page h1 { color: var(--rojo); margin-bottom: 0.5rem; }
.classement-critere-intro { font-size: 1.05rem; color: var(--fonce); line-height: 1.7; margin-bottom: 1.5rem; }

.classement-critere-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.classement-critere-tab {
    display: inline-block;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--fonce);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all var(--transition);
}
.classement-critere-tab:hover { color: var(--rojo); border-color: var(--rojo); text-decoration: none; }
.classement-critere-tab.active {
    background: var(--rojo);
    color: #fff;
    border-color: var(--rojo);
}

.classement-regions { margin-bottom: 2rem; }
.classement-region-group { margin-bottom: 2rem; }
.classement-region-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}
.classement-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.classement-dept-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
}
.classement-dept-link:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.1);
    text-decoration: none;
}
.classement-dept-code {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: var(--rojo);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}
.classement-dept-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rojo);
}

@media (max-width: 575px) {
    .classements-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .classement-card { padding: 20px 14px 18px; }
    .classement-dept-grid { grid-template-columns: 1fr; }
}

/* ======= SECTION ÉDUCATION ======= */

/* ── IPS Gauge ── */
.ips-gauge-container {
    margin: 1.5rem 0;
    padding: 0 0.5rem;
}
.ips-gauge-bar {
    position: relative;
    display: flex;
    height: 14px;
    border-radius: 7px;
    overflow: visible;
    margin-bottom: 6px;
}
.ips-gauge-zone {
    height: 100%;
}
.ips-gauge-zone:first-child {
    border-radius: 7px 0 0 7px;
}
.ips-gauge-zone:last-of-type {
    border-radius: 0 7px 7px 0;
}
.ips-zone-defavorise  { background: #ef4444; }
.ips-zone-modeste     { background: #f97316; }
.ips-zone-mixte       { background: #eab308; }
.ips-zone-favorise    { background: #22c55e; }
.ips-zone-tres-favorise { background: #06b6d4; }

.ips-gauge-marker {
    position: absolute;
    top: -6px;
    transform: translateX(-50%);
    width: 4px;
    height: 26px;
    background: var(--rojo);
    border-radius: 2px;
    z-index: 2;
    box-shadow: 0 0 0 2px #fff;
}
.ips-gauge-marker-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rojo);
    white-space: nowrap;
}
.ips-gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--fonce);
    margin-top: 2px;
}

/* ── IPS Niveaux Grid ── */
.ips-niveaux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 1rem 0 1.5rem;
}
.ips-niveau-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}
.ips-niveau-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}
.ips-niveau-icon {
    color: var(--accent);
    display: flex;
}
.ips-niveau-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--rojo);
}
.ips-niveau-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--fonce);
    background: rgba(0,180,216,0.1);
    padding: 1px 7px;
    border-radius: var(--radius-pill);
}
.ips-niveau-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--rojo);
    line-height: 1.2;
}
.ips-niveau-range {
    font-size: 0.75rem;
    color: var(--fonce);
    margin-top: 4px;
}

/* ── IPS Pills ── */
.ips-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}
.ips-high       { background: rgba(6,182,212,0.12); color: #0e7490; }
.ips-mid        { background: rgba(34,197,94,0.12); color: #15803d; }
.ips-low        { background: rgba(249,115,22,0.12); color: #c2410c; }
.ips-very-low   { background: rgba(239,68,68,0.12); color: #b91c1c; }

/* ── Education Table ── */
.education-table-wrap {
    overflow-x: auto;
    margin: 0.75rem 0 1.5rem;
    -webkit-overflow-scrolling: touch;
}
.education-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.education-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--fonce);
    padding: 8px 12px;
    border-bottom: 2px solid rgba(0,0,0,0.08);
}
.education-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}
.education-table tr:hover td {
    background: rgba(0,180,216,0.04);
}
.education-table .text-right {
    text-align: right;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
}
.badge-niveau {
    background: rgba(15,43,70,0.08);
    color: var(--rojo);
}
.badge-public {
    background: rgba(34,197,94,0.12);
    color: #15803d;
}
.badge-prive {
    background: rgba(139,92,246,0.12);
    color: #6d28d9;
}
.badge-cycle {
    background: rgba(0,180,216,0.1);
    color: #0e7490;
}
.badge-service {
    background: rgba(249,115,22,0.1);
    color: #c2410c;
}

/* ── Education Cards Grid ── */
.education-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin: 0.75rem 0 1.5rem;
}
.education-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.education-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.education-card-header strong {
    font-size: 0.9rem;
    color: var(--rojo);
    line-height: 1.3;
}
.education-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.education-card-contact {
    font-size: 0.8rem;
    color: var(--fonce);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.education-card-contact a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}
.education-card-contact a:hover {
    text-decoration: underline;
}

/* ── Education responsive ── */
@media (max-width: 600px) {
    .ips-gauge-labels { font-size: 0.6rem; }
    .ips-niveaux-grid { grid-template-columns: 1fr 1fr; }
    .education-cards-grid { grid-template-columns: 1fr; }
    .education-table { font-size: 0.8rem; }
    .education-table th,
    .education-table td { padding: 8px 8px; }
}

/* ======= DEPARTEMENT PAGE ======= */
.dept-header { margin-bottom: 2rem; }
.dept-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
}
.dept-code-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--rojo);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    flex-shrink: 0;
}
.dept-header h1 {
    color: var(--rojo);
    margin: 0;
    font-size: 1.8rem;
}
.dept-subtitle {
    color: var(--fonce);
    font-size: 1rem;
    margin: 4px 0 0;
}
.dept-subtitle a { color: var(--accent); text-decoration: none; font-weight: 600; }
.dept-subtitle a:hover { text-decoration: underline; }
.dept-intro-text {
    font-size: 0.95rem;
    color: var(--fonce);
    line-height: 1.65;
    margin: 0 0 1rem;
    max-width: 72ch;
}
.dept-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}
.dept-highlight-tag {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rojo);
    background: rgba(0, 180, 216, 0.1);
    border: 1px solid rgba(0, 180, 216, 0.25);
    padding: 4px 14px;
    border-radius: var(--radius-pill);
}
.section-editorial-text {
    font-size: 0.9rem;
    color: var(--fonce);
    line-height: 1.6;
    margin: -0.25rem 0 1rem;
    max-width: 72ch;
}
.section-cross-links {
    font-size: 0.82rem;
    color: var(--fonce);
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}
.section-cross-links a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.section-cross-links a:hover { text-decoration: underline; }
.region-villes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
.region-ville-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--rojo);
    transition: box-shadow 0.25s cubic-bezier(0.4,0,0.2,1), transform 0.25s;
}
.region-ville-card:hover {
    box-shadow: 0 4px 16px rgba(15,43,70,0.12);
    transform: translateY(-2px);
}
.region-ville-rank {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
}
.region-ville-info { min-width: 0; }
.region-ville-name {
    display: block;
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.region-ville-pop {
    display: block;
    font-size: 0.82rem;
    color: var(--fonce);
    font-weight: 600;
}
.region-ville-meta {
    display: flex;
    gap: 10px;
    font-size: 0.76rem;
    color: var(--fonce);
    margin-top: 2px;
}
@media (max-width: 600px) {
    .region-villes-grid { grid-template-columns: 1fr; }
}
.dept-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 72px;
}
.dept-section h2 {
    color: var(--rojo);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 6px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

/* KPI Grid */
.dept-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.dept-kpi-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dept-kpi-icon { font-size: 1.5rem; line-height: 1; }
.dept-kpi-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--rojo);
    line-height: 1.2;
}
.dept-kpi-value small {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--fonce);
    margin-left: 3px;
}
.dept-kpi-label {
    font-size: 0.8rem;
    color: var(--fonce);
    font-weight: 600;
}
.dept-kpi-range {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Metrics Tables */
.dept-metrics-table {
    overflow-x: auto;
    margin-bottom: 1rem;
}
.dept-metrics-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.dept-metrics-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--rojo);
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}
.dept-metrics-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.dept-metrics-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.dept-metrics-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.dept-metrics-table tbody tr:hover { background: rgba(0,180,216,0.04); }
.dept-metrics-table td:first-child { font-weight: 600; color: var(--rojo); white-space: normal; }

/* Top communes lists */
.dept-top-communes { margin-top: 1rem; }
.dept-top-communes h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rojo);
    margin-bottom: 0.5rem;
}
.dept-top-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: top-rank;
}
.dept-top-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #f0f2f5;
    counter-increment: top-rank;
    font-size: 0.9rem;
}
.dept-top-list li::before {
    content: counter(top-rank) ".";
    font-weight: 800;
    color: var(--accent);
    margin-right: 8px;
    min-width: 20px;
}
.dept-top-list a {
    color: var(--rojo);
    text-decoration: none;
    font-weight: 600;
    flex: 1;
}
.dept-top-list a:hover { color: var(--accent); }
.dept-top-list span {
    color: var(--fonce);
    font-size: 0.82rem;
    white-space: nowrap;
    margin-left: 12px;
}

/* DPE bar chart */
.dept-dpe-bar { margin-bottom: 1rem; }
.dept-dpe-chart {
    display: flex;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 6px;
}
.dept-dpe-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    transition: opacity 0.2s;
}
.dept-dpe-segment:hover { opacity: 0.8; }
.dept-dpe-legend {
    font-size: 0.82rem;
    color: var(--fonce);
    margin: 0;
}

/* Classements grid */
.dept-classements-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.dept-classement-btn {
    display: inline-block;
    padding: 6px 16px;
    background: var(--rojo);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}
.dept-classement-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

/* Commune list */
.dept-letter-heading {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 800;
    margin: 1rem 0 0.3rem;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.dept-commune-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}
.dept-commune-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.88rem;
}
.dept-commune-list a {
    color: var(--rojo);
    text-decoration: none;
    font-weight: 600;
}
.dept-commune-list a:hover { color: var(--accent); }
.dept-commune-cp {
    color: var(--fonce);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* FAQ */
.dept-faq-item {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}
.dept-faq-item summary {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--rojo);
    cursor: pointer;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.6);
}
.dept-faq-item summary:hover { background: rgba(0,180,216,0.05); }
.dept-faq-item[open] summary { border-bottom: 1px solid #e2e8f0; }
.dept-faq-item p {
    padding: 12px 16px;
    margin: 0;
    font-size: 0.9rem;
    color: var(--fonce);
}

/* Editorial text */
.dept-editorial {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--fonce);
}
.dept-editorial p { margin: 0 0 0.6rem; }
.dept-editorial p:last-child { margin-bottom: 0; }
.dept-editorial strong { color: var(--rojo); }
.dept-section-intro {
    font-size: 0.9rem;
    color: var(--fonce);
    line-height: 1.6;
    margin: 0 0 1rem;
}
.dept-section-intro strong { color: var(--rojo); }

/* Comparison badge */
.dept-cmp-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 6px;
}
.dept-cmp-badge--up { background: #dcfce7; color: #166534; }
.dept-cmp-badge--down { background: #fee2e2; color: #991b1b; }
.dept-cmp-badge--neutral { background: #f0f2f5; color: #64748b; }

/* Interactive map */
.dept-map-container {
    position: relative;
    margin-bottom: 1rem;
}
.dept-map-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.dept-map-controls label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rojo);
}
.dept-map-controls select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    color: var(--rojo);
    cursor: pointer;
}
#dept-map {
    width: 100%;
    height: 450px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    z-index: 1;
}
.dept-map-tooltip {
    font-family: Outfit, sans-serif;
    font-size: 0.82rem;
    border-radius: 8px !important;
    padding: 6px 10px !important;
}
.dept-map-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--fonce);
}
.dept-map-legend-bar {
    height: 10px;
    width: 120px;
    border-radius: 5px;
    background: linear-gradient(to right, #AA151B, #d97706);
}

/* Chart containers */
.dept-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 1rem;
}
.dept-chart-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 16px;
}
.dept-chart-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 10px;
}
.dept-chart-wrap {
    position: relative;
    height: 280px;
}

/* Top/Flop section */
.dept-topflop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.dept-topflop-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.dept-topflop-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 8px;
}
.dept-topflop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.85rem;
}
.dept-topflop-row + .dept-topflop-row {
    border-top: 1px solid #f0f2f5;
    margin-top: 4px;
    padding-top: 8px;
}
.dept-topflop-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.dept-topflop-label--top { background: #dcfce7; color: #166534; }
.dept-topflop-label--bottom { background: #fee2e2; color: #991b1b; }
.dept-topflop-commune a {
    color: var(--rojo);
    text-decoration: none;
    font-weight: 600;
}
.dept-topflop-commune a:hover { color: var(--accent); }
.dept-topflop-value {
    font-weight: 700;
    color: var(--rojo);
    font-size: 0.9rem;
    margin-left: 8px;
    white-space: nowrap;
}

.dept-topflop-bar {
    margin: 2px 0 6px;
}
.dept-top-communes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 1rem;
}

/* Top municipios grid */
.dept-top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.dept-top-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); text-decoration: none; color: var(--texte); transition: border-color 0.2s, box-shadow 0.2s; }
.dept-top-card:hover { border-color: var(--rojo); box-shadow: 0 2px 8px rgba(170, 21, 27,0.08); }
.dept-top-rank { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #fee2e2; color: var(--rojo); font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.dept-top-name { font-weight: 600; font-size: 0.92rem; flex: 1; }
.dept-top-pop { font-size: 0.8rem; color: #64748b; white-space: nowrap; }

/* Clasificaciones grid */
.dept-clasif-intro { color: var(--fonce); font-size: 0.95rem; margin-bottom: 1.5rem; }
.dept-clasif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.dept-clasif-group { }
.dept-clasif-theme { font-size: 0.95rem; color: var(--rojo); font-weight: 700; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 2px solid #fee2e2; }
.dept-clasif-list { list-style: none; padding: 0; margin: 0; }
.dept-clasif-list li + li { margin-top: 0.25rem; }
.dept-clasif-list a { display: block; padding: 0.35rem 0.5rem; border-radius: var(--radius); color: var(--texte); text-decoration: none; font-size: 0.88rem; transition: background 0.2s, color 0.2s; }
.dept-clasif-list a:hover { background: #fef2f2; color: var(--rojo); }

@media (max-width: 767px) {
    .dept-top-grid { grid-template-columns: 1fr; }
    .dept-clasif-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .dept-clasif-grid { grid-template-columns: 1fr; }
}

/* Footer inter-départements */
.dept-footer-nav {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
}
.dept-footer-nav h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 1rem;
    text-align: center;
}
.dept-footer-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.dept-footer-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--rojo);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}
.dept-footer-nav-link:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.dept-footer-nav-code {
    font-weight: 700;
    font-size: 0.8rem;
    background: var(--rojo);
    color: #fff;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    line-height: 1.4;
}
.dept-footer-nav-link:hover .dept-footer-nav-code {
    background: rgba(255,255,255,0.3);
}

@media (max-width: 768px) {
    .dept-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dept-header h1 { font-size: 1.4rem; }
    .dept-code-badge { width: 44px; height: 44px; font-size: 1rem; }
    .dept-metrics-table { font-size: 0.82rem; }
    .dept-charts-row { grid-template-columns: 1fr; }
    .dept-chart-wrap { height: 240px; }
    #dept-map { height: 320px; }
    .dept-topflop-grid { grid-template-columns: 1fr; }
    .dept-top-communes-grid { grid-template-columns: 1fr; }
    .dept-footer-nav { padding: 1rem; }
}

/* ======= REGION INDEX CARDS ======= */
.region-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 2rem;
}
.region-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
}
.region-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
}
.region-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rojo);
}
.region-card-stats {
    font-size: 0.85rem;
    color: var(--fonce);
    font-weight: 500;
}
.region-card-pop {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 700;
}
@media (max-width: 575px) {
    .region-cards-grid { grid-template-columns: 1fr; }
}

/* ======= Region SVG Map ======= */
.region-map-section { margin-bottom: 2rem; }
.region-map-container { position: relative; max-width: 500px; margin: 0 auto; }
.region-map-container svg { width: 100%; height: auto; }
.region-map-container svg path { transition: opacity 0.2s; cursor: pointer; }
.region-map-container svg path:hover { opacity: 0.7; stroke: var(--accent) !important; stroke-width: 2px !important; }
.region-map-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.region-map-select { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); font-size: 0.85rem; font-family: inherit; }
.region-map-legend { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--fonce); margin-top: 8px; }
.region-map-gradient { height: 10px; width: 120px; border-radius: 4px; background: linear-gradient(to right, rgb(15,43,70), rgb(0,180,216)); }
.region-map-tooltip { position: absolute; background: var(--rojo); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 0.8rem; pointer-events: none; z-index: 10; white-space: nowrap; opacity: 0; transition: opacity 0.15s; }
.region-map-tooltip.visible { opacity: 1; }

/* ======= Sortable tables ======= */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { background: var(--accent); }
th[data-sort]::after { content: '\21C5'; margin-left: 4px; font-size: 0.7em; opacity: 0.5; }
th[data-sort="asc"]::after { content: '\2191'; opacity: 1; }
th[data-sort="desc"]::after { content: '\2193'; opacity: 1; }

/* ======= Comparison badges ======= */
.cmp-badge { display: inline-block; font-size: 0.7rem; font-weight: 800; padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: middle; }
.cmp-badge-good { background: #dcfce7; color: #166534; }
.cmp-badge-bad { background: #fef2f2; color: #991b1b; }

/* ======= RECHERCHE PAGE ======= */
.recherche-page h1 { color: var(--rojo); }

/* ======= HOMEPAGE ======= */
.home-hero { padding: 3rem 0 2rem; }
.home-hero h1 { color: var(--rojo); margin-bottom: 0.5rem; }
.home-intro { font-size: 1.1rem; line-height: 1.7; color: #212529; max-width: 700px; margin-bottom: 1.5rem; }

.home-dujour { padding: 2rem 0; }
.home-dujour h2 { color: var(--rojo); margin-bottom: 1rem; }

.home-saviez { padding: 0 0 2rem; }

.home-hubs { padding: 1rem 0 2.5rem; }
.home-hubs h2 { color: var(--rojo); margin-bottom: 1rem; }
.home-hubs__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.home-hubs__card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 24px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    text-decoration: none; color: inherit;
    transition: all var(--transition);
    position: relative; overflow: hidden;
}
.home-hubs__card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--accent); opacity: 0;
    transition: opacity var(--transition);
}
.home-hubs__card:hover {
    box-shadow: 0 12px 32px rgba(15,43,70,0.12);
    text-decoration: none;
}
.home-hubs__card:hover::before { opacity: 1; }
.home-hubs__card svg {
    width: 32px; height: 32px; color: var(--accent); flex-shrink: 0;
}
.home-hubs__card h3 {
    font-size: 1.05rem; font-weight: 700; color: var(--rojo); margin: 0;
}
.home-hubs__card p {
    font-size: 0.85rem; color: var(--fonce); line-height: 1.5; margin: 0;
}

.home-carte { padding: 1rem 0 3rem; }
.home-carte h2 { color: var(--rojo); margin-bottom: 0.25rem; }
.home-carte > .container > p { color: var(--fonce); font-size: 1rem; }

@media (max-width: 640px) {
    .home-hubs__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .home-hubs__card { padding: 16px; }
    .home-hubs__card p { display: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ======= SVG MAP (homepage) ======= */
#homesvgmap { max-width: 900px; margin: 2rem auto; padding: 0 20px; }
#homesvgmap svg { width: 100%; height: auto; }
#homesvgmap svg path {
    fill: var(--rojo);
    stroke: #fff;
    stroke-width: 1px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-opacity: .6;
    transition: fill 0.3s;
    cursor: pointer;
}
#homesvgmap svg path:hover { fill: var(--accent); }
#homesvgmap svg a { text-decoration: none; }
#homesvgmap svg a:hover { text-decoration: none; }
#homesvgmap svg rect,
#homesvgmap svg text { pointer-events: none; }

/* Carte comunidad (zoom sur une communauté) */
#comunidadsvgmap { max-width: 500px; margin: 1.5rem auto; padding: 0 20px; }
#comunidadsvgmap svg { width: 100%; height: auto; }
#comunidadsvgmap svg path {
    fill: var(--rojo);
    stroke: #fff;
    stroke-width: 1px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-opacity: .6;
    transition: fill 0.3s, opacity 0.2s;
    cursor: pointer;
}
#comunidadsvgmap svg path:hover { fill: var(--accent); }
#comunidadsvgmap svg a { text-decoration: none; }
#comunidadsvgmap svg rect,
#comunidadsvgmap svg text { display: none; }

/* ======= CAROUSEL (legacy fallback) ======= */
.carousel:not(.carousel--inline) { position: relative; overflow: hidden; border-radius: var(--radius); }
.carousel:not(.carousel--inline) .carousel-track { position: relative; width: 100%; height: 400px; }
.carousel:not(.carousel--inline) .carousel-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.carousel:not(.carousel--inline) .carousel-slide.active { opacity: 1; }
@media (max-width: 767px) { .carousel:not(.carousel--inline) .carousel-track { height: 250px; } }

/* ======= ÉCOLES / ÉTABLISSEMENTS SCOLAIRES ======= */
.ecoles-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #e2e8f0; }
.ecoles-section h2 { color: var(--rojo); font-size: 1.4rem; margin-bottom: 0.3rem; }
.ecoles-subtitle { color: var(--fonce); font-size: 0.95rem; margin-bottom: 1rem; }
.ecoles-compact-note { font-size: 0.85rem; color: #7c8a9e; }
.ecoles-summary-list { margin: 0 0 1rem 1.1rem; color: #334155; }
.ecoles-summary-list li { margin-bottom: 0.28rem; }
.ecoles-kpi-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1rem; }
.ecoles-kpi-pill { display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1px solid #d9e2ef; border-radius: 999px; padding: 5px 12px; font-size: 0.82rem; color: #334155; }
.ecoles-kpi-pill strong { color: var(--rojo); }
.ecoles-summary-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.ecoles-summary-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); overflow: hidden; }
.ecoles-summary-table th, .ecoles-summary-table td { font-size: 0.84rem; padding: 8px 10px; border-bottom: 1px solid #edf2f7; text-align: center; }
.ecoles-summary-table thead th { background: #f8fafc; color: #334155; font-weight: 700; }
.ecoles-summary-table tbody th, .ecoles-summary-table tfoot th { text-align: left; color: #334155; white-space: nowrap; }
.ecoles-summary-table tfoot th, .ecoles-summary-table tfoot td { background: #f8fafc; font-weight: 700; border-bottom: 0; }
.ecoles-open-modal { margin-top: 2px; }
.ecoles-modal-list .ecoles-group:last-child { margin-bottom: 0; }
.ecoles-modal-filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.ecoles-modal-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: #475569; }
.ecoles-modal-filters input, .ecoles-modal-filters select { border: 1px solid #d9e2ef; border-radius: 8px; padding: 7px 9px; font-size: 0.85rem; color: #334155; }
.ecoles-modal-count { margin: 0 0 10px; font-size: 0.82rem; color: #64748b; }
.ecoles-modal-list { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow: auto; }
.ecoles-modal-list .ecole-card[hidden] { display: none; }
.sante-summary-list { margin: 0 0 1rem 1.1rem; color: #334155; }
.sante-summary-list li { margin-bottom: 0.28rem; }
.sante-modal-filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.sante-modal-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: #475569; }
.sante-modal-filters input, .sante-modal-filters select { border: 1px solid #d9e2ef; border-radius: 8px; padding: 7px 9px; font-size: 0.85rem; color: #334155; }
.bpe-modal-filters { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; margin-bottom: 10px; }
.bpe-modal-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: #475569; }
.bpe-modal-filters input, .bpe-modal-filters select { border: 1px solid #d9e2ef; border-radius: 8px; padding: 7px 9px; font-size: 0.85rem; color: #334155; }
.bpe-modal-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.bpe-modal-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 11px; }
.bpe-modal-item[hidden] { display: none; }
.bpe-modal-item-label { color: #1f2937; font-size: 0.9rem; }
.bpe-modal-item-meta { color: #64748b; font-size: 0.78rem; }
.bpe-modal-item-count { color: var(--rojo); font-weight: 700; min-width: 24px; text-align: right; }
.ecoles-types-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.ecoles-type-chip { display: inline-block; background: #fff; border: 1px solid var(--rojo); color: var(--rojo); padding: 4px 12px; border-radius: var(--radius); font-size: 0.82rem; font-weight: 500; }
.ecoles-type-chip small { font-weight: 400; color: var(--fonce); }
.ecoles-group { margin-bottom: 1.5rem; }
.ecoles-group-title { font-size: 1.05rem; color: var(--rojo); margin: 0 0 0.8rem; padding-bottom: 6px; border-bottom: 1px solid #e5e7eb; }
.ecoles-list { display: flex; flex-direction: column; gap: 12px; }
.ecole-card { background: #fff; border: 1px solid #f1f5f9; border-radius: var(--radius); padding: 16px; box-shadow: var(--card-shadow); transition: all var(--transition); }
.ecole-card:hover { box-shadow: 0 4px 16px rgba(15, 43, 70, 0.08); }
.ecole-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.ecole-header .ecole-item-name { display: block; margin: 0; font-size: 1rem; color: #111827; font-weight: 600; flex: 1; }
.ecole-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ecole-badge { display: inline-block; padding: 2px 10px; border-radius: 15px; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.ecole-badge-public { background: #dbeafe; color: #1e40af; }
.ecole-badge-prive { background: #f3f4f6; color: #4b5563; }
.ecole-badge-rep { background: #fef3c7; color: #92400e; }
.ecole-nature { font-size: 0.85rem; color: var(--fonce); font-style: italic; margin-bottom: 6px; }
.ecole-meta { display: flex; flex-direction: column; gap: 3px; font-size: 0.85rem; color: #4b5563; }
.ecole-meta-item strong { color: #111827; }
.ecole-meta-item a { color: var(--rojo); }
.ecole-links { display: flex; gap: 12px; margin-top: 8px; }
.ecole-link { display: inline-block; font-size: 0.82rem; color: var(--rojo); text-decoration: none; border: 1px solid var(--rojo); padding: 3px 10px; border-radius: 6px; transition: background 0.2s, color 0.2s; }
.ecole-link:hover { background: var(--rojo); color: #fff; text-decoration: none; }
.ecole-card--compact { padding: 10px 12px; border-radius: 12px; }
.ecole-card--compact .ecole-nature { display: none; }
.ecole-card--compact .ecole-meta { gap: 1px; font-size: 0.8rem; }
.ecole-card--compact .ecole-links { margin-top: 6px; }
.ecole-card--compact .ecole-link { padding: 2px 8px; font-size: 0.76rem; }
.ecoles-source { font-size: 0.8rem; color: var(--fonce); margin-top: 1rem; }
.ecoles-source a { color: var(--rojo); }
@media (max-width: 640px) {
    .ecoles-modal-filters { grid-template-columns: 1fr; }
    .sante-modal-filters { grid-template-columns: 1fr; }
    .bpe-modal-filters { grid-template-columns: 1fr; }
    .bpe-modal-item { grid-template-columns: 1fr auto; }
    .bpe-modal-item-meta { grid-column: 1 / -1; }
    .ecole-header { flex-direction: column; }
    .ecole-meta { font-size: 0.82rem; }
}

/* ======= REVENUS & NIVEAU DE VIE ======= */
.revenus-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #e2e8f0; }
/* h2 styling inherited from .commune-section h2 */
.revenus-subtitle { color: var(--fonce); font-size: 0.95rem; margin-bottom: 1.5rem; }

.revenus-explainer, .section-explainer { font-size: 0.88rem; color: var(--fonce); line-height: 1.6; margin-bottom: 1.5rem; background: #fff; border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; box-shadow: var(--card-shadow); }
.section-intro { margin-bottom: 1.2rem; }
.section-intro p { font-size: 0.92rem; color: var(--fonce); line-height: 1.6; }

.revenus-kpi-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 2rem; }
.revenus-kpi { flex: 1 1 140px; background: transparent; border-left: 3px solid #e2e8f0; border-radius: 0; padding: 12px 16px; text-align: left; transition: border-color var(--transition); }
.revenus-kpi:hover { border-left-color: var(--accent); }
.revenus-kpi-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--rojo); line-height: 1.2; letter-spacing: -0.02em; }
.revenus-kpi-label { display: block; font-size: 0.78rem; color: var(--fonce); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.revenus-kpi-help { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 4px; line-height: 1.3; }

/* ── Étiquettes DPE / GES ── */
.dpe-etiquettes-row { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; margin-bottom: 2rem; }
.dpe-etiquette-block { flex: 1 1 280px; max-width: 320px; }
.dpe-etiquette-title { font-size: 0.85rem; font-weight: 700; color: var(--fonce); text-align: center; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.dpe-etiquette-wrap { display: flex; flex-direction: column; gap: 3px; }
.dpe-etiquette { display: flex; align-items: center; height: 28px; position: relative; transition: transform 0.2s; }
.dpe-etiquette-bar { display: flex; align-items: center; padding: 0 10px; height: 100%; color: #fff; font-weight: 700; font-size: 0.82rem; border-radius: 3px 0 0 3px; background: var(--bar-color); position: relative; }
.dpe-etiquette-bar::after { content: ''; position: absolute; right: -14px; top: 0; border-top: 14px solid transparent; border-bottom: 14px solid transparent; border-left: 14px solid var(--bar-color); }
.dpe-etiquette[data-class="A"] .dpe-etiquette-bar { width: 60px; }
.dpe-etiquette[data-class="B"] .dpe-etiquette-bar { width: 85px; }
.dpe-etiquette[data-class="C"] .dpe-etiquette-bar { width: 110px; color: #333; }
.dpe-etiquette[data-class="D"] .dpe-etiquette-bar { width: 135px; color: #333; }
.dpe-etiquette[data-class="E"] .dpe-etiquette-bar { width: 160px; }
.dpe-etiquette[data-class="F"] .dpe-etiquette-bar { width: 185px; }
.dpe-etiquette[data-class="G"] .dpe-etiquette-bar { width: 220px; }
.dpe-etiquette--active { transform: scale(1.08); z-index: 1; }
.dpe-etiquette--active .dpe-etiquette-bar { font-size: 1rem; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.dpe-etiquette-value { display: none; margin-left: 20px; font-size: 0.75rem; color: var(--fonce); font-weight: 600; white-space: nowrap; }
.dpe-etiquette--active .dpe-etiquette-value { display: inline-block; }
@media (max-width: 600px) {
    .dpe-etiquette-block { max-width: 260px; }
    .dpe-etiquette[data-class="A"] .dpe-etiquette-bar { width: 48px; }
    .dpe-etiquette[data-class="B"] .dpe-etiquette-bar { width: 68px; }
    .dpe-etiquette[data-class="C"] .dpe-etiquette-bar { width: 88px; }
    .dpe-etiquette[data-class="D"] .dpe-etiquette-bar { width: 108px; }
    .dpe-etiquette[data-class="E"] .dpe-etiquette-bar { width: 128px; }
    .dpe-etiquette[data-class="F"] .dpe-etiquette-bar { width: 148px; }
    .dpe-etiquette[data-class="G"] .dpe-etiquette-bar { width: 176px; }
}

/* ── Logement summary DPE ── */
.logement-dpe-summary { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--card-border); }
.logement-dpe-summary h3 { font-size: 1.05rem; font-weight: 700; color: var(--rojo); margin: 0 0 1rem; }
.logement-dpe-passoires { font-size: 0.88rem; color: var(--fonce); margin-top: 0.75rem; }
.logement-dpe-passoires strong { color: var(--rojo); }

/* ── Badges comparaison DPE (département) ── */
.dpe-kpi-comparison { display: inline-block; font-size: 0.72rem; margin-top: 6px; padding: 2px 8px; border-radius: 8px; line-height: 1.4; }
.dpe-kpi-comparison--down { color: #065f46; background: #d1fae5; }
.dpe-kpi-comparison--up { color: #92400e; background: #fef3c7; }
.dpe-kpi-comparison--neutral { color: var(--fonce); background: #f3f4f6; }

.revenus-chart-block { margin-bottom: 2rem; }
.revenus-chart-block h3 { font-size: 1.05rem; color: var(--rojo); margin-bottom: 0.2rem; font-weight: 600; }
.revenus-chart-desc { font-size: 0.85rem; color: var(--fonce); line-height: 1.5; margin-bottom: 0.8rem; }
.revenus-chart-wrap { position: relative; height: 340px; background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--card-shadow); border: 1px solid #f1f5f9; }
.revenus-chart-wrap-sm { height: 320px; max-width: 480px; }

.revenus-table-title { font-size: 1.1rem; color: #333; margin-bottom: 0.5rem; }
.revenus-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.revenus-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--card-shadow); font-size: 0.9rem; }
.revenus-table th, .revenus-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.revenus-table th { background: var(--rojo); color: #fff; font-weight: 600; font-size: 0.82rem; }
.revenus-table td.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.revenus-table tbody tr:hover { background: #f7f3f0; }

.revenus-source { font-size: 0.8rem; color: var(--fonce); margin-top: 1rem; }
.revenus-source a { color: var(--rojo); }

@media (max-width: 640px) {
    .revenus-kpi-row { gap: 10px; }
    .revenus-kpi { padding: 14px 10px; }
    .revenus-kpi-value { font-size: 1.2rem; }
    .revenus-chart-wrap { height: 280px; padding: 10px; }
    .revenus-chart-wrap-sm { max-width: 100%; }
}

/* ======= EMPLOI / DIPLOMES SECTIONS ======= */
.emploi-section, .diplomes-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #e2e8f0; }
/* h2 styling inherited from .commune-section h2 */

/* ======= POPULATION & DÉMOGRAPHIE ======= */
/* population-section spacing now in universal .commune-section rule */

/* Hero banner */
.pop-hero {
    background: linear-gradient(135deg, var(--rojo) 0%, #5a1a1a 60%, #3b0d0d 100%);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    overflow: hidden;
}
.pop-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(200,80,80,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.pop-hero-main {
    flex: 0 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 160px;
}
.pop-hero-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.03em;
}
.pop-hero-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
    font-weight: 500;
}
.pop-hero-classement {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--accent-text);
    text-decoration: none;
    margin-top: 0.5rem;
    font-weight: 500;
    opacity: 0.85;
    transition: opacity var(--transition);
}
.pop-hero-classement:hover { opacity: 1; text-decoration: underline; }

.pop-hero-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
    position: relative;
    z-index: 1;
}
.pop-hero-stat {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    flex: 1 1 110px;
    text-align: center;
    transition: background var(--transition);
}
.pop-hero-stat:hover { background: rgba(255,255,255,0.13); }
.pop-hero-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.pop-hero-stat-value small { font-size: 0.75rem; font-weight: 400; opacity: 0.7; }
.pop-hero-stat-value--text { font-size: 0.95rem; font-weight: 600; }
.pop-hero-stat-value--up { color: #6ee7b7; }
.pop-hero-stat-value--down { color: #fca5a5; }
.pop-hero-stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 3px;
    font-weight: 500;
}
.pop-hero-stat-badge {
    display: inline-block;
    font-size: 0.65rem;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}
.pop-hero-stat-badge--up { color: #a7f3d0; background: rgba(16,185,129,0.2); }
.pop-hero-stat-badge--down { color: #fde68a; background: rgba(245,158,11,0.2); }
.pop-hero-stat-badge--neutral { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.1); }

/* "Le saviez-vous ?" callout */
.saviez-vous {
    background: linear-gradient(135deg, rgba(0,180,216,0.07) 0%, rgba(15,43,70,0.05) 100%);
    border: 1px solid rgba(0,180,216,0.2);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
}
.saviez-vous-header {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    color: var(--rojo);
}
.saviez-vous-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.saviez-vous-list li {
    font-size: 0.9rem;
    color: var(--fonce);
    line-height: 1.5;
    padding-left: 1.2rem;
    position: relative;
}
.saviez-vous-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}
.saviez-vous-precision {
    display: block;
    font-size: 0.85em;
    font-style: italic;
    opacity: 0.7;
    margin-top: 0.15em;
}
.saviez-vous-precision a {
    font-style: normal;
    color: var(--accent-text);
    text-decoration: none;
    margin-left: 0.3em;
}
.saviez-vous-precision a:hover {
    text-decoration: underline;
}

/* ── Population sub-section titles (full sub-pages) ── */
.population-subsection-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}
.population-subsection-title:first-of-type {
    margin-top: 0.5rem;
}

/* h3 wrapper inside accordion (WAI-ARIA pattern) — visual reset */
.pop-accordion > h3 {
    margin: 0;
    padding: 0;
    font: inherit;
    line-height: inherit;
}

/* ── Population accordions ── */
.pop-accordions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.pop-accordion {
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(15, 43, 70, 0.08);
    box-shadow: 0 2px 12px rgba(15, 43, 70, 0.04);
    transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.pop-accordion::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent) 0%, #0077b6 100%);
    border-radius: var(--radius) 0 0 var(--radius);
    opacity: 0.6;
    transition: opacity 0.25s ease;
}
.pop-accordion:hover {
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.10);
    border-color: rgba(0, 180, 216, 0.18);
}
.pop-accordion:hover::before {
    opacity: 1;
}

/* Trigger */
.pop-accordion-trigger {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    text-align: left;
    transition: background 0.2s ease;
}
.pop-accordion-trigger:hover {
    background: rgba(0, 180, 216, 0.03);
}

/* Icon circle */
.pop-accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.10) 0%, rgba(15, 43, 70, 0.06) 100%);
    color: var(--accent);
    flex-shrink: 0;
    transition: background 0.25s ease, transform 0.25s ease;
}
.pop-accordion-icon--img {
    overflow: hidden;
    padding: 0;
    background: none;
}
.pop-accordion-icon--img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pop-accordion-trigger:hover .pop-accordion-icon {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.18) 0%, rgba(15, 43, 70, 0.08) 100%);
    transform: scale(1.05);
}

/* Text content */
.pop-accordion-content {
    flex: 1;
    min-width: 0;
}
.pop-accordion-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rojo);
    line-height: 1.3;
}
.pop-accordion-subtitle {
    display: block;
    font-size: 0.82rem;
    color: var(--fonce);
    margin-top: 2px;
    line-height: 1.4;
}

/* Year badge */
.pop-accordion-year {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-text);
    background: rgba(0, 180, 216, 0.08);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
}

/* Chevron */
.pop-accordion-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    position: relative;
    margin-left: 4px;
}
.pop-accordion-chevron::before,
.pop-accordion-chevron::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 9px;
    height: 2px;
    background: var(--fonce);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pop-accordion-chevron::before {
    left: 2px;
    transform: rotate(40deg);
}
.pop-accordion-chevron::after {
    right: 2px;
    transform: rotate(-40deg);
}
.accordion-trigger--open .pop-accordion-chevron::before {
    transform: rotate(-40deg);
}
.accordion-trigger--open .pop-accordion-chevron::after {
    transform: rotate(40deg);
}

/* Panel */
.pop-accordion-panel-inner {
    padding: 0 1.25rem 1.25rem;
}

/* Charts grid — 2 columns (legacy, kept for other uses) */
.pop-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.pop-charts-grid--single { grid-template-columns: 1fr; }
.pop-chart-card {
    background: transparent;
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem 0;
}
.pop-chart-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 0.4rem;
}
.pop-chart-card p {
    font-size: 0.82rem;
    color: var(--fonce);
    margin: 0 0 0.75rem;
    line-height: 1.5;
}
.pop-chart-card-year {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--fonce);
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    margin-bottom: 1rem;
    font-weight: 500;
}
.pop-chart-wrap { position: relative; }
.pop-chart-wrap--pyramide { height: 360px; }
.pop-chart-wrap--csp { height: 300px; }
.pop-chart-wrap--evolution { height: 240px; }

/* Evolution sub-section */
.pop-evolution {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}
.pop-evolution h3:first-child {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 0.25rem;
}
.pop-evolution-period {
    font-size: 0.85rem;
    color: var(--fonce);
    margin: 0 0 0.75rem;
    font-weight: 500;
}

/* Inline evolution stats */
.pop-evolution-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    color: #334155;
}
.pop-evolution-stat strong {
    font-weight: 700;
    color: var(--rojo);
}
.pop-evolution-stat small {
    color: var(--fonce);
    font-size: 0.8em;
}
.pop-evolution-sep {
    width: 1px;
    height: 18px;
    background: #cbd5e1;
    flex-shrink: 0;
}
.pop-evolution-chart-desc {
    font-size: 0.8rem;
    color: var(--fonce);
    margin: 0 0 0.5rem;
}

/* ── Population responsive ── */
@media (max-width: 900px) {
    .pop-charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .pop-hero {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1.2rem;
        gap: 1.2rem;
    }
    .pop-hero-main { min-width: auto; }
    .pop-hero-value { font-size: 2.4rem; }
    .pop-hero-stats { justify-content: center; }
    .pop-hero-stat { flex: 1 1 calc(50% - 0.4rem); padding: 0.8rem 0.6rem; }
    .pop-hero-stat-value { font-size: 1.05rem; }
    .pop-chart-wrap--pyramide { height: 300px; }
    .pop-chart-wrap--csp { height: 260px; }
    .pop-chart-wrap--evolution { height: 200px; }
    .pop-evolution-sep { display: none; }
    .pop-evolution-stats { gap: 0.25rem 0.75rem; font-size: 0.82rem; }
    .pop-accordion-trigger { padding: 0.85rem 1rem; gap: 0.75rem; }
    .pop-accordion-icon { width: 38px; height: 38px; border-radius: 10px; }
    .pop-accordion-icon svg { width: 18px; height: 18px; }
    .pop-accordion-title { font-size: 0.92rem; }
    .pop-accordion-subtitle { display: none; }
    .pop-accordion-year { font-size: 0.68rem; padding: 2px 8px; }
    .pop-accordion-panel-inner { padding: 0 1rem 1rem; }
}
/* ── Logement highlights strip ── */
.lgt-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.lgt-highlight {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 43, 70, 0.08);
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    color: #334155;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lgt-highlight:hover {
    border-color: rgba(0, 180, 216, 0.2);
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.08);
}
.lgt-highlight-icon {
    display: flex;
    align-items: center;
    color: var(--accent);
    flex-shrink: 0;
}
.lgt-highlight-text strong {
    font-weight: 700;
    color: var(--rojo);
}
.lgt-highlight-text small {
    color: var(--fonce);
    margin-left: 3px;
    font-size: 0.9em;
}

/* ── Logement charts duo (2 cols) ── */
.lgt-charts-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.lgt-chart-block h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 0.5rem;
}
.lgt-chart-block h4 small {
    font-weight: 500;
    color: var(--fonce);
    font-size: 0.85em;
}

@media (max-width: 700px) {
    .lgt-charts-duo { grid-template-columns: 1fr; }
    .lgt-highlights { gap: 0.4rem; }
    .lgt-highlight { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
}

.emploi-subtitle { color: var(--fonce); font-size: 0.95rem; margin-bottom: 1rem; }
.emploi-comparatif { overflow-x: auto; margin-bottom: 1.5rem; }

/* ======= BREADCRUMB ======= */
.breadcrumb { padding: 14px 0; font-size: 0.82rem; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0; }
.breadcrumb li { color: #94a3b8; }
.breadcrumb li + li::before { content: '\203A'; padding: 0 8px; color: #cbd5e1; }
.breadcrumb li a { color: var(--fonce); text-decoration: none; font-weight: 500; }
.breadcrumb li a:hover { color: var(--accent-text); }
.breadcrumb li[aria-current="page"] { color: var(--rojo); font-weight: 600; }

/* ======= RESPONSIVE ======= */
@media (max-width: 991px) {
    .order-lg-1 { order: 1; }
    .order-lg-2 { order: 2; }
    .pe-lg-5 { padding-right: 15px; }
}

@media (max-width: 767px) {
    .fiche-intro li { font-size: 1.1rem; }
    .fiche-intro li span { font-size: 1.2rem; }
    .classement-item { flex-wrap: wrap; gap: 12px; }
    .classement-item__rank { order: 0; }
    .classement-item__image-link { order: 1; flex-basis: 100%; }
    .classement-item__image, .classement-item--first .classement-item__image { width: 100%; height: 180px; }
    .classement-item__content { order: 2; }
    .classement-row { flex-wrap: wrap; gap: 6px; padding: 10px 0; }
    .classement-row__rank { width: 28px; height: 28px; font-size: 0.72rem; }
    .classement-row__main { flex-basis: calc(100% - 42px); }
    .classement-row__details { flex-basis: 100%; padding-left: 42px; gap: 10px; }
    .classement-row__value { margin-left: auto; }
    .delinquance-table { font-size: 0.9rem; }
    .delinquance-table thead th, .delinquance-table tbody td, .delinquance-table tfoot td { padding: 8px 10px; }
    .accueil-block { padding: 1rem 1.1rem; }
    .accueil-horaires th { width: auto; padding-right: 8px; font-size: 0.85rem; }
    .accueil-horaires td { font-size: 0.85rem; }
    .securite-horaires-compact { font-size: 0.8rem; }
    .delinquance-viz-row { grid-template-columns: 1fr auto; gap: 0.4rem; }
    .delinquance-viz-bar-wrap { display: none; }
    .delinquance-viz-label { font-size: 0.82rem; }
    .delinquance-viz-values { min-width: 60px; }
    .service-communes-grid { grid-template-columns: 1fr; }
    .related-services-grid { grid-template-columns: 1fr; }
    .emergency-grid { grid-template-columns: repeat(2, 1fr); }
    .emergency-number { font-size: 1.5rem; }
    .emergency-useful-link { font-size: 0.82rem; padding: 0.4rem 0.8rem; }
    .delinquance-compare-cards { grid-template-columns: 1fr; }
    .nearby-service-name { font-size: 0.85rem; }
}

/* ======= GUIDE LAYOUT ======= */
.guide-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.guide-sidebar-wrap {
    flex: 0 0 210px;
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: none;
}
.guide-sidebar-wrap::-webkit-scrollbar { display: none; }

.guide-content {
    flex: 1;
    min-width: 0;
}
.guide-content .guide-section-block + .guide-section-block {
    margin-top: 2.5rem;
}

.guide-section {
    margin-bottom: 3rem;
    scroll-margin-top: 72px;
}

/* Override section separators inside guide layout */
.guide-layout .guide-section > section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Sidebar nav */
.guide-sidebar { padding: 0; }
.guide-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.guide-sidebar-group {
    padding: 12px 14px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-top: 6px;
    pointer-events: none;
}
.guide-sidebar-group:first-child { margin-top: 0; }
.guide-sidebar-item { margin-bottom: 1px; }
.guide-sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--fonce);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}
.guide-sidebar-link:hover {
    background: rgba(0, 180, 216, 0.08);
    color: var(--rojo);
    text-decoration: none;
}
.guide-sidebar-link--active,
.guide-sidebar-link.active {
    background: var(--rojo);
    color: #fff;
    font-weight: 600;
}
.guide-sidebar-link--active:hover,
.guide-sidebar-link.active:hover {
    background: var(--rojo);
    color: #fff;
    text-decoration: none;
}

/* ======= Section page header (compact) ======= */
.commune-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.commune-section-header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--rojo);
    font-weight: 700;
}
.commune-section-header-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}
.commune-section-header-meta a { color: var(--rojo); text-decoration: none; }
.commune-section-header-meta a:hover { color: var(--accent-text); text-decoration: none; }
.commune-section-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rojo);
    text-decoration: none;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: rgba(15, 43, 70, 0.06);
    transition: all var(--transition);
}
.commune-section-back:hover { background: var(--rojo); color: #fff; text-decoration: none; }

/* ======= Section page content (no sidebar) ======= */
.commune-section-content {
    max-width: 900px;
    margin: 0 auto;
}
@media (max-width: 600px) {
    .commune-section-header { flex-direction: column; align-items: flex-start; }
}

/* ======= Section nav bottom (sub-page inter-linking) ======= */
.section-nav-bottom {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}
.section-nav-bottom-back {
    margin-bottom: 1.5rem;
    text-align: center;
}
.section-nav-bottom-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: var(--rojo);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all var(--transition);
}
.section-nav-bottom-back-link:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.25);
}
.section-nav-bottom-back-link svg { transition: transform var(--transition); }
.section-nav-bottom-back-link:hover svg { transform: translateX(-3px); }
.section-nav-bottom-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fonce);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 1rem;
    text-align: center;
}
.section-nav-bottom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.section-nav-bottom-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 14px 16px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--rojo);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: var(--card-shadow);
}
.section-nav-bottom-card:hover {
    background: var(--rojo);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(15, 43, 70, 0.15);
    transform: translateY(-1px);
}
.section-nav-bottom-card:hover .section-nav-bottom-icon { color: var(--accent); }
.section-nav-bottom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    transition: color var(--transition);
}
.section-nav-bottom-label { line-height: 1.3; }
@media (max-width: 600px) {
    .section-nav-bottom-grid { grid-template-columns: repeat(2, 1fr); }
    .section-nav-bottom-card { padding: 12px 12px; font-size: 0.82rem; }
}

/* (hero-commune removed – inline carousel replaces it) */

/* ======= KPI CARDS (Guide) ======= */
/* ── Highlight grid (resume section) ── */
.highlight-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 2rem;
}
.highlight-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 16px 10px 14px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.highlight-chip[href] {
    cursor: pointer;
}
a.highlight-chip:not([href]) {
    cursor: default;
}
.highlight-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition);
}
.highlight-chip:hover {
    box-shadow: 0 6px 20px rgba(15, 43, 70, 0.1);
}
.highlight-chip:hover::before {
    opacity: 1;
}
/* Category colors on top bar */
.highlight-chip[data-category="economie"]::before { background: #10b981; }
.highlight-chip[data-category="climat"]::before { background: #0ea5e9; }
.highlight-chip[data-category="terroir"]::before { background: #a855f7; }
.highlight-chip[data-category="patrimoine"]::before { background: #f59e0b; }
.highlight-chip[data-category="geo"]::before { background: #6366f1; }
.highlight-chip[data-category="logement"]::before { background: #f97316; }
.highlight-chip[data-category="demo"]::before { background: #ec4899; }
.highlight-chip[data-category="identite"]::before { background: var(--rojo); }
.highlight-chip[data-category="environnement"]::before { background: #22c55e; }
.highlight-chip[data-category="empresas"]::before { background: #14b8a6; }
.highlight-chip[data-category="transporte"]::before { background: #6366f1; }
.highlight-chip[data-category="turismo"]::before { background: #f59e0b; }
.highlight-chip[data-category="elecciones"]::before { background: #8b5cf6; }
.highlight-chip[data-category="curiosidades"]::before { background: #ef4444; }

.highlight-chip-icon {
    width: 22px;
    height: 22px;
    color: var(--fonce);
    flex-shrink: 0;
}
.highlight-chip-icon svg {
    width: 100%;
    height: 100%;
}
/* Category icon colors */
.highlight-chip[data-category="economie"] .highlight-chip-icon { color: #10b981; }
.highlight-chip[data-category="climat"] .highlight-chip-icon { color: #0ea5e9; }
.highlight-chip[data-category="terroir"] .highlight-chip-icon { color: #a855f7; }
.highlight-chip[data-category="patrimoine"] .highlight-chip-icon { color: #f59e0b; }
.highlight-chip[data-category="geo"] .highlight-chip-icon { color: #6366f1; }
.highlight-chip[data-category="logement"] .highlight-chip-icon { color: #f97316; }
.highlight-chip[data-category="demo"] .highlight-chip-icon { color: #ec4899; }
.highlight-chip[data-category="identite"] .highlight-chip-icon { color: var(--rojo); }
.highlight-chip[data-category="environnement"] .highlight-chip-icon { color: #22c55e; }
.highlight-chip[data-category="empresas"] .highlight-chip-icon { color: #14b8a6; }
.highlight-chip[data-category="transporte"] .highlight-chip-icon { color: #6366f1; }
.highlight-chip[data-category="turismo"] .highlight-chip-icon { color: #f59e0b; }
.highlight-chip[data-category="elecciones"] .highlight-chip-icon { color: #8b5cf6; }
.highlight-chip[data-category="curiosidades"] .highlight-chip-icon { color: #ef4444; }

.highlight-chip-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rojo);
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.highlight-chip-label {
    font-size: 0.7rem;
    color: var(--fonce);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .highlight-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .highlight-chip {
        padding: 12px 8px 10px;
    }
    .highlight-chip-value {
        font-size: 1rem;
    }
}
@media (max-width: 400px) {
    .highlight-grid {
        gap: 6px;
    }
    .highlight-chip {
        padding: 10px 6px 8px;
    }
    .highlight-chip-icon {
        width: 18px;
        height: 18px;
    }
    .highlight-chip-value {
        font-size: 0.9rem;
    }
}

.kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 2rem;
}
.kpi-card {
    flex: 1 1 140px;
    background: transparent;
    border-left: 3px solid #e2e8f0;
    border-radius: 0;
    padding: 12px 16px;
    text-align: left;
    transition: border-color var(--transition);
}
.kpi-card:hover {
    border-left-color: var(--accent);
}
.kpi-card-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--rojo); line-height: 1.2; letter-spacing: -0.02em; }
.kpi-card-label { display: block; font-size: 0.78rem; color: var(--fonce); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.kpi-card-help { font-size: 0.72rem; color: #94a3b8; cursor: help; margin-left: 4px; }
.kpi-card-comparison { display: inline-block; font-size: 0.72rem; margin-top: 6px; padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 600; }
.kpi-card-comparison--up { color: #065f46; background: #d1fae5; }
.kpi-card-comparison--down { color: #92400e; background: #fef3c7; }
.kpi-card-comparison--neutral { color: var(--fonce); background: #f1f5f9; }
.kpi-card-link { display: block; font-size: 0.72rem; color: var(--accent-text); margin-top: 6px; text-decoration: none; font-weight: 500; }
.kpi-card-link:hover { color: var(--rojo); }

/* ======= SECTION SEE-MORE CTA ======= */
.section-see-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 1.2rem;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: var(--rojo);
    border: none;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all var(--transition);
    letter-spacing: 0.01em;
}
.section-see-more:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3); }
.section-see-more::after { content: '\2192'; font-size: 1.1em; transition: transform var(--transition); }
.section-see-more:hover::after { transform: translateX(3px); }

/* ======= SECTION SOURCE (unified) ======= */
.section-source { font-size: 0.8rem; color: var(--fonce); margin-top: 1rem; }
.section-source a { color: var(--rojo); }
.section-source a:hover { color: var(--rouge); }

/* ======= CURIOSITÉS ======= */
.curiosite-detail-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
}
.curiosite-detail-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rojo);
    margin: 0 0 0.5rem;
}
.curiosite-detail-card p {
    font-size: 0.95rem;
    color: var(--fonce);
    line-height: 1.6;
    margin: 0;
}

/* ======= ACCORDION ======= */
.accordion { margin-bottom: 0.75rem; border: 1px solid #e2e8f0; border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow var(--transition); }
.accordion:hover { box-shadow: 0 2px 12px rgba(15, 43, 70, 0.06); }
.accordion-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--rojo);
    text-align: left;
    transition: background var(--transition);
}
.accordion-trigger:hover { background: #f8fafc; }
.accordion-trigger-text { flex: 1; }
.accordion-trigger-icon { flex-shrink: 0; margin-left: 12px; font-size: 0.65rem; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); color: var(--fonce); }
.accordion-trigger-icon::after { content: '\25BC'; display: inline-block; }
.accordion-trigger--open .accordion-trigger-icon::after { transform: rotate(180deg); }
.accordion-panel { overflow: hidden; transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.accordion-panel-inner { padding: 0 18px 18px; }

/* guide-deep-dive removed — all sections now render directly */

/* ======= MODAL ======= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 43, 70, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-container {
    background: #fff;
    border-radius: var(--radius);
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(15, 43, 70, 0.25);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.modal-title { margin: 0; font-size: 1.1rem; color: var(--rojo); font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.modal-close:hover { background: #f1f5f9; color: var(--rouge); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

/* ======= GUIDE: MOBILE FAB & BOTTOM SHEET ======= */
.guide-fab {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--rojo);
    color: #fff;
    box-shadow: 0 4px 20px rgba(15, 43, 70, 0.35);
    cursor: pointer;
    font-size: 1.4rem;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.guide-fab:hover { background: var(--accent); }
.guide-fab svg { width: 22px; height: 22px; fill: currentColor; }

.guide-bottom-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 950;
}
.guide-bottom-sheet--open { display: block; }
.guide-bottom-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 43, 70, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.guide-bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1;
    box-shadow: 0 -8px 32px rgba(15, 43, 70, 0.2);
}
.guide-bottom-sheet-content .guide-sidebar-list { display: flex; flex-direction: column; }
.guide-bottom-sheet-content .guide-sidebar-link { padding: 12px 14px; font-size: 0.92rem; }
.guide-bottom-sheet-content .guide-sidebar-group { font-size: 0.72rem; }

/* ======= GUIDE: SECTION TITLE ======= */
.guide-section-title {
    font-size: 1.3rem;
    color: var(--rojo);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    font-weight: 700;
}

/* ======= GUIDE: MODAL TRIGGER LINK ======= */
.modal-trigger-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--rojo);
    text-decoration: none;
    border: 1.5px solid var(--rojo);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    margin-top: 1rem;
    cursor: pointer;
    background: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    transition: all var(--transition);
}
.modal-trigger-link:hover {
    background: var(--rojo);
    color: #fff;
    text-decoration: none;
}

/* ======= GUIDE: INFOS PRATIQUES (collapsible detail) ======= */
.infos-pratiques { margin-top: 1.5rem; }
.infos-pratiques summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--rojo);
    font-size: 0.9rem;
    padding: 8px 0;
}
.infos-pratiques summary:hover { color: var(--rouge); }

/* ======= RESPONSIVE: GUIDE ======= */
@media (max-width: 991px) {
    .guide-container { flex-direction: column; gap: 0; }
    .guide-sidebar-wrap {
        position: static;
        flex: none;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 2rem;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    .guide-sidebar-wrap::-webkit-scrollbar { display: none; }
    .guide-sidebar-list { display: flex; flex-wrap: nowrap; gap: 4px; }
    .guide-sidebar-link { white-space: nowrap; padding: 8px 14px; font-size: 0.82rem; }
    .guide-sidebar-group { display: none; }
    .guide-content .guide-section-block + .guide-section-block { margin-top: 2.2rem; }
    .guide-group--alt { margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; }
    .commune-section h2 .section-toggle { width: 22px; height: 22px; font-size: 0.65rem; }
}

@media (max-width: 767px) {
    .guide-sidebar-wrap { display: none; }
    .guide-fab { display: flex; }
    .kpi-card { flex: 1 1 calc(50% - 6px); padding: 10px 12px; }
    .kpi-card-value { font-size: 1.2rem; }
    .modal-container { border-radius: var(--radius); max-height: 90vh; }
    .modal-body { padding: 16px; }
    .guide-section-title { font-size: 1.15rem; }
    .guide-group--alt { margin-left: -0.75rem; margin-right: -0.75rem; padding-left: 0.75rem; padding-right: 0.75rem; }
    .commune-section h2 .section-toggle { width: 20px; height: 20px; }
}

@media (max-width: 575px) {
    .kpi-card { flex: 1 1 calc(50% - 6px); }
}

/* ── Responsive 480px / 320px audit fixes ── */
@media (max-width: 480px) {
    /* Prevent horizontal overflow globally */
    html, body { overflow-x: hidden; }

    /* Container padding */
    .container { padding: 0 14px; }

    /* Section h2 titles */
    .commune-section h2 { font-size: 1.25rem; padding-right: 30px; }
    .commune-section h2 span { font-size: 0.95rem; }
    .commune-section h2 .section-toggle { width: 20px; height: 20px; font-size: 0.6rem; top: 4px; }

    /* Min-widths that overflow */
    .site-dropdown { min-width: min(280px, calc(100vw - 40px)); }
    .search-input { min-width: 0; }
    .services-search-input { min-width: 0; }
    .dpe-etiquette-block { flex-basis: 100%; max-width: none; }
    .dpe-etiquettes-row { gap: 1rem; }
    .logement-card { min-width: 0; flex-basis: 100%; }
    .revenus-kpi { flex-basis: 100%; }

    /* Pop-hero tighter */
    .pop-hero { padding: 1.2rem 1rem; gap: 1rem; }
    .pop-hero-value { font-size: 2rem; }
    .pop-hero-stat { flex: 1 1 calc(50% - 0.3rem); padding: 0.6rem 0.5rem; }
    .pop-hero-stat-value { font-size: 0.95rem; }

    /* Hero / fiche intro */
    .hero-title { font-size: 1.5rem; }
    .fiche-intro li { font-size: 1rem; }
    .fiche-intro li span { font-size: 1.05rem; }

    /* Logement card values */
    .logement-card-value { font-size: 1.5rem; }

    /* KPI grid — force 2 columns max */
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Classement items — smaller gap */
    .classement-item { gap: 14px; }
    .classement-item__image { width: 120px; height: 85px; }
    .classement-item--first .classement-item__image { width: 160px; height: 110px; }

    /* Classement row */
    .classement-row__details { gap: 8px; }

    /* Pop-filter chips */
    .pop-filter { padding: 12px 14px; }
    .pop-filter__chip { padding: 5px 10px; font-size: 0.8rem; }

    /* Home hubs grid — stack to 1 col */
    .home-hubs__grid { grid-template-columns: 1fr; gap: 10px; }
    .home-hubs__card { padding: 14px; }
    .home-hubs__card p { display: none; }

    /* Section see-more button */
    .section-see-more { font-size: 0.82rem; padding: 8px 18px; }

    /* Buttons */
    .btn { padding: 8px 18px; font-size: 0.85rem; }

    /* Pop accordion */
    .pop-accordion-trigger { padding: 0.7rem 0.8rem; }
    .pop-accordion-icon { width: 32px; height: 32px; border-radius: 8px; }

    /* Climat */
    .cl-chart { height: 220px; }
    .cl-table thead th,
    .cl-table td { padding: 4px 4px; font-size: 0.72rem; }

    /* IPS niveaux */
    .ips-niveaux-grid { grid-template-columns: 1fr; }
    .ips-niveau-card { padding: 12px; }

    /* DVF grid — single column */
    .dvf-ventes-grid { grid-template-columns: 1fr; }

    /* Header logo */
    .site-logo { font-size: 1.05rem; }
    .site-header .container { gap: 8px; }

    /* Region cards — already 1fr at 575px, ensure padding */
    .region-card { padding: 14px 12px; }

    /* Classements index grid — single column */
    .classements-grid { grid-template-columns: 1fr; gap: 10px; }
    .classement-card { padding: 18px 12px 16px; }
    .classement-card-title { font-size: 0.95rem; }

    /* Dept page */
    .dept-kpi-grid { grid-template-columns: 1fr; }
    .dept-header h1 { font-size: 1.25rem; }

    /* Tables — ensure scroll wrapper */
    .table-simple { font-size: 0.82rem; }
    .table-simple th, .table-simple td { padding: 6px 8px; }

    /* Palmares grid */
    .palmares-grid { grid-template-columns: 1fr; }

    /* Labels showcase */
    .labels-showcase { grid-template-columns: 1fr; }

    /* Appellations grid */
    .appellations-grid { grid-template-columns: 1fr; }

    /* Section nav bottom */
    .section-nav-bottom-grid { grid-template-columns: 1fr; }
    .section-nav-bottom-card { padding: 10px 12px; font-size: 0.8rem; }

    /* Carousel */
    .carousel:not(.carousel--inline) .carousel-track { height: 220px; }

    /* Chart container */
    .chart-container { max-width: 100%; }

    /* Commune footer */
    .commune-footer-neighbor { padding: 10px 12px; }
    .commune-footer-neighbor-name { font-size: 0.82rem; }
    .commune-footer-classement-card { padding: 10px 12px; gap: 0.65rem; }
    .commune-footer-classement-position { font-size: 1.1rem; }
    .commune-footer-classement-label { font-size: 0.82rem; }

    /* Services filters */
    .services-filters { padding: 0.8rem; gap: 8px; }
    .services-search-input { min-width: 0; padding: 8px 12px; font-size: 0.85rem; }
    .services-dept-select { min-width: 0; width: 100%; padding: 8px 32px 8px 12px; font-size: 0.85rem; }

    /* Env card */
    .env-card { padding: 14px 12px; }

    /* Jardin card */
    .jardin-card { padding: 14px 12px; }

    /* BPE */
    .bpe-category { padding: 12px 14px; }

    /* Education */
    .education-card { padding: 10px 12px; }

    /* Delinquance table first-child */
    .delinquance-history td:first-child,
    .delinquance-history th:first-child { min-width: 130px; }

    /* Transport card */
    .transport-card { padding: 14px 12px; }
    .transport-card-meta { gap: 4px 8px; font-size: 0.82rem; }

    /* Connectivite */
    .connectivite-block { padding: 14px 12px; }
    .connectivite-zone-blanche { padding: 10px 12px; font-size: 0.85rem; }

    /* Proximity */
    .proximity-block { padding: 14px 12px; }
    .proximity-grid { grid-template-columns: 1fr; gap: 12px; }
    .proximity-item { font-size: 0.85rem; }

    /* Hero banner */
    .commune-hero-banner { height: 200px; }
    .commune-gradient-banner { padding: 24px 0 20px; }

    /* Hero labels */
    .commune-hero-label { font-size: 0.7rem; padding: 3px 8px 3px 4px; gap: 4px; }
    .commune-hero-label img { width: 18px; height: 18px; }
    .commune-hero-labels { gap: 4px; }

    /* Pop hero */
    .pop-hero-stat { flex: 1 1 100%; }

    /* Highlight chips */
    .highlight-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
    .highlight-chip { padding: 8px 4px 6px; }
    .highlight-chip-value { font-size: 0.9rem; }
    .highlight-chip-label { font-size: 0.62rem; }

    /* Commune title */
    .commune-title { font-size: 1.6rem; }

    /* Breadcrumb */
    .breadcrumb { font-size: 0.75rem; padding: 10px 0; }

    /* Commune quick facts */
    .commune-quick-facts { grid-template-columns: 1fr; gap: 6px; }

    /* Search form */
    .search-form { gap: 8px; }

    /* Legal pages */
    .legal-page { padding: 24px 14px 40px; }
    .legal-page h1 { font-size: 1.4rem; }

    /* Classements commune search */
    .classements-commune-search { padding: 1.2rem; }
    .classements-commune-search h2 { font-size: 1.1rem; }

    /* DPE etiquette bars */
    .dpe-etiquette-block { max-width: 100%; }
}

@media (max-width: 360px) {
    .container { padding: 0 10px; }
    .commune-section h2 { font-size: 1.15rem; margin-bottom: 1.2rem; padding-right: 26px; }
    .commune-section h2 span { font-size: 0.88rem; }
    .commune-section h2 .section-toggle { width: 18px; height: 18px; font-size: 0.55rem; }
    .pop-hero-value { font-size: 1.8rem; }
    .kpi-card { padding: 8px 10px; }
    .kpi-card-value { font-size: 1.05rem; }
    .revenus-kpi-value { font-size: 1.25rem; }

    /* Commune title */
    .commune-title { font-size: 1.35rem; }

    /* Grids — force single column */
    .palmares-grid,
    .classements-grid,
    .appellations-grid,
    .commune-footer-classements { grid-template-columns: 1fr; }

    /* Classement items — stack image */
    .classement-item { gap: 12px; }
    .classement-item__image { width: 100%; height: 140px; }
    .classement-item--first .classement-item__image { width: 100%; height: 160px; }
    .classement-item__image-link { flex-shrink: 1; width: 100%; }

    /* Classement row details — wrap */
    .classement-row { gap: 8px; flex-wrap: wrap; }
    .classement-row__details { gap: 8px; }

    /* Coverage bars */
    .coverage-bar-label { flex: 0 0 65px; font-size: 0.78rem; }
    .coverage-bar-value { flex: 0 0 45px; font-size: 0.78rem; }
    .coverage-bar-row { gap: 8px; }

    /* Mobile coverage grid */
    .mobile-grid-header,
    .mobile-grid-row { grid-template-columns: 90px repeat(4, 1fr); }
    .mobile-grid-cell { padding: 6px 4px; font-size: 0.72rem; }
    .mobile-grid-operator { font-size: 0.72rem; }
    .mobile-grid-tech { font-size: 0.72rem; }
    .coverage-dot { width: 20px; height: 20px; font-size: 0.65rem; }

    /* Biodiversite bars */
    .bio-groupe-label { width: 60px; font-size: 0.75rem; }
    .bio-groupe-count { width: 45px; font-size: 0.72rem; }
    .bio-groupe-row { gap: 6px; }

    /* Proximity */
    .proximity-block { padding: 12px 10px; }
    .proximity-grid { grid-template-columns: 1fr; gap: 10px; }

    /* Transport */
    .transport-card { padding: 12px 10px; }
    .transport-card-meta { gap: 4px 6px; font-size: 0.78rem; }

    /* Connectivite */
    .connectivite-block { padding: 12px 10px; }
    .connectivite-zone-blanche { padding: 8px 10px; font-size: 0.82rem; }

    /* Section nav bottom */
    .section-nav-bottom-grid { grid-template-columns: 1fr; }
    .section-nav-bottom-card { padding: 8px 10px; font-size: 0.78rem; }

    /* Hero banner */
    .commune-hero-banner { height: 180px; }
    .commune-gradient-banner { padding: 20px 0 16px; }

    /* Hero labels */
    .commune-hero-label { font-size: 0.65rem; padding: 2px 6px 2px 3px; gap: 3px; }
    .commune-hero-label img { width: 16px; height: 16px; }
    .commune-hero-labels { gap: 3px; }

    /* Highlight chips — smaller */
    .highlight-chip { padding: 6px 3px 5px; }
    .highlight-chip-value { font-size: 0.82rem; }
    .highlight-chip-label { font-size: 0.58rem; }
    .highlight-chip-icon { width: 16px; height: 16px; }

    /* Cards footer */
    .commune-footer-neighbor { padding: 8px 10px; }
    .commune-footer-neighbor-name { font-size: 0.78rem; }
    .commune-footer-classement-card { padding: 8px 10px; gap: 0.5rem; }
    .commune-footer-classement-position { font-size: 1rem; }
    .commune-footer-classement-label { font-size: 0.78rem; }

    /* Services filters */
    .services-filters { padding: 0.6rem; gap: 6px; }
    .services-search-input { padding: 7px 10px; font-size: 0.82rem; }
    .services-dept-select { padding: 7px 30px 7px 10px; font-size: 0.82rem; }

    /* Env card */
    .env-card { padding: 12px 10px; }

    /* Jardin card */
    .jardin-card { padding: 12px 10px; }

    /* BPE */
    .bpe-category { padding: 10px 12px; }

    /* Education */
    .education-card { padding: 8px 10px; }

    /* DVF */
    .dvf-ventes-grid { grid-template-columns: 1fr; }
    .dvf-vente-card { padding: 10px 12px; }

    /* Delinquance table first-child */
    .delinquance-history td:first-child,
    .delinquance-history th:first-child { min-width: 110px; }

    /* Search form */
    .search-input { min-width: 0; padding: 10px 14px; font-size: 0.88rem; }

    /* Buttons */
    .btn { padding: 7px 14px; font-size: 0.82rem; }
    .section-see-more { font-size: 0.78rem; padding: 7px 14px; }

    /* Logement card value */
    .logement-card-value { font-size: 1.3rem; }

    /* Pop accordion */
    .pop-accordion-trigger { padding: 0.6rem 0.7rem; }
    .pop-accordion-icon { width: 28px; height: 28px; border-radius: 7px; }

    /* Climat */
    .cl-chart { height: 200px; }
    .cl-table thead th,
    .cl-table td { padding: 3px 3px; font-size: 0.68rem; }

    /* IPS niveaux */
    .ips-niveaux-grid { grid-template-columns: 1fr; }

    /* Fiche intro */
    .fiche-intro li { font-size: 0.88rem; }
    .fiche-intro li span { font-size: 0.92rem; }

    /* Logo header */
    .site-logo { font-size: 0.95rem; }
    .site-header .container { gap: 6px; }

    /* KPI grid — single column at 320px */
    .kpi-grid { grid-template-columns: 1fr; gap: 8px; }

    /* Carousel */
    .carousel:not(.carousel--inline) .carousel-track { height: 180px; }

    /* Hero title */
    .hero-title { font-size: 1.3rem; }

    /* Pop-filter chips */
    .pop-filter { padding: 10px 10px; }
    .pop-filter__chip { padding: 4px 8px; font-size: 0.75rem; }

    /* Dept page */
    .dept-header h1 { font-size: 1.1rem; }
    .dept-code-badge { width: 38px; height: 38px; font-size: 0.9rem; }

    /* Classements commune search */
    .classements-commune-search { padding: 1rem; }
    .classements-commune-search h2 { font-size: 1rem; }
    .classements-commune-search-input { padding: 10px 14px; font-size: 0.88rem; }

    /* Home hubs */
    .home-hubs__card { padding: 12px; }

    /* DPE etiquette bars — scale down */
    .dpe-etiquette-bar { font-size: 0.72rem; padding: 0 6px; }
    .dpe-etiquette[data-class="F"] .dpe-etiquette-bar { width: 150px; }
    .dpe-etiquette[data-class="G"] .dpe-etiquette-bar { width: 180px; }

    /* Commune quick facts */
    .commune-quick-facts { gap: 5px; padding: 8px 10px; }
    .commune-quick-facts li { font-size: 0.78rem; }

    /* Legal page */
    .legal-page { padding: 16px 10px 32px; }
    .legal-page h1 { font-size: 1.25rem; }
    .legal-page h2 { font-size: 1rem; }

    /* Footer */
    .footer-regions { column-count: 1; }
    .site-footer { padding: 32px 0 24px; }

    /* Breadcrumb */
    .breadcrumb { font-size: 0.7rem; padding: 8px 0; }
    .breadcrumb li + li::before { padding: 0 5px; }

    /* Region card */
    .region-card { padding: 12px 10px; }
    .region-card-name { font-size: 0.92rem; }

    /* Table sortable */
    .table-sortable th { font-size: 0.78rem; padding: 6px 6px; }
    .table-sortable td { font-size: 0.82rem; padding: 6px 6px; }
}

/* ======= COMPACT CARD SUMMARIES (patrimoine) ======= */
.monument-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.monument-meta-inline {
    font-size: 0.85rem;
    color: var(--fonce);
}
.monument-meta-inline + .monument-meta-inline::before {
    content: '\2022';
    margin-right: 8px;
    color: #ccc;
}

/* Modal detail blocks */
.monument-description-block {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.monument-description-block h4 {
    font-size: 0.95rem;
    color: var(--rojo);
    margin: 0 0 8px;
}
.monument-description-block p {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.7;
    margin: 0;
}
.monument-detail-modal .monument-meta,
.jardin-detail-modal .jardin-meta,
.maison-detail-modal .maison-meta,
.musee-detail-modal .musee-meta,
.acr-detail-modal .acr-meta {
    margin-top: 12px;
}

/* ======= MODAL ANIMATIONS ======= */
.modal-backdrop {
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-backdrop[style*="display: flex"] {
    opacity: 1;
}
.modal-container {
    transform: translateY(16px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-backdrop[style*="display: flex"] .modal-container {
    transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════════════════════════════
   Transport & Mobilité section
   ═══════════════════════════════════════════════════════════════ */
.transport-sub-heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(15, 43, 70, 0.08);
}
.transport-list { display: flex; flex-direction: column; gap: 12px; }
.transport-card { background: #fff; border: 1px solid #f1f5f9; border-radius: var(--radius); padding: 18px 20px; transition: all var(--transition); box-shadow: var(--card-shadow); }
.transport-card:hover { box-shadow: 0 8px 28px rgba(15, 43, 70, 0.1); }
.transport-card-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.transport-card-header .transport-item-name { display: block; font-size: 1.05rem; margin: 0; color: #1a1a1a; }
.transport-badge { font-size: 0.75rem; padding: 2px 10px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.badge-gare { background: #e3ecf5; color: #2b5e8c; }
.badge-gratuit { background: #d4edda; color: #1a6b3c; }
.badge-covoiturage { background: #e8e3f3; color: #5a3d7a; }
.badge-aeroport { background: #f0e8d8; color: #7a5c2e; }
.transport-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.88rem; color: #5a5a5a; margin-bottom: 6px; }
.transport-meta-inline { display: inline; }
.transport-meta-inline::before { content: ''; }
.transport-card-meta .transport-meta-inline + .transport-meta-inline::before { content: '·  '; color: #aaa; }
.transport-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.transport-tag { font-size: 0.78rem; padding: 2px 10px; border-radius: 20px; background: #eef3f8; color: #3a5a7a; }
.transport-card-address { font-size: 0.88rem; color: #666; margin: 4px 0; }
.transport-card-actions { margin-top: 8px; }
.transport-map-link { font-size: 0.85rem; color: #2b5e8c; text-decoration: none; font-weight: 500; }
.transport-map-link:hover { text-decoration: underline; }
.borne-detail-modal .transport-meta-item { margin-bottom: 6px; font-size: 0.92rem; }
.gare-card { border-left: 3px solid #2b5e8c; }
.borne-card { border-left: 3px solid #3a9e5c; }
.covoiturage-card { border-left: 3px solid #7a5c9e; }
.aeroport-card { border-left: 3px solid #b8860b; }

/* --- Transport Proximity --- */
.proximity-block { background: #fff; border: 1px solid #f1f5f9; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; box-shadow: var(--card-shadow); }
.proximity-block h3 { font-size: 1.1rem; margin: 0 0 16px; color: #1a1a1a; }
.proximity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.proximity-column h4 { font-size: 0.92rem; font-weight: 600; color: #2b5e8c; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid #e3ecf5; }
.proximity-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; font-size: 0.92rem; border-bottom: 1px solid #eee; }
.proximity-item:last-child { border-bottom: none; }
.proximity-item--tgv { font-weight: 600; }
.proximity-name { flex: 1; color: #1a1a1a; }
.proximity-code { color: #888; font-size: 0.82rem; }
.proximity-distance { white-space: nowrap; font-weight: 600; color: #2b5e8c; }
.proximity-map-link { font-size: 0.8rem; color: #2b5e8c; text-decoration: none; white-space: nowrap; }
.proximity-map-link:hover { text-decoration: underline; }
.proximity-note { font-size: 0.82rem; color: #888; margin: 12px 0 0; font-style: italic; }

/* --- Biodiversité (GBIF) --- */
.bio-summary { margin-bottom: 16px; }
.bio-total { font-size: 1rem; font-weight: 600; color: #1a1a1a; margin: 0; }
.bio-groupes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.bio-groupe-row { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.bio-groupe-label { width: 110px; flex-shrink: 0; color: #374151; font-weight: 500; text-align: right; }
.bio-groupe-bar-wrap { flex: 1; height: 18px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.bio-groupe-bar { height: 100%; border-radius: 4px; min-width: 2px; transition: width 0.3s ease; }
.bio-groupe-count { width: 70px; flex-shrink: 0; text-align: right; font-weight: 600; color: #374151; font-size: 0.82rem; }
.bio-top-especes { margin-top: 4px; }
.bio-top-especes h4 { font-size: 0.92rem; font-weight: 600; color: #2b5e8c; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid #e3ecf5; }
.bio-especes-list { display: flex; flex-direction: column; gap: 2px; max-height: 480px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.bio-especes-list::-webkit-scrollbar { width: 5px; }
.bio-especes-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.bio-espece-item { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; border-bottom: 1px solid #f1f5f9; }
.bio-espece-item:last-child { border-bottom: none; }
.bio-espece-rank { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #e3ecf5; color: #2b5e8c; font-size: 0.72rem; font-weight: 700; border-radius: 50%; }
.bio-espece-info { flex: 1; min-width: 0; }
.bio-espece-nom { display: block; font-weight: 500; color: #1a1a1a; font-size: 0.9rem; }
.bio-espece-sci { display: block; font-style: italic; color: #6b7280; font-size: 0.8rem; }
.bio-espece-obs { flex-shrink: 0; font-weight: 600; color: #2b5e8c; font-size: 0.85rem; white-space: nowrap; }
.bio-source-note { font-size: 0.8rem; color: #9ca3af; margin: 14px 0 0; font-style: italic; }
.bio-source-note a { color: #2b5e8c; text-decoration: none; }
.bio-source-note a:hover { text-decoration: underline; }
@media (max-width: 640px) {
    .bio-groupe-label { width: 80px; font-size: 0.8rem; }
    .bio-groupe-count { width: 55px; font-size: 0.78rem; }
}

/* ── Déchèteries proches ────────────────────────────────────────── */
.decheteries-list { display: flex; flex-direction: column; gap: 14px; }
.decheterie-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); padding: 14px 16px; transition: border-color 0.2s; }
.decheterie-item:hover { border-color: var(--accent); }
.decheterie-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.decheterie-rank { width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--rojo); color: #fff; font-size: 0.82rem; font-weight: 700; border-radius: 50%; }
.decheterie-info { flex: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.decheterie-nom { font-size: 0.95rem; color: #1a1a1a; }
.decheterie-distance { font-size: 0.82rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.decheterie-details { padding-left: 40px; display: flex; flex-direction: column; gap: 4px; }
.decheterie-detail { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #475569; }
.decheterie-detail svg { color: #94a3b8; flex-shrink: 0; }
.decheterie-detail a { color: #475569; text-decoration: none; }
.decheterie-detail a:hover { color: var(--accent); text-decoration: underline; }
.decheterie-types { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; padding-left: 40px; }
.decheterie-type-tag { display: inline-block; padding: 2px 8px; background: #e0f2fe; color: #0369a1; font-size: 0.72rem; font-weight: 500; border-radius: var(--radius-pill); white-space: nowrap; }
.decheterie-type-more { background: #f1f5f9; color: #64748b; }
.env-card { background: #fff; border: 1px solid #f1f5f9; border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--card-shadow); }
.env-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.env-card-icon { font-size: 1.5rem; }
.env-card-header strong { font-size: 1rem; color: #1a1a1a; display: block; }
.env-card-subtitle { font-size: 0.85rem; color: #64748b; }
@media (max-width: 640px) {
    .decheterie-details { padding-left: 0; }
    .decheterie-types { padding-left: 0; }
    .decheterie-info { flex-direction: column; gap: 2px; }
}

/* ── Connectivité & numérique ────────────────────────────────────── */
.connectivite-block { background: #fff; border: 1px solid #f1f5f9; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px; box-shadow: var(--card-shadow); }
.connectivite-block h3 { font-size: 1.1rem; margin: 0 0 12px; color: #1a1a1a; }
.connectivite-subtitle { font-size: 0.88rem; color: #666; margin: 0 0 16px; }

/* Coverage bars (fibre / THD / HD) */
.coverage-bars { display: flex; flex-direction: column; gap: 12px; }
.coverage-bar-row { display: flex; align-items: center; gap: 12px; }
.coverage-bar-label { flex: 0 0 160px; font-size: 0.9rem; font-weight: 500; color: #333; }
.coverage-bar-track { flex: 1; height: 22px; background: #e8edf2; border-radius: 11px; overflow: hidden; position: relative; }
.coverage-bar-fill { height: 100%; border-radius: 11px; transition: width 0.6s ease; min-width: 2px; }
.coverage-bar-fill--fibre { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.coverage-bar-fill--thd { background: linear-gradient(90deg, #059669, #34d399); }
.coverage-bar-fill--hd { background: linear-gradient(90deg, #d97706, #fbbf24); }
.coverage-bar-value { flex: 0 0 65px; font-size: 0.9rem; font-weight: 600; color: #1a1a1a; text-align: right; }

/* Technologies tags */
.connectivite-techs { margin-top: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.connectivite-techs-label { font-size: 0.85rem; color: #666; margin-right: 4px; }
.connectivite-tech-tag { font-size: 0.78rem; padding: 3px 12px; border-radius: 20px; background: #eef3f8; color: #2b5e8c; font-weight: 500; }

/* Mobile coverage grid */
.mobile-grid { border: 1px solid #d4dfe8; border-radius: 10px; overflow: hidden; }
.mobile-grid-header { display: grid; grid-template-columns: 180px repeat(4, 1fr); background: #f0f4f8; }
.mobile-grid-row { display: grid; grid-template-columns: 180px repeat(4, 1fr); border-top: 1px solid #e8edf2; }
.mobile-grid-row:hover { background: #f8fafc; }
.mobile-grid-cell { padding: 10px 12px; display: flex; align-items: center; justify-content: center; font-size: 0.88rem; }
.mobile-grid-corner { justify-content: flex-start; }
.mobile-grid-tech { font-weight: 600; color: #2b5e8c; font-size: 0.85rem; }
.mobile-grid-operator { justify-content: flex-start; font-weight: 500; color: #333; }

/* Coverage dots */
.coverage-dot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-size: 0.85rem; font-weight: 700; }
.coverage-dot--yes { background: #d1fae5; color: #065f46; }
.coverage-dot--no { background: #fee2e2; color: #991b1b; }

/* Zone blanche alert */
.connectivite-zone-blanche { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 10px; padding: 14px 18px; font-size: 0.92rem; color: #92400e; }

/* Responsive */
@media (max-width: 640px) {
    .coverage-bar-label { flex: 0 0 80px; font-size: 0.82rem; }
    .coverage-bar-value { flex: 0 0 50px; font-size: 0.82rem; }
    .mobile-grid-header,
    .mobile-grid-row { grid-template-columns: 120px repeat(4, 1fr); }
    .mobile-grid-cell { padding: 8px 6px; font-size: 0.8rem; }
    .mobile-grid-operator { font-size: 0.8rem; }
    .coverage-dot { width: 24px; height: 24px; font-size: 0.75rem; }
}

/* ======= CLIMAT SECTION — REDESIGN ======= */

/* --- Page layout --- */
.cl-page { }

/* cl-hero/cl-title/cl-metrics removed — climat now uses .pop-hero */

/* --- Summary & station --- */
.cl-summary {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.75;
    margin: 1rem 0;
    max-width: 80ch;
}
.cl-station {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0.5rem 0 0;
}

/* --- Section blocks --- */
.cl-block {
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
}
.cl-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 0.3rem;
    letter-spacing: -0.01em;
}
.cl-intro {
    font-size: 0.88rem;
    color: var(--fonce);
    margin: 0 0 1.25rem;
    line-height: 1.5;
}
.cl-sub-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 0.25rem;
}
.cl-sub-chart {
    margin-top: 2rem;
}

/* --- Charts --- */
.cl-chart {
    position: relative;
    height: 340px;
    width: 100%;
}
.cl-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* --- Indices climatiques --- */
.cl-indices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 32px;
}
.cl-index-row {
    padding: 12px 0;
}
.cl-index-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.cl-index-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}
.cl-index-score {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.cl-index-score small {
    font-size: 0.6em;
    font-weight: 600;
    color: #94a3b8;
}
.cl-index-track {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.cl-index-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.cl-index-detail {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* --- Seasons --- */
.cl-seasons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: hidden;
}
.cl-season {
    padding: 20px 16px;
    border-left: 3px solid var(--season-color);
    background: #fff;
    position: relative;
}
.cl-season + .cl-season {
    border-top: none;
}
.cl-season:not(:last-child) {
    border-right: 1px solid #f1f5f9;
}
.cl-season-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}
.cl-season-emoji {
    font-size: 1.5rem;
    line-height: 1;
}
.cl-season-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rojo);
}
.cl-season-temp {
    font-size: 0.82rem;
    color: var(--fonce);
    font-weight: 500;
}
.cl-season-facts {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cl-season-facts li::before {
    content: "·";
    margin-right: 6px;
    color: #9ca3af;
    font-weight: 700;
}
.cl-season-text {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* --- Comparison table --- */
.cl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    border-radius: var(--radius);
    overflow: hidden;
}
.cl-table thead th {
    text-align: center;
    padding: 10px 12px;
    background: var(--rojo);
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}
.cl-table thead th:first-child {
    text-align: left;
    padding-left: 16px;
}
.cl-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cl-table td:first-child {
    text-align: left;
    padding-left: 16px;
    color: #555;
    font-size: 0.85rem;
}
.cl-table tbody tr:hover {
    background: #f8fafc;
}
.cl-table--striped tbody tr:nth-child(even) {
    background: #fafbfc;
}
.cl-table--striped tbody tr:hover {
    background: #f0f4f8;
}
.cl-row-highlight td {
    font-weight: 600;
    color: var(--rojo);
    background: rgba(0, 180, 216, 0.04);
}

/* --- Records --- */
.cl-records {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cl-record {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.cl-record:last-child {
    border-bottom: none;
}
.cl-record-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}
.cl-record-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.cl-record-label {
    font-size: 0.82rem;
    color: var(--fonce);
}
.cl-record-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rojo);
}
.cl-record-date {
    font-size: 0.78rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* --- Risks --- */
.cl-risk {
    margin-bottom: 1.5rem;
}
.cl-risk:last-child {
    margin-bottom: 0;
}
.cl-risk-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 0.5rem;
}
.cl-risk p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}
.cl-risk-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}
.cl-risk-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.cl-risk-item-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.cl-risk-item-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
}
.cl-risk-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cl-risk-tag {
    display: inline-block;
    font-size: 0.8rem;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background: #fef3c7;
    color: #92400e;
    font-weight: 500;
}

/* ======= TOURISME : modal buttons & cards ======= */
.tourisme-modal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.25rem;
}
.tourisme-modal-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.88rem;
    color: var(--rojo);
    text-decoration: none;
    border: 1.5px solid var(--rojo);
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    background: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    transition: all var(--transition);
}
.tourisme-modal-btn:hover {
    background: var(--rojo);
    color: #fff;
}
.tourisme-subtitle {
    font-size: 0.92rem;
    color: var(--fonce);
    margin: 0 0 1rem;
}
.tourisme-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tourisme-card {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}
.tourisme-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.tourisme-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rojo);
}
.tourisme-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: #fef3c7;
    color: #92400e;
}
.tourisme-badge--mention {
    background: #e0f2fe;
    color: #0369a1;
}
.tourisme-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--fonce);
}
.tourisme-meta-inline {
    display: inline-flex;
    align-items: center;
}
.tourisme-type-tag {
    font-weight: 600;
    color: var(--rojo);
}
.tourisme-link {
    color: var(--accent-text);
    font-weight: 600;
    text-decoration: none;
}
.tourisme-link:hover {
    text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    /* cl-metrics responsive removed — using .pop-hero now */
    .cl-indices { grid-template-columns: 1fr; }
    .cl-seasons { grid-template-columns: repeat(2, 1fr); }
    .cl-season:nth-child(3) { border-top: 1px solid #f1f5f9; }
}

@media (max-width: 640px) {
    /* cl-title/metrics responsive removed — using .pop-hero now */
    .cl-seasons {
        grid-template-columns: 1fr;
    }
    .cl-season:not(:first-child) {
        border-top: 1px solid #f1f5f9;
    }
    .cl-season:not(:last-child) {
        border-right: 1px solid #e2e8f0;
    }
    .cl-chart { height: 280px; }
    .cl-table { font-size: 0.8rem; }
    .cl-table thead th,
    .cl-table td { padding: 5px 6px; }
    .cl-table td:first-child { padding-left: 8px; }
    .cl-badge-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .cl-record { gap: 10px; padding: 12px 0; }
    .cl-record-value { font-size: 0.95rem; }
    .cl-risk-items { flex-direction: column; gap: 8px; }
}

/* ======= COMMUNE FOOTER LINKS (maillage interne) ======= */
.commune-footer-links {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.commune-footer-section { }
.commune-footer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rojo);
    margin: 0 0 1.2rem;
}
.commune-footer-title svg { color: var(--accent); flex-shrink: 0; }

/* ── Neighbors grid ── */
.commune-footer-neighbors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}
.commune-footer-neighbor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 12px 16px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--rojo);
    transition: all var(--transition);
    box-shadow: var(--card-shadow);
}
.commune-footer-neighbor:hover {
    background: var(--rojo);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(15, 43, 70, 0.15);
    transform: translateY(-1px);
}
.commune-footer-neighbor-name {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
}
.commune-footer-neighbor-pop {
    font-size: 0.75rem;
    color: var(--fonce);
    white-space: nowrap;
    flex-shrink: 0;
}
.commune-footer-neighbor:hover .commune-footer-neighbor-pop { color: rgba(255,255,255,0.7); }

/* ── Classements grid ── */
.commune-footer-classements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.commune-footer-classement-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 14px 18px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition);
}
.commune-footer-classement-card:hover { box-shadow: 0 4px 16px rgba(15, 43, 70, 0.1); }
.commune-footer-classement-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 50px;
}
.commune-footer-classement-position {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-text);
    line-height: 1.1;
}
.commune-footer-classement-total {
    font-size: 0.72rem;
    color: var(--fonce);
}
.commune-footer-classement-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.commune-footer-classement-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rojo);
}
.commune-footer-classement-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.commune-footer-classement-links a {
    font-size: 0.78rem;
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 500;
}
.commune-footer-classement-links a:hover { color: var(--rojo); text-decoration: underline; }
.commune-footer-classement-sep { color: #cbd5e1; font-size: 0.75rem; }
.commune-footer-all-classements {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: var(--rojo);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all var(--transition);
}
.commune-footer-all-classements:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.25);
}
.commune-footer-all-classements svg { transition: transform var(--transition); }
.commune-footer-all-classements:hover svg { transform: translateX(3px); }

@media (max-width: 600px) {
    .commune-footer-neighbors { grid-template-columns: 1fr; }
    .commune-footer-classements { grid-template-columns: 1fr; }
    .commune-footer-title { font-size: 1.05rem; }
}

/* ======= COMPARE LINE (inline comparison) ======= */
.compare-line {
    font-size: 0.82rem;
    color: var(--fonce);
    margin: 0.35rem 0 0;
    line-height: 1.4;
    font-style: italic;
}
.compare-line a {
    color: var(--accent-text);
    text-decoration: none;
    font-style: normal;
    font-weight: 500;
}
.compare-line a:hover {
    text-decoration: underline;
}

/* ======= EXPLORAPUEBLOS: Custom styles ======= */

/* KPI mini cards (commune intro) */
.commune-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0;
}
.kpi-mini {
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
}
.kpi-mini__value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rojo);
    line-height: 1.2;
}
.kpi-mini__label {
    font-size: 0.8rem;
    color: var(--fonce);
    font-weight: 400;
}

/* KPI grid (sections) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

/* Chart container */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 20px 0;
}

/* Table simple (sections data) */
.table-simple {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin: 16px 0;
}
.table-simple th,
.table-simple td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    text-align: left;
}
.table-simple th {
    font-weight: 600;
    color: var(--rojo);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.table-simple tr:hover {
    background: rgba(170, 21, 27, 0.03);
}

/* Section details (expandable) */
.section-details {
    margin: 20px 0;
}
.section-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--rojo);
    padding: 8px 0;
}
.section-details summary:hover {
    color: var(--accent);
}

/* Section placeholder */
.section-placeholder {
    color: var(--fonce);
    font-style: italic;
    padding: 20px;
    text-align: center;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
}

/* Commune subtitle */
.commune-subtitle {
    color: var(--fonce);
    font-size: 1.05rem;
    margin: -8px 0 16px;
}

/* Commune CP */
.commune-cp {
    font-size: 0.9rem;
    color: var(--fonce);
}

/* Search results */
.search-results {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}
.search-result-card {
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}
.search-result-card:hover {
    box-shadow: 0 4px 16px rgba(170, 21, 27, 0.1);
    border-color: var(--accent);
}
.search-result-card strong {
    color: var(--rojo);
}
.search-result-meta {
    font-size: 0.85rem;
    color: var(--fonce);
}

/* Classement no-image placeholder */
.classement-item__noimage {
    background: linear-gradient(135deg, var(--accent-light), #fff);
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
}
.classement-item__pop {
    font-size: 0.85rem;
    color: var(--fonce);
    display: block;
    margin-top: 2px;
}
.classement-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

/* Clasificaciones grid */
.clasificaciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0 32px;
}
.clasificacion-card {
    display: block;
    padding: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}
.clasificacion-card:hover {
    box-shadow: 0 4px 20px rgba(170, 21, 27, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.clasificacion-card h3 {
    color: var(--rojo);
    margin: 0 0 6px;
    font-size: 1.05rem;
}
.clasificacion-card p {
    color: var(--fonce);
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.4;
}
.clasificacion-card__unite {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 10px;
    background: var(--accent-light);
    color: var(--accent-text);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
}

/* Clasificacion nav (province selector) */
.clasificacion-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}
.clasificacion-nav__link {
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--rojo);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all var(--transition);
}
.clasificacion-nav__link:hover,
.clasificacion-nav__link--active {
    background: var(--rojo);
    color: #fff;
}
.clasificacion-nav__select {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    font-size: 0.9rem;
    color: var(--rojo);
    cursor: pointer;
}

/* Clasificacion criteres selector */
.clasificacion-criteres {
    margin: 12px 0 24px;
}
.clasificacion-criteres summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-text);
    font-size: 0.9rem;
}
.clasificacion-criteres__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.clasificacion-criteres__grid a {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--fonce);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all var(--transition);
}
.clasificacion-criteres__grid a:hover {
    border-color: var(--accent);
    color: var(--rojo);
}
.clasificacion-criteres__grid a.active {
    background: var(--rojo);
    color: #fff;
    border-color: var(--rojo);
}

/* Clasificacion table */
.cl-table { margin: 0; }
.cl-rank {
    font-weight: 700;
    color: var(--accent-text);
    min-width: 40px;
}
.cl-value {
    color: var(--rojo);
    white-space: nowrap;
}

/* Dept alpha nav (province page) */
.dept-alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0;
}
.dept-alpha-nav .alpha-link,
.alpha-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--rojo);
    text-decoration: none;
    transition: all var(--transition);
}
.alpha-link:hover {
    background: var(--rojo);
    color: #fff;
}

.dept-alpha-group {
    margin: 24px 0 8px;
}
.dept-alpha-letter {
    font-size: 1.3rem;
    color: var(--rojo);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
    display: inline-block;
}

/* Table sortable */
.table-sortable {
    width: 100%;
    border-collapse: collapse;
}
.table-sortable th,
.table-sortable td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    text-align: left;
}
.table-sortable th {
    cursor: pointer;
    font-weight: 600;
    color: var(--rojo);
    font-size: 0.85rem;
    user-select: none;
}
.table-sortable th:hover {
    color: var(--accent);
}
.table-sortable tbody tr:hover {
    background: rgba(170, 21, 27, 0.03);
}

/* ======= RESPONSIVE: 320px-480px custom classes ======= */
@media (max-width: 480px) {
    /* Container */
    .container { padding: 0 12px; }

    /* KPI grids — single column */
    .kpi-grid { grid-template-columns: 1fr; gap: 10px; }
    .commune-kpis { flex-direction: column; gap: 10px; }
    .kpi-mini { flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px; }
    .kpi-mini__value { font-size: 1.1rem; }
    .classement-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    /* Clasificaciones grid */
    .clasificaciones-grid { grid-template-columns: 1fr; }
    .clasificacion-card { padding: 14px; }
    .clasificacion-card h3 { font-size: 0.95rem; }

    /* Clasificacion nav */
    .clasificacion-nav { flex-direction: column; gap: 8px; }
    .clasificacion-nav__select { width: 100%; }
    .clasificacion-nav__link { text-align: center; }
    .clasificacion-criteres__grid { gap: 6px; }
    .clasificacion-criteres__grid a { font-size: 0.75rem; padding: 5px 10px; }

    /* Tables — horizontal scroll */
    .table-simple, .table-sortable, .cl-table { font-size: 0.82rem; }
    .table-simple th, .table-simple td,
    .table-sortable th, .table-sortable td { padding: 6px 8px; }
    .table-simple { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Charts */
    .chart-container { max-width: 100%; }

    /* Search results */
    .search-results { gap: 6px; }
    .search-result-card { padding: 10px 14px; }
    .search-form { flex-direction: column; }
    .search-input { width: 100%; border-radius: var(--radius-sm); }

    /* Alpha nav (provincia) */
    .dept-alpha-nav { gap: 4px; }
    .dept-alpha-nav .alpha-link, .alpha-link { width: 28px; height: 28px; font-size: 0.75rem; }

    /* Highlight chips */
    .highlight-grid { gap: 6px; }
    .highlight-chip { padding: 6px 10px; font-size: 0.82rem; }

    /* Classement items (top 9) */
    .classement-top-list { gap: 12px; }
    .classement-item { flex-direction: column; }
    .classement-item__image { width: 100%; max-width: none; height: 160px; }
    .classement-item__rank { font-size: 1.1rem; }

    /* Classement rows */
    .classement-row { flex-wrap: wrap; gap: 4px; padding: 8px 0; }
    .classement-row__value { font-size: 0.85rem; }

    /* Dept KPI grid */
    .dept-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dept-kpi-card { padding: 12px; }
    .dept-kpi-value { font-size: 1.3rem; }

    /* Region cards */
    .region-cards-grid { grid-template-columns: 1fr; }

    /* Pop hero */
    .pop-hero { flex-direction: column; gap: 10px; padding: 16px; }
    .pop-hero-stat { padding: 8px 12px; }

    /* Section headings */
    .commune-section h2 { font-size: 1.2rem; }
    .commune-section h3 { font-size: 1rem; }
    h1 { font-size: 1.4rem; }

    /* Commune intro */
    .commune-intro-body { flex-direction: column; }
    .commune-intro-media { flex: 0 0 auto; max-width: 100%; }

    /* Map modal */
    .map-modal-container { width: 100%; height: 100%; border-radius: 0; }

    /* Footer grid */
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }

    /* Home hubs */
    .home-hubs__grid { grid-template-columns: 1fr; }

    /* Accordion triggers */
    .accordion-trigger { font-size: 0.95rem; padding: 10px 0; }

    /* Election bars */
    .election-bar-container { min-width: 0; }

    /* Pop-filter */
    .pop-filter__options { flex-direction: column; }
    .pop-filter__label { font-size: 0.82rem; }
}

/* ======= ACCESSIBILITY: Reduced motion ======= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ======= PAGE 404 ======= */
.error-404 { padding: 3rem 0 4rem; }
.error-404-header { text-align: center; margin-bottom: 2.5rem; }
.error-404-code { display: block; font-size: 6rem; font-weight: 800; color: var(--rojo); line-height: 1; opacity: 0.15; }
.error-404-header h1 { font-size: 1.8rem; color: var(--rojo); margin: 0.5rem 0; }
.error-404-text { color: var(--fonce); font-size: 1.05rem; max-width: 500px; margin: 0 auto; }

.error-404-search { max-width: 520px; margin: 0 auto 2.5rem; }
.error-404-search-wrap { display: flex; border: 2px solid var(--rojo); border-radius: var(--radius); overflow: hidden; background: #fff; }
.error-404-search-input { flex: 1; border: none; padding: 0.85rem 1rem; font-size: 1rem; outline: none; font-family: inherit; }
.error-404-search-btn { background: var(--rojo); color: #fff; border: none; padding: 0 1.2rem; cursor: pointer; display: flex; align-items: center; }
.error-404-search-btn:hover { background: #991b1b; }

.error-404-suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.error-404-section h2 { font-size: 1.1rem; color: var(--rojo); margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid #fee2e2; }
.error-404-list { list-style: none; padding: 0; margin: 0; }
.error-404-list li + li { margin-top: 0.4rem; }
.error-404-list a { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem; border-radius: var(--radius); color: var(--texte); text-decoration: none; font-size: 0.92rem; transition: background 0.2s; }
.error-404-list a:hover { background: #fef2f2; color: var(--rojo); }
.error-404-meta { margin-left: auto; font-size: 0.8rem; color: #94a3b8; }
.error-404-prov-code { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #fee2e2; color: var(--rojo); font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }

@media (max-width: 767px) {
    .error-404-suggestions { grid-template-columns: 1fr; gap: 1.5rem; }
    .error-404-code { font-size: 4rem; }
    .error-404-header h1 { font-size: 1.4rem; }
}
