/* ═══════════════════════════════════════════════════════════════════════════
   aire-covoiturage.fr — Design System
   Light/Dark mode avec accents vert émeraude
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables — Light Mode (défaut) ────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-body: #f5f7fa;
    --bg-primary: #ffffff;
    --bg-secondary: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f7f9fb;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-light: rgba(255, 255, 255, 0.6);
    --bg-input: #ffffff;

    /* Primary – Emerald */
    --primary: #059669;
    --primary-light: #10B981;
    --primary-dark: #047857;
    --primary-glow: rgba(5, 150, 105, 0.1);
    --primary-glow-strong: rgba(5, 150, 105, 0.2);

    /* Accent colors by type */
    --color-parking: #2563EB;
    --color-autoroute: #D97706;
    --color-supermarche: #DB2777;
    --color-relais: #7C3AED;
    --color-delaisse: #6B7280;
    --color-autostop: #DC2626;

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders */
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-primary: rgba(5, 150, 105, 0.3);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.1);

    /* Spacing */
    --container-max: 1280px;
    --header-height: 64px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ─── CSS Variables — Dark Mode ──────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-body: #080b12;
    --bg-primary: #0d1117;
    --bg-secondary: #151a25;
    --bg-card: #1a2030;
    --bg-card-hover: #212840;
    --bg-glass: rgba(21, 26, 37, 0.85);
    --bg-glass-light: rgba(26, 32, 48, 0.6);
    --bg-input: rgba(21, 26, 37, 0.9);

    --primary: #10B981;
    --primary-light: #34D399;
    --primary-dark: #059669;
    --primary-glow: rgba(16, 185, 129, 0.2);
    --primary-glow-strong: rgba(16, 185, 129, 0.35);

    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #5e6b80;
    --text-inverse: #0d1117;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-primary: rgba(16, 185, 129, 0.3);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
}

/* ─── Theme toggle button ────────────────────────────────────────────────── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-left: 4px;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--border-primary);
    background: var(--primary-glow);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    width: 18px;
    height: 18px;
}

/* Hide sun in light mode, moon in dark mode */
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }

[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* Light mode badge adjustments */
.badge-type {
    background: var(--primary-glow);
    color: var(--primary-dark);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

[data-theme="dark"] .badge-type {
    color: var(--primary-light);
}

.badge-places {
    background: rgba(37, 99, 235, 0.08);
    color: #2563EB;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .badge-places {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
    border-color: rgba(59, 130, 246, 0.2);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

img { max-width: 100%; }
ul, ol { list-style: none; }

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.4; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.section-title {
    margin-bottom: 32px;
}

.section-title span {
    color: var(--primary);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.logo svg {
    color: var(--primary);
}

.logo:hover {
    color: var(--primary-light);
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform var(--transition);
    border-radius: 1px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main {
    padding-top: var(--header-height);
    min-height: calc(100vh - 80px);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

/* Grille de points en fond (Dot matrix) ultra subtile */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--text-muted) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15; /* Très discret */
}

/* Carte de France en fond (Watermark géant) */
.hero::after {
    content: '';
    position: absolute;
    top: 35%; /* Remonté (était à 50%) */
    left: 75%; /* Décalé vers la droite (était à 50%) */
    transform: translate(-50%, -50%);
    width: 120vw;
    max-width: 1100px;
    height: 1200px;
    background-image: url('../img/france_green_map.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.25; /* "Moins opaque" => Plus visible (ou l'inverse selon l'interprétation, on le cale à 25% pour un bel équilibre) */
    pointer-events: none;
    z-index: 1;
    filter: grayscale(100%) sepia(100%) hue-rotate(100deg) brightness(1.2) saturate(2);
}

.hero > * {
    position: relative;
    z-index: 2;
}

.hero h1 {
    margin-bottom: 16px;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* ─── Stats ──────────────────────────────────────────────────────────────── */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 28px;
    text-align: center;
    min-width: 150px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ─── Search ─────────────────────────────────────────────────────────────── */
.search-box {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-glow);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 20px;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* ─── Map ────────────────────────────────────────────────────────────────── */
.map-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    margin-bottom: 50px;
}

.map-container.map-home {
    height: 500px;
}

.map-container.map-dept {
    height: 450px;
}

.map-container.map-aire {
    height: 350px;
}

#map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

/* Leaflet overrides for dark theme */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
}

.leaflet-popup-content {
    margin: 14px 16px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
}

.leaflet-popup-content a {
    color: var(--primary-light) !important;
}

.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: var(--text-primary) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

.leaflet-control-attribution {
    background: var(--bg-glass) !important;
    color: var(--text-muted) !important;
    font-size: 0.7rem !important;
}

.leaflet-control-attribution a {
    color: var(--text-secondary) !important;
}

/* Custom cluster markers */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
    background: var(--primary-glow-strong) !important;
}

.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* Dept marker on home map */
.dept-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s;
}

.dept-marker:hover {
    transform: scale(1.15);
}

/* ─── Department Grid ────────────────────────────────────────────────────── */
.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.dept-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.dept-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.dept-code {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
    text-align: center;
    line-height: 1;
}

.dept-info {
    flex: 1;
    min-width: 0;
}

.dept-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dept-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ─── Aire List / Table ──────────────────────────────────────────────────── */
.aire-list {
    display: grid;
    gap: 12px;
}

.aire-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.aire-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-primary);
    transform: translateX(4px);
}

.aire-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.aire-item-name a {
    color: var(--text-primary);
}

.aire-item-name a:hover {
    color: var(--primary-light);
}

.aire-item-commune {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 2px;
}

.aire-item-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.aire-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
    white-space: nowrap;
}

.badge-ouvert {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

[data-theme="dark"] .badge-ouvert {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
}

.badge-ferme {
    background: rgba(220, 38, 38, 0.08);
    color: #DC2626;
}

[data-theme="dark"] .badge-ferme {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary-light);
}

.breadcrumb .sep {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ─── Aire Detail Page ───────────────────────────────────────────────────── */
.aire-hero {
    padding: 30px 0 20px;
}

.aire-hero h1 {
    margin-bottom: 8px;
}

.aire-hero .aire-location {
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aire-hero .aire-location svg {
    color: var(--primary);
    flex-shrink: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition);
}

.info-card:hover {
    border-color: var(--border-primary);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-card-header svg {
    color: var(--primary);
    flex-shrink: 0;
}

.info-card-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-card-value.small {
    font-size: 0.92rem;
    font-weight: 400;
}

/* ─── Action Buttons ─────────────────────────────────────────────────────── */
.action-buttons {
    display: flex;
    gap: 12px;
    margin: 30px 0 40px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--text-inverse);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

.btn-waze {
    background: #33ccff;
    color: #000;
}

.btn-waze:hover {
    background: #21b8eb;
    color: #000;
    box-shadow: 0 0 15px rgba(51, 204, 255, 0.3);
}

/* ─── SEO Text Block ─────────────────────────────────────────────────────── */
.seo-text {
    margin-top: 40px;
    padding: 28px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition);
}

.seo-text:hover {
    border-color: var(--border-primary);
    border-left-color: var(--primary-light);
}

.seo-text h2 {
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.seo-text p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.75;
    margin-bottom: 12px;
}

.seo-text p:last-child {
    margin-bottom: 0;
}

.seo-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.seo-text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-primary);
    transition: all var(--transition-fast);
}

.seo-text a:hover {
    color: var(--primary-light);
    text-decoration-color: var(--primary-light);
}

/* ─── Nearby Aires ───────────────────────────────────────────────────────── */
.nearby-section {
    margin-top: 50px;
}

.nearby-section h2 {
    margin-bottom: 20px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-brand {
    max-width: 350px;
}

.footer-brand .logo {
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-links h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    max-width: var(--container-max);
    margin: 30px auto 0;
    padding: 20px 20px 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom a {
    color: var(--text-secondary);
}

/* ─── Page département ───────────────────────────────────────────────────── */
.page-dept-header {
    padding: 30px 0 20px;
}

.page-dept-header h1 {
    margin-bottom: 8px;
}

.page-dept-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select,
.filter-bar input {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
}

/* ─── About page ─────────────────────────────────────────────────────────── */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 0;
}

.about-content h1 {
    margin-bottom: 24px;
}

.about-content h2 {
    margin-top: 40px;
    margin-bottom: 16px;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

.about-content ul {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 16px;
}

.about-content li {
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.about-content a {
    color: var(--primary-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ─── Contact card ───────────────────────────────────────────────────────── */
.contact-card {
    margin: 32px 0;
    padding: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: border-color var(--transition);
}

.contact-card:hover {
    border-color: var(--border-primary);
}

.contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    margin-bottom: 16px;
}

.contact-label {
    color: var(--text-secondary);
    margin-bottom: 16px !important;
    font-size: 0.95rem;
}

.contact-btn {
    display: inline-flex !important;
    font-size: 1rem;
    padding: 12px 28px;
    text-decoration: none !important;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    font-weight: 600;
}

.pagination .dots {
    color: var(--text-muted);
}

/* ─── Search Results ─────────────────────────────────────────────────────── */
.search-results-header {
    padding: 30px 0 10px;
}

.search-results-header h1 {
    margin-bottom: 8px;
}

.search-results-header p {
    color: var(--text-secondary);
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* ─── Loading skeleton ───────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── 404 ────────────────────────────────────────────────────────────────── */
.page-404 {
    text-align: center;
    padding: 100px 20px;
}

.page-404 h1 {
    font-size: 6rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 16px;
}

.page-404 p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* ─── Nouveaux blocs Home (Saas 2026) ─── */
.saas-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 20px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.saas-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.saas-title span {
    color: var(--primary);
}

.saas-title-huge {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.saas-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 60px;
}

/* Map Saas Section */
.map-saas-section {
    padding: 80px 20px;
    background: var(--bg-body);
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-container-framed {
    width: 100%;
    max-width: 1200px;
    height: 70vh;
    min-height: 500px;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.map-container-framed #map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-overlay-content {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85); /* fallback */
    backdrop-filter: blur(12px);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
    max-width: 350px;
}

[data-theme='dark'] .map-overlay-content {
    background: rgba(18, 18, 18, 0.7);
}

.map-overlay-content h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 24px;
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.bento-large {
    grid-column: span 2;
    grid-row: span 2;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-card-hover));
    position: relative;
    overflow: hidden;
}

.bento-content {
    position: relative;
    z-index: 2;
    max-width: 65%;
}

.bento-illustration {
    position: absolute;
    right: -20px;
    bottom: -30px;
    z-index: 1;
    opacity: 0.9;
    transition: transform var(--transition) ease-out;
}

.bento-large:hover .bento-illustration {
    transform: translateY(-10px) translateX(-5px);
}

.bento-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-primary);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.bento-item h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.bento-item p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Split Section */
.split-section {
    background: #0f172a; /* Force dark mood for high contrast */
    color: #f8fafc;
}

[data-theme='dark'] .split-section {
    background: #020617;
}

.split-section .benefits-intro {
    color: #cbd5e1;
    font-size: 1.2rem;
    max-width: 450px;
}

.split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    width: 100%;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.benefit-item.glass-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.benefit-item.glass-card:hover {
    transform: translateX(5px);
    border-color: rgba(16, 185, 129, 0.5);
}

.benefit-item.glass-card h4 {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.benefit-item.glass-card p {
    color: #94a3b8;
}

.benefit-icon {
    font-size: 2.2rem;
    background: rgba(16, 185, 129, 0.15); /* Emerald glow */
    padding: 16px;
    border-radius: var(--radius-lg);
    line-height: 1;
}

.open-data-card {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 24px;
    border-radius: var(--radius-lg);
}

.open-data-card strong {
    color: #10b981;
    font-size: 1.1rem;
    display: block;
}

.open-data-card p {
    color: #94a3b8;
    margin-top: 4px;
    font-size: 0.95rem;
}

/* Départements Saas Section */
.depts-saas-section {
    background: var(--bg-body);
}
.search-box-giant {
    max-width: 600px;
}
.search-box-giant input {
    font-size: 1.2rem;
    padding: 20px 20px 20px 56px;
    border-radius: 40px;
}
.bento-grid-depts {
    max-width: 1200px;
    margin: 0 auto;
}

/* Responsivité SaaS */
@media (max-width: 992px) {
    .split-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .saas-title-huge { font-size: 3rem; }
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-large {
        grid-column: span 1;
        grid-row: span 1;
    }
    .map-overlay-content {
        position: relative;
        top: 0; left: 0;
        max-width: 100%;
        margin: 20px;
    }
    .map-fullscreen { height: 60vh; }
    .saas-section {
        min-height: auto;
        padding: 60px 20px;
    }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* ── Layout ── */
    .container {
        padding: 0 16px;
    }

    .header-inner {
        padding: 0 16px;
    }

    .section {
        padding: 40px 0;
    }

    /* ── Nav ── */
    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    /* ── Hero ── */
    .hero {
        padding: 40px 0 24px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 28px;
    }

    /* ── Stats ── */
    .stats-row {
        gap: 10px;
        margin-bottom: 28px;
    }

    .stat-card {
        padding: 12px 16px;
        min-width: 100px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* ── Search ── */
    .search-box {
        margin-bottom: 32px;
    }

    .search-box input {
        padding: 14px 16px 14px 42px;
        font-size: 0.92rem;
    }

    .search-box .search-icon {
        left: 14px;
    }

    .search-box button {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    /* ── Map ── */
    .map-container {
        margin-bottom: 32px;
        border-radius: var(--radius-md);
    }

    .map-container.map-home {
        height: 320px;
    }

    .map-container.map-dept {
        height: 280px;
    }

    .map-container.map-aire {
        height: 260px;
    }

    /* ── Department grid ── */
    .dept-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dept-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .dept-code {
        font-size: 1.2rem;
    }

    /* ── Aire list ── */
    .aire-list {
        gap: 10px;
    }

    .aire-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px 16px;
    }

    .aire-item-meta {
        flex-wrap: wrap;
    }

    /* ── Info cards (aire detail) ── */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 28px;
    }

    .info-card {
        padding: 16px;
    }

    .info-card-header {
        margin-bottom: 8px;
        font-size: 0.78rem;
    }

    .info-card-value {
        font-size: 1rem;
    }

    /* ── Breadcrumb ── */
    .breadcrumb {
        padding: 16px 0;
        font-size: 0.82rem;
        gap: 6px;
    }

    /* ── Aire detail hero ── */
    .aire-hero {
        padding: 20px 0 14px;
    }

    .page-dept-header {
        padding: 20px 0 14px;
    }

    /* ── Action buttons ── */
    .action-buttons {
        flex-direction: column;
        margin: 20px 0 28px;
        gap: 10px;
    }

    .btn {
        justify-content: center;
        width: 100%;
        padding: 11px 20px;
        font-size: 0.88rem;
    }

    /* ── SEO text ── */
    .seo-text {
        margin-top: 28px;
        padding: 20px;
    }

    .seo-text h2 {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }

    .seo-text p {
        font-size: 0.88rem;
        line-height: 1.7;
        margin-bottom: 10px;
    }

    /* ── Nearby section ── */
    .nearby-section {
        margin-top: 32px;
    }

    .nearby-section h2 {
        margin-bottom: 16px;
        font-size: 1.15rem;
    }

    /* ── Footer ── */
    .site-footer {
        padding: 30px 0;
        margin-top: 40px;
    }

    .footer-inner {
        padding: 0 16px;
        flex-direction: column;
        gap: 24px;
    }

    .footer-bottom {
        padding: 16px 16px 0;
        flex-direction: column;
        text-align: center;
        margin-top: 20px;
        gap: 8px;
    }

    /* ── Filter bar ── */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }

    .filter-bar select,
    .filter-bar input {
        width: 100%;
        padding: 10px 14px;
    }

    /* ── About ── */
    .about-content {
        padding: 40px 0;
    }

    .about-content h2 {
        margin-top: 28px;
        margin-bottom: 12px;
    }

    /* ── Pagination ── */
    .pagination {
        margin-top: 28px;
        gap: 4px;
    }

    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 0.82rem;
    }

    /* ── Page dept stats ── */
    .page-dept-stats {
        gap: 12px;
        margin-bottom: 20px;
    }

    /* ── Section title ── */
    .section-title {
        margin-bottom: 20px;
    }
}

/* ─── Extra Small ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .header-inner {
        padding: 0 12px;
    }

    .hero {
        padding: 32px 0 20px;
    }

    .stats-row {
        flex-direction: column;
        align-items: stretch;
    }

    .stat-card {
        width: 100%;
        padding: 10px 14px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .map-container.map-home {
        height: 260px;
    }

    .map-container.map-dept {
        height: 240px;
    }

    .map-container.map-aire {
        height: 220px;
    }

    .dept-card {
        padding: 12px 14px;
    }

    .aire-item {
        padding: 12px 14px;
    }

    .info-card {
        padding: 14px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .footer-inner {
        padding: 0 12px;
    }

    .footer-bottom {
        padding: 14px 12px 0;
    }

    .search-box input {
        padding: 12px 14px 12px 38px;
        font-size: 0.88rem;
    }

    .search-box .search-icon {
        left: 12px;
    }

    .search-box button {
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .about-content {
        padding: 28px 0;
    }

    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }

    .seo-text {
        padding: 16px;
        margin-top: 20px;
    }

    .seo-text p {
        font-size: 0.85rem;
    }
}
