/* ============================================================
   GUIDE DES FAMILLES - BERRY LOIRE PUISAYE
   Feuille de styles partagée - styles.css
   Version unifiée - Septembre 2026
   Inclut Pagefind (recherche interne)
   ============================================================ */

/* ============================================================
   1. VARIABLES CSS
   ============================================================ */

:root {
    --primary-color: #2E7D32;
    --primary-light: #66BB6A;
    --primary-dark: #1B5E20;
    --secondary-color: #00897B;
    --secondary-light: #4DB6AC;
    --bg-white: #FFFFFF;
    --bg-light: #F5F5F5;
    --bg-lighter: #FAFAFA;
    --border-color: #E0E0E0;
    --text-dark: #212121;
    --text-medium: #424242;
    --text-light: #757575;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
    --font-main: 'Nunito', sans-serif;
}

/* --- Couleurs spécifiques par page --- */
.page-interlocuteurs {
    --primary-color: #1f5692;
    --primary-light: #4A7FB5;
    --primary-dark: #163F6B;
    --secondary-color: #2C6FA8;
    --secondary-light: #5B92C4;
}
.page-arrivee-enfant {
    --primary-color: #2E7D32;
    --primary-light: #66BB6A;
    --primary-dark: #1B5E20;
    --secondary-color: #00897B;
    --secondary-light: #4DB6AC;
}
.page-petite-enfance {
    --primary-color: #5be485;
    --primary-light: #8AEDA9;
    --primary-dark: #33B85D;
    --secondary-color: #3FCB6C;
    --secondary-light: #7DDD9C;
}
.page-enfance {
    --primary-color: #686be7;
    --primary-light: #8B8DEF;
    --primary-dark: #4A4DBD;
    --secondary-color: #5754D6;
    --secondary-light: #8280E0;
}
.page-jeunesse {
    --primary-color: #c75f35;
    --primary-light: #D98A69;
    --primary-dark: #954226;
    --secondary-color: #B8703F;
    --secondary-light: #CC9670;
}
.page-parentalite {
    --primary-color: #585e70;
    --primary-light: #7D8296;
    --primary-dark: #3F4451;
    --secondary-color: #6C7285;
    --secondary-light: #9A9FAD;
}
.page-loisirs {
    --primary-color: #b7a88e;
    --primary-light: #D2C8B4;
    --primary-dark: #8C7D64;
    --secondary-color: #A59678;
    --secondary-light: #C8BEA5;
}
.page-vivre-ensemble {
    --primary-color: #f0bb1e;
    --primary-light: #F7CE5A;
    --primary-dark: #B4820A;
    --secondary-color: #E6A014;
    --secondary-light: #F5C850;
}
.page-acces-droits {
    --primary-color: #ff66c4;
    --primary-light: #FF96D7;
    --primary-dark: #C83296;
    --secondary-color: #E650B4;
    --secondary-light: #FF8CD2;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-lighter);
}

body,
h1, h2, h3, h4, h5, h6,
p, a, span, li, ul, ol, blockquote, figure, figcaption,
button, input, textarea, select, label, legend,
table, th, td, caption {
    font-family: var(--font-main);
}

.fa, .fas, .far, .fal, .fab,
.fa-solid, .fa-regular, .fa-brands,
[class*="fa-"]::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 6 Pro" !important;
}

/* ============================================================
   3. CONTAINER & ÉLÉMENTS DE BASE
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    background: #f0f0f0;
}

img:not([src]),
img[src=""] {
    background: #ffe0e0;
    border: 2px dashed #ff6666;
    min-height: 40px;
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li { margin-bottom: 0.5rem; }

/* ============================================================
   ✅ IMAGE DE CONTENU : centrée, entière, max 400px
   ============================================================ */
.img-contenu-400 {
    display: block;
    margin: 1rem auto;
    max-width: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .img-contenu-400 {
        max-width: 280px;
    }
}

/* ============================================================
   4. HEADER
   ============================================================ */

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.2rem 0 0.8rem;
    box-shadow: var(--shadow-md);
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    position: relative;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.logo img {
    height: 70px;
    width: auto;
    display: block;
    background: transparent;
}

.logo h1 {
    color: white;
    margin-bottom: 0;
    font-size: 3.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.logo h1 a {
    color: white;
    text-decoration: none;
}

.header-info {
    position: absolute;
    bottom: -0.2rem;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.95);
    text-align: right;
}

.header-info strong {
    font-weight: 600;
}

/* ============================================================
   ✅ RECHERCHE PAGEFIND — Bouton dans le header (desktop)
   ============================================================ */

.header-search {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Personnalisation du bouton Pagefind (composant trigger) */
pagefind-modal-trigger {
    --pagefind-trigger-color: white;
    --pagefind-trigger-bg: rgba(255, 255, 255, 0.2);
    --pagefind-trigger-border: 1px solid rgba(255, 255, 255, 0.5);
    --pagefind-trigger-radius: 20px;
    --pagefind-trigger-padding: 0.3rem 0.9rem;
    --pagefind-trigger-font-size: 0.75rem;
    --pagefind-trigger-font-weight: 600;
    --pagefind-trigger-hover-bg: rgba(255, 255, 255, 0.35);
    --pagefind-trigger-color-hover: white;
}

/* Personnalisation de la modale Pagefind */
pagefind-modal {
    --pagefind-modal-bg: white;
    --pagefind-modal-border-radius: 12px;
    --pagefind-modal-box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    --pagefind-result-title-color: var(--primary-dark);
    --pagefind-result-highlight-bg: rgba(255, 235, 59, 0.5);
    --pagefind-input-border-color: var(--primary-color);
}

/* ✅ Forcer la police Nunito sur tous les éléments Pagefind */
pagefind-modal-trigger,
pagefind-modal-trigger *,
pagefind-modal,
pagefind-modal *,
pagefind-modal-trigger button,
pagefind-modal-trigger input {
    font-family: 'Nunito', sans-serif !important;
}

/* ============================================================
   5. NAVIGATION
   ============================================================ */

.nav {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ✅ Conteneur mobile : caché par défaut (desktop) */
.nav-mobile-top {
    display: none;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-list li {
    margin: 0;
}

.nav-list > li > a {
    display: block;
    padding: 1rem 1.25rem;
    color: var(--text-dark);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease, border-bottom-color 0.3s ease;
}

.nav-list > li > a:hover,
.nav-list > li > a.active {
    background-color: var(--bg-light);
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 260px;
    box-shadow: var(--shadow-md);
    border-radius: 0 0 8px 8px;
    z-index: 1001;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 769px) {
    .nav-dropdown:hover .nav-dropdown-menu {
        display: block;
    }
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

/* ============================================================
   ✅ FLÈCHE INDICATRICE SUR LES RUBRIQUES AVEC SOUS-MENU
   ============================================================ */
.nav-dropdown > a::after {
    content: "▾";
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.9em;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.nav-dropdown.open > a::after {
    transform: rotate(180deg);
}

@media (min-width: 769px) {
    .nav-dropdown > a::after {
        font-size: 0.75em;
        opacity: 0.6;
    }
}

@media (max-width: 768px) {
    .nav-dropdown > a::after {
        font-size: 1em;
        margin-left: auto;
        opacity: 0.8;
        font-weight: 600;
        flex-shrink: 0;
    }

    .nav-dropdown.open > a::after {
        transform: rotate(180deg);
        opacity: 1;
    }
}

.nav-dropdown-menu li {
    margin: 0;
}

.nav-dropdown-menu li a {
    padding: 0.75rem 1.25rem;
    display: block;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    border-left: none;
    position: static;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-dropdown-menu li:last-child a {
    border-bottom: none;
}

/* ============================================================
   ✅ LIEN "VOIR LA PAGE [RUBRIQUE]" — VISIBLE UNIQUEMENT EN MOBILE
   ============================================================ */

.nav-dropdown-menu li a.nav-dropdown-main-link,
.nav-dropdown-main-link {
    display: none !important;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    .nav-dropdown-menu li a.nav-dropdown-main-link,
    .nav-dropdown-main-link {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
        font-weight: 700 !important;
        background: var(--bg-light);
        border-bottom: 2px solid var(--border-color) !important;
        text-align: left !important;
        padding-left: 1.5rem !important;
        font-size: 0.9rem !important;
    }

    .nav-dropdown-main-link::before {
        content: "→ ";
        font-weight: 700;
        margin-right: 0.3rem;
    }

    /* Couleur du texte : spécifique à chaque rubrique */
    .dropdown-interlocuteurs .nav-dropdown-main-link { color: #1f5692 !important; }
    .dropdown-arrivee-enfant .nav-dropdown-main-link { color: #2E7D32 !important; }
    .dropdown-petite-enfance .nav-dropdown-main-link { color: #33B85D !important; }
    .dropdown-enfance .nav-dropdown-main-link { color: #686be7 !important; }
    .dropdown-jeunesse .nav-dropdown-main-link { color: #c75f35 !important; }
    .dropdown-parentalite .nav-dropdown-main-link { color: #585e70 !important; }
    .dropdown-loisirs .nav-dropdown-main-link { color: #8C7D64 !important; }
    .dropdown-vivre-ensemble .nav-dropdown-main-link { color: #B4820A !important; }
    .dropdown-acces-droits .nav-dropdown-main-link { color: #C83296 !important; }

    /* Survol : fond spécifique à chaque rubrique */
    .dropdown-interlocuteurs .nav-dropdown-main-link:hover { background: #1f5692 !important; color: white !important; }
    .dropdown-arrivee-enfant .nav-dropdown-main-link:hover { background: #2E7D32 !important; color: white !important; }
    .dropdown-petite-enfance .nav-dropdown-main-link:hover { background: #33B85D !important; color: white !important; }
    .dropdown-enfance .nav-dropdown-main-link:hover { background: #686be7 !important; color: white !important; }
    .dropdown-jeunesse .nav-dropdown-main-link:hover { background: #c75f35 !important; color: white !important; }
    .dropdown-parentalite .nav-dropdown-main-link:hover { background: #585e70 !important; color: white !important; }
    .dropdown-loisirs .nav-dropdown-main-link:hover { background: #8C7D64 !important; color: white !important; }
    .dropdown-vivre-ensemble .nav-dropdown-main-link:hover { background: #B4820A !important; color: white !important; }
    .dropdown-acces-droits .nav-dropdown-main-link:hover { background: #C83296 !important; color: white !important; }
}

/* --- Couleurs des liens de navigation par page --- */
.nav-list > li > a.nav-link-accueil:hover,
.nav-list > li > a.nav-link-accueil.active {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border-bottom-color: transparent;
}

.nav-list > li > a.nav-link-interlocuteurs:hover,
.nav-list > li > a.nav-link-interlocuteurs.active {
    border-bottom-color: #1f5692;
    color: #1f5692;
}
.nav-list > li > a.nav-link-arrivee-enfant:hover,
.nav-list > li > a.nav-link-arrivee-enfant.active {
    border-bottom-color: #2E7D32;
    color: #2E7D32;
}
.nav-list > li > a.nav-link-petite-enfance:hover,
.nav-list > li > a.nav-link-petite-enfance.active {
    border-bottom-color: #5be485;
    color: #33B85D;
}
.nav-list > li > a.nav-link-enfance:hover,
.nav-list > li > a.nav-link-enfance.active {
    border-bottom-color: #686be7;
    color: #686be7;
}
.nav-list > li > a.nav-link-jeunesse:hover,
.nav-list > li > a.nav-link-jeunesse.active {
    border-bottom-color: #c75f35;
    color: #c75f35;
}
.nav-list > li > a.nav-link-parentalite:hover,
.nav-list > li > a.nav-link-parentalite.active {
    border-bottom-color: #585e70;
    color: #585e70;
}
.nav-list > li > a.nav-link-loisirs:hover,
.nav-list > li > a.nav-link-loisirs.active {
    border-bottom-color: #b7a88e;
    color: #8C7D64;
}
.nav-list > li > a.nav-link-vivre-ensemble:hover,
.nav-list > li > a.nav-link-vivre-ensemble.active {
    border-bottom-color: #f0bb1e;
    color: #B4820A;
}
.nav-list > li > a.nav-link-acces-droits:hover,
.nav-list > li > a.nav-link-acces-droits.active {
    border-bottom-color: #ff66c4;
    color: #C83296;
}

/* --- Couleur des sous-menus par rubrique --- */
.dropdown-interlocuteurs .nav-dropdown-menu li a:hover { background-color: #eef3fa; color: #1f5692; }
.dropdown-arrivee-enfant .nav-dropdown-menu li a:hover { background-color: #eef7ef; color: #2E7D32; }
.dropdown-petite-enfance .nav-dropdown-menu li a:hover { background-color: #eefaf1; color: #33B85D; }
.dropdown-enfance .nav-dropdown-menu li a:hover { background-color: #f0f0fd; color: #686be7; }
.dropdown-jeunesse .nav-dropdown-menu li a:hover { background-color: #fdf1ec; color: #c75f35; }
.dropdown-parentalite .nav-dropdown-menu li a:hover { background-color: #f0f1f4; color: #585e70; }
.dropdown-loisirs .nav-dropdown-menu li a:hover { background-color: #f7f5f0; color: #8C7D64; }
.dropdown-vivre-ensemble .nav-dropdown-menu li a:hover { background-color: #fdf8ea; color: #B4820A; }
.dropdown-acces-droits .nav-dropdown-menu li a:hover { background-color: #fdf0f8; color: #C83296; }

/* ============================================================
   6. SECTIONS & CONTENU
   ============================================================ */

.section { padding: 3rem 0; }
.section-alt { background-color: var(--bg-lighter); }

.section-header {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.section-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.section-title {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-light);
    display: inline-block;
}

.quote {
    font-style: italic;
    color: var(--text-light);
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    background: var(--bg-light);
    margin-bottom: 2rem;
    border-radius: 4px;
}

.content-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   7. ACCORDÉONS
   ============================================================ */

.accordion { margin-top: 2.5rem; }

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 14px;
    background: white;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.accordion-item:hover { box-shadow: var(--shadow-md); }

.accordion-header {
    width: 100%;
    background: white;
    border: none;
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.accordion-header:hover { background: #f5f8ff; }

.accordion-header.open {
    background: var(--primary-color);
    color: white;
}

.accordion-header.open span { color: white; }

.accordion-header h3,
.accordion-header span:not(.accordion-icon):not(.count),
.accordion-header .title {
    font-family: var(--font-main);
    font-weight: 700;
}

.accordion-header .count {
    font-family: var(--font-main);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.08);
    padding: 0.1rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

.accordion-header.open .count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.accordion-header .accordion-icon {
    font-family: var(--font-main);
    font-weight: 300;
    font-size: 1.6rem;
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: auto;
}

.accordion-header.open .accordion-icon { transform: rotate(45deg); }

.accordion-header img,
.accordion-header .header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.accordion-header .header-logo-large {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.accordion-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
    color: inherit;
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    background: #fafbff;
}

.accordion-body.open {
    max-height: 3000px;
    padding: 0.8rem 1.2rem 1.5rem;
}

.accordion-body-inner {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.accordion-body-inner .text {
    flex: 1;
    min-width: 0;
}

.accordion-body-inner .text p {
    margin: 0 0 0.6rem;
    line-height: 1.7;
}

.accordion-body-inner .images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.accordion-body-inner .images img {
    width: 100%;
    max-width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 0 0 auto;
}

.accordion-body-inner .images img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

/* ============================================================
   8. SOUS-ACCORDÉONS
   ============================================================ */

.sous-accordion-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.sous-accordion-wrapper:last-child { margin-bottom: 0.5rem; }

.sous-accordion-header {
    background: white;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.sous-accordion-header span {
    font-family: var(--font-main);
    font-weight: 700;
}

.sous-accordion-header:hover { background: #f5f8ff; }

.sous-accordion-header.open {
    background: var(--primary-light);
    color: white;
}

.sous-accordion-header.open span { color: white; }

.sous-accordion-icon {
    font-size: 1.2rem;
    font-weight: 300;
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: auto;
}

.sous-accordion-header.open .sous-accordion-icon { transform: rotate(45deg); }

.sous-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    background: #fafbff;
    padding: 0 1.2rem;
}

.sous-accordion-body.open {
    max-height: 2000px;
    padding: 0.5rem 1.2rem 1rem;
}

/* ============================================================
   9. "LIRE LA SUITE"
   ============================================================ */

.read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.2rem 0;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline dotted;
}

.read-more-btn:hover { color: var(--primary-dark); }

.full-text { display: none; }
.full-text.visible { display: block; }

/* ============================================================
   10. CARTES DANS ACCORDÉON
   ============================================================ */

.accordion-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.accordion-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.accordion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.accordion-card h3,
.accordion-card h4 {
    color: var(--primary-dark);
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
}

.accordion-card p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.accordion-card a {
    color: var(--primary-color);
    text-decoration: none;
}

.accordion-card a:hover { text-decoration: underline; }

.accordion-card .badge {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.3rem;
    opacity: 0.8;
}

.accordion-card .website {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.3rem;
    opacity: 0.9;
    text-decoration: none;
}

.accordion-card .website:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: white;
}

/* --- Liens sites internet en badge uniforme --- */
.accordion-body a[target="_blank"]:not(.social-links a),
.sous-accordion-body a[target="_blank"]:not(.social-links a),
.sub-section a[target="_blank"]:not(.social-links a),
.accordion-card a[target="_blank"],
.card a[target="_blank"]:not(.social-links a),
.partner-content a[target="_blank"]:not(.social-links a) {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin: 0.2rem 0;
    opacity: 0.9;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
    font-weight: 500;
    word-break: break-word;
}

.accordion-body a[target="_blank"]:not(.social-links a):hover,
.sous-accordion-body a[target="_blank"]:not(.social-links a):hover,
.sub-section a[target="_blank"]:not(.social-links a):hover,
.accordion-card a[target="_blank"]:hover,
.card a[target="_blank"]:not(.social-links a):hover,
.partner-content a[target="_blank"]:not(.social-links a):hover {
    background: var(--primary-dark);
    opacity: 1;
    text-decoration: none;
    color: white;
}

/* ============================================================
   11. CARTES STANDARD
   ============================================================ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.cards-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid var(--primary-color);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card img {
    border-radius: 4px;
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.card p {
    margin: 0.2rem 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.card a {
    color: var(--primary-color);
    text-decoration: none;
}

.card a:hover { text-decoration: underline; }

.card .card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.8rem;
    cursor: pointer;
}

/* ============================================================
   12. SOUS-SECTIONS
   ============================================================ */

.sub-section {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-light);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.sub-section:last-child { margin-bottom: 0; }

.sub-section h5 {
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.sub-section p {
    margin: 0 0 0.6rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.subsections {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.subsection {
    background: var(--bg-lighter);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.subsection h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.subsection h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

/* ============================================================
   13. SOUS-SECTION AVEC IMAGE
   ============================================================ */

.subsection-with-image {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: var(--radius);
    scroll-margin-top: 80px;
}

.subsection-with-image .image-wrapper {
    flex: 0 0 200px;
    max-width: 200px;
}

.subsection-with-image .image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: pointer;
}

.subsection-with-image .text-wrapper { flex: 1; }

.subsection-with-image .text-wrapper h3 {
    margin-top: 0;
    color: var(--primary-dark);
}

.subsection-with-image .text-wrapper .social-links { margin-top: 0.5rem; }

.subsection-with-image .text-wrapper .social-links a {
    font-size: 1.3rem;
    margin-right: 0.6rem;
    text-decoration: none;
}

.subsection-with-image .text-wrapper .social-links a:hover { opacity: 0.8; }

/* ============================================================
   14. IMAGE + TEXTE
   ============================================================ */

.image-text-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
}

.image-text-row img {
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    width: 100%;
    cursor: pointer;
}

/* ============================================================
   15. GALERIES
   ============================================================ */

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.photo-gallery img {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
    width: 100%;
    height: 250px;
    object-fit: cover;
    cursor: pointer;
}

.photo-gallery img:hover { transform: scale(1.05); }

/* ============================================================
   16. ECOLES GRID & LOGOS
   ============================================================ */

.ecoles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.ecole-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

.ecole-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.ecole-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.ecole-card-content { padding: 1.2rem; }

.ecole-card-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ecole-card-content h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.ecole-card-content p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
}

.logo-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.logo-item img {
    max-height: 100px;
    width: auto;
    margin: 0 auto;
    background: transparent;
}

/* ============================================================
   17. VIDÉO
   ============================================================ */

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-wrapper.video-loaded {
    padding-bottom: 0;
    height: auto;
}

.video-caption {
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 0.3rem 0.5rem;
    background: var(--bg-light);
    margin: 0;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

.video-credit {
    font-size: 0.85rem;
    color: var(--text-medium);
    text-align: center;
    margin: 0.5rem 0 0 0;
    padding: 0.3rem 0.5rem;
}

.video-credit a[target="_blank"] {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin: 0.2rem 0;
    opacity: 0.9;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
    font-weight: 500;
}

.video-credit a[target="_blank"]:hover {
    background: var(--primary-dark);
    opacity: 1;
    text-decoration: none;
    color: white;
}

.video-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    cursor: pointer;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.video-thumb:hover img {
    transform: scale(1.04);
    opacity: 0.88;
}

.video-thumb .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 50px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.video-thumb:hover .play-btn {
    background: rgba(255, 255, 255, 0.95);
    transform: translate(-50%, -50%) scale(1.08);
}

.video-thumb .play-btn svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    margin-left: 4px;
}

.video-thumb:hover .play-btn svg { fill: #000; }
/* ============================================================
   ✅ CARTE VIDÉO VERS YOUTUBE (lien externe)
   ============================================================ */
.video-link-card {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.video-link-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.video-link-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.video-link-card:hover img {
    transform: scale(1.04);
    opacity: 0.88;
}

.video-link-card .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 50px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.video-link-card:hover .play-btn {
    background: rgba(199, 95, 53, 0.95);
    transform: translate(-50%, -50%) scale(1.08);
}

.video-link-card .play-btn svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    margin-left: 4px;
}

/* ============================================================
   18. LIENS SOCIAUX
   ============================================================ */

.social-links { margin-top: 0.5rem; }

.social-links a {
    font-size: 1.3rem;
    margin-right: 0.6rem;
    text-decoration: none;
}

.social-links a:hover { opacity: 0.8; }

.social-links a[href*="facebook"] { color: #1877F2; }
.social-links a[href*="instagram"] { color: #E1306C; }
.social-links a[href*="tiktok"] { color: #000000; }
.social-links a[href*="youtube"] { color: #FF0000; }

/* ============================================================
   19. ITEM EXPANDABLE
   ============================================================ */

.item-expandable {
    margin-bottom: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.item-expandable summary {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-dark);
    background: white;
    transition: background 0.2s;
}

.item-expandable summary:hover { background: #f5f8ff; }

.item-expandable .item-content {
    padding: 0.8rem 1rem;
    background: #fafbff;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   20. LIGHTBOX
   ============================================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.lightbox.active { display: flex; }

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    background: transparent;
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    background: #2d323d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.lightbox-close:hover { transform: scale(1.1); }

/* ============================================================
   21. FOOTER
   ============================================================ */

.footer {
    background: linear-gradient(135deg, #212121 0%, #424242 100%);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-content-accueil {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
    margin-left: 0;
}

.footer-section ul li { margin-bottom: 0.4rem; }

.footer-section a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================================
   22. SCROLL TOP
   ============================================================ */

.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ============================================================
   23. IMPRESSION SÉLECTIVE
   ============================================================ */

.print-select-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    background: #f8f9ff;
    border: 1px dashed var(--primary-light);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-medium);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.print-select-row:hover {
    background: #f0f2ff;
    border-color: var(--primary-color);
}

.print-select-row .print-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    flex: 1;
}

.print-select-row .print-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
    margin: 0;
}

.print-select-row .print-checkbox-label {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-light);
    cursor: pointer;
    user-select: none;
}

.print-select-row .print-checkbox:checked + .print-checkbox-label {
    font-weight: 700;
    font-style: normal;
    color: var(--primary-color);
}

.accordion-item.print-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.accordion-item.print-selected .print-select-row {
    background: #eef7ef;
    border-color: var(--primary-color);
    border-style: solid;
}

/* ============================================================
   ✅ LIGNES D'IMPRESSION DANS LES CARTES (écoles, squares, skateparks, mairies)
   ============================================================ */
.ecole-print-row,
.lieu-print-row,
.mairie-print-row {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ecole-print-row input[type="checkbox"],
.lieu-print-row input[type="checkbox"],
.mairie-print-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.ecole-print-row label,
.lieu-print-row label,
.mairie-print-row label {
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-light);
    cursor: pointer;
    user-select: none;
}

.ecole-print-row input[type="checkbox"]:checked + label,
.lieu-print-row input[type="checkbox"]:checked + label,
.mairie-print-row input[type="checkbox"]:checked + label {
    font-weight: 700;
    font-style: normal;
    color: var(--primary-color);
}

.ecole-card.print-selected,
.lieu-card.print-selected,
.mairie-card.print-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
    background: #fafbff;
}

/* ============================================================
   24. BOUTON D'IMPRESSION FLOTTANT
   ============================================================ */

.print-float-btn {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    font-family: var(--font-main);
}

.print-float-btn .print-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-medium);
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-style: italic;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 260px;
    line-height: 1.3;
    text-align: left;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.print-float-btn .print-hint i {
    color: var(--primary-color);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.print-float-btn:hover .print-hint {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
}

.print-float-btn button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.9rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.print-float-btn button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.print-float-btn button:active { transform: translateY(0); }

.print-float-btn .print-select-all {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.print-float-btn .print-select-all:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.print-float-btn .print-count {
    background: var(--primary-dark);
    color: white;
    border-radius: 20px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.3rem;
}

.print-float-btn button .print-label-short { display: none; }

/* ============================================================
   25. RESPONSIVE
   ============================================================ */

@media (max-width: 992px) and (min-width: 769px) {
    .cards-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .cards-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .nav-list > li > a {
        font-size: 0.72rem;
        padding: 0.3rem 0.5rem;
    }
}

@media (max-width: 768px) {
    * { -webkit-text-size-adjust: 100%; }
    body { font-size: 16px; }
    .container { padding: 0 15px; }

    /* ===== NAV : désactive sticky en mobile ===== */
    .nav {
        position: relative;
        overflow: visible;
    }

    /* ===== HEADER ===== */
    .header { padding: 0.8rem 0; }
    .logo img { height: 50px; }
    .logo h1 { font-size: 2.6rem; }
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    .header-info {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 0.5rem;
        gap: 0.5rem;
        margin-top: 0.4rem;
        width: 100%;
    }

    /* ✅ Cacher la recherche du header en mobile (elle sera dans la nav) */
    .header-search {
        display: none !important;
    }

    /* ============================================================
       ✅ CONTENEUR MOBILE : ☰ Menu + Recherche dans la nav
       ============================================================ */
    .nav-mobile-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--primary-color);
        padding: 0;
        gap: 0;
        width: 100%;
    }

    .nav-mobile-top .menu-toggle {
        display: block;
        flex: 1;
        background: transparent;
        border: none;
        font-size: 1rem;
        padding: 0.75rem 1rem;
        cursor: pointer;
        text-align: left;
        color: white;
        font-weight: 600;
        font-family: var(--font-main);
    }

    .nav-mobile-top .menu-toggle.active {
        background: var(--primary-dark);
    }

    /* ✅ Bouton de recherche dans la nav (mobile) */
    .nav-mobile-top .nav-search {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 0.8rem;
        flex-shrink: 0;
    }

    .nav-mobile-top .nav-search pagefind-modal-trigger {
        --pagefind-trigger-color: white;
        --pagefind-trigger-bg: rgba(255, 255, 255, 0.2);
        --pagefind-trigger-border: 1px solid rgba(255, 255, 255, 0.5);
        --pagefind-trigger-radius: 20px;
        --pagefind-trigger-padding: 0.4rem 0.9rem;
        --pagefind-trigger-font-size: 0.8rem;
        --pagefind-trigger-font-weight: 600;
        --pagefind-trigger-hover-bg: rgba(255, 255, 255, 0.35);
        --pagefind-trigger-color-hover: white;
    }

    /* ===== MENU MOBILE : ACCORDÉON DANS LE FLUX ===== */
    .menu-toggle {
        display: block;
        background: var(--primary-color);
        border: none;
        font-size: 1rem;
        padding: 0.75rem 1rem;
        cursor: pointer;
        width: 100%;
        text-align: left;
        color: white;
        font-weight: 600;
        font-family: var(--font-main);
    }

    .menu-toggle.active { background: var(--primary-dark); }

    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--bg-white);
        border-top: 1px solid var(--border-color);
    }

    .nav-list.active {
        display: flex;
    }

    .nav-list li {
        width: 100%;
        margin: 0;
    }

    .nav-list > li > a {
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-list > li > a.active {
        background-color: var(--primary-light);
        color: white;
        font-weight: 600;
    }

    .nav-list > li > a.nav-link-accueil:hover,
    .nav-list > li > a.nav-link-accueil.active {
        background-color: var(--primary-light);
        color: white;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-list > li > a.nav-link-interlocuteurs.active,
    .nav-list > li > a.nav-link-arrivee-enfant.active,
    .nav-list > li > a.nav-link-petite-enfance.active,
    .nav-list > li > a.nav-link-enfance.active,
    .nav-list > li > a.nav-link-jeunesse.active,
    .nav-list > li > a.nav-link-parentalite.active,
    .nav-list > li > a.nav-link-loisirs.active,
    .nav-list > li > a.nav-link-vivre-ensemble.active,
    .nav-list > li > a.nav-link-acces-droits.active {
        background-color: var(--primary-light);
        color: white;
        font-weight: 600;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-radius: 0;
        background: var(--bg-lighter);
        width: 100%;
    }

    .nav-dropdown.open .nav-dropdown-menu { display: block; }

    .nav-dropdown-menu li a {
        padding: 0.6rem 1rem 0.6rem 2rem;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-dark);
        font-size: 0.85rem;
        font-weight: 400;
        display: block;
        -webkit-tap-highlight-color: transparent;
    }

    /* Couleurs des sous-menus par rubrique (mobile) */
    .dropdown-interlocuteurs .nav-dropdown-menu li a:hover { background-color: #eef3fa; color: #1f5692; }
    .dropdown-arrivee-enfant .nav-dropdown-menu li a:hover { background-color: #eef7ef; color: #2E7D32; }
    .dropdown-petite-enfance .nav-dropdown-menu li a:hover { background-color: #eefaf1; color: #33B85D; }
    .dropdown-enfance .nav-dropdown-menu li a:hover { background-color: #f0f0fd; color: #686be7; }
    .dropdown-jeunesse .nav-dropdown-menu li a:hover { background-color: #fdf1ec; color: #c75f35; }
    .dropdown-parentalite .nav-dropdown-menu li a:hover { background-color: #f0f1f4; color: #585e70; }
    .dropdown-loisirs .nav-dropdown-menu li a:hover { background-color: #f7f5f0; color: #8C7D64; }
    .dropdown-vivre-ensemble .nav-dropdown-menu li a:hover { background-color: #fdf8ea; color: #B4820A; }
    .dropdown-acces-droits .nav-dropdown-menu li a:hover { background-color: #fdf0f8; color: #C83296; }

    /* Désactive le menu contextuel */
    .nav-list,
    .nav-list a,
    .nav-list button {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* ============================================================
       ✅ AJOUT : EN-TÊTE ET BOUTON FERMER DANS LE MENU MOBILE
       ============================================================ */
    .nav-mobile-header,
    .nav-close-item {
        display: block;
        width: 100%;
    }

    .nav-mobile-header-content {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.8rem;
        padding: 1rem;
        background: var(--primary-color);
        color: white;
    }

    .nav-mobile-header-content img {
        height: 40px;
        width: auto;
        background: transparent;
    }

    .nav-mobile-header-title {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .nav-close-btn {
        display: block;
        width: 100%;
        padding: 0.8rem;
        background: var(--bg-light);
        border: none;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-dark);
        cursor: pointer;
        font-family: var(--font-main);
    }

    .nav-close-btn:hover {
        background: var(--primary-light);
        color: white;
    }

    /* ===== SECTIONS & CONTENU ===== */
    .section { padding: 1.5rem 0; }
    .section-title { font-size: 1.5rem; }
    .section-header { height: 200px; margin-bottom: 1rem; }

    .cards-grid,
    .cards-grid-2,
    .cards-grid-3,
    .cards-grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card { padding: 1rem; }
    .image-text-row { grid-template-columns: 1fr; gap: 1rem; }
    .ecoles-grid { grid-template-columns: 1fr; }

    .logos-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .logo-item { padding: 0.75rem; }

    .content-box { padding: 1rem; }
    .subsection { padding: 1rem; }
    .subsections { gap: 1rem; }

    .quote { font-size: 0.9rem; padding: 0.6rem 1rem; }

    .photo-gallery { grid-template-columns: 1fr 1fr; }
    .photo-gallery img { height: 150px; }

    .accordion-body-inner .images img {
        max-width: 100%;
        height: auto;
        aspect-ratio: 4/3;
    }

    .accordion-card-grid { grid-template-columns: 1fr; }

    .subsection-with-image {
        flex-direction: column;
        align-items: center;
    }

    .subsection-with-image .image-wrapper {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }

    .subsection-with-image .image-wrapper img {
        max-width: 250px;
        display: block;
        margin: 0 auto;
    }

    /* ===== FOOTER ===== */
    .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-content-accueil { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer { padding: 2rem 0 1rem; }

    /* ===== SCROLL TOP (mobile) : à GAUCHE ===== */
    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        left: 1rem;
        right: auto;
        font-size: 1.3rem;
    }

    /* ===== IMPRESSION SÉLECTIVE (mobile) ===== */
    .print-select-row {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }

    .print-select-row .print-checkbox-label { font-size: 0.75rem; }

    /* ===== BOUTON D'IMPRESSION FLOTTANT (mobile) ===== */
    .print-float-btn {
        bottom: 1rem;
        right: 1rem;
        left: auto;
        align-items: flex-end;
        gap: 0.4rem;
    }

    .print-float-btn .print-hint { display: none; }

    .print-float-btn .print-select-all {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
    }

    .print-float-btn button {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
    }

    .print-float-btn button .print-label-long { display: none; }
    .print-float-btn button .print-label-short { display: inline; }

    /* ===== TABLEAUX ===== */
    table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th, td {
        padding: 0.5rem;
        white-space: nowrap;
    }
}

/* ============================================================
   ✅ MASQUER L'EN-TÊTE ET LE BOUTON FERMER SUR DESKTOP
   ============================================================ */
.nav-mobile-header,
.nav-close-item {
    display: none;
}

@media (max-width: 480px) {
    .logo img { height: 40px; }
    .logo h1 { font-size: 2.2rem; }
    .header-info { font-size: 0.45rem; }

    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1rem; }
    .section-title { font-size: 1.3rem; }

    .menu-toggle { font-size: 0.95rem; }

    .nav-list > li > a {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .nav-dropdown-menu li a {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem 0.5rem 1.8rem;
    }

    .photo-gallery { grid-template-columns: 1fr; }
    .photo-gallery img { height: 200px; }

    .accordion-header {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
        flex-wrap: wrap;
    }

    .accordion-icon { font-size: 1.3rem; }

    .accordion-body.open { padding: 0.6rem 0.9rem 1.2rem; }

    .sous-accordion-header {
        padding: 0.6rem 0.9rem;
        font-size: 0.95rem;
    }

    .scroll-top {
        bottom: 0.8rem;
        left: 0.8rem;
        right: auto;
    }

    .print-float-btn {
        bottom: 0.8rem;
        right: 0.8rem;
        left: auto;
        gap: 0.3rem;
    }

    .print-float-btn button {
        padding: 0.6rem 0.9rem;
        font-size: 0.75rem;
    }

    .print-float-btn .print-select-all {
        padding: 0.35rem 0.6rem;
        font-size: 0.65rem;
    }

    .print-float-btn .print-select-all span:not(.print-count) {
        display: none;
    }

    .print-float-btn .print-select-all i {
        font-size: 0.9rem;
    }

    /* ✅ Ajustement du bouton de recherche dans la nav pour très petits écrans */
    .nav-mobile-top .nav-search {
        padding-right: 0.5rem;
    }

    .nav-mobile-top .nav-search pagefind-modal-trigger {
        --pagefind-trigger-font-size: 0.7rem;
        --pagefind-trigger-padding: 0.35rem 0.7rem;
    }
}

/* ============================================================
   26. PRINT — VERSION OPTIMISÉE
   ============================================================ */

@media print {

    /* --------------------------------------------------------
       26.1 MASQUER LES ÉLÉMENTS NON PERTINENTS
       -------------------------------------------------------- */
    .nav,
    .scroll-top,
    .menu-toggle,
    .header,
    .footer,
    .lightbox,
    .print-float-btn,
    .print-hint,
    .print-select-row,
    .print-checkbox-wrapper,
    .section-header,
    .quick-access-nav,
    .hero,
    .quote,
    .toggle-btn,
    .read-more-btn,
    .print-select-all,
    .carte-legende,
    #carte-ecoles,
    .video-wrapper,
    .video-thumb,
    .video-caption,
    .video-credit,
    .calameo-wrapper,
    /* ✅ Pagefind : masquer le bouton et la modale à l'impression */
    .header-search,
    .nav-mobile-top,
    pagefind-modal-trigger,
    pagefind-modal {
        display: none !important;
    }

    /* --------------------------------------------------------
       26.2 AFFICHER LES ÉLÉMENTS D'IMPRESSION
       -------------------------------------------------------- */
    .print-header,
    .print-footer { display: block !important; }

    .print-header {
        text-align: center;
        margin-bottom: 0.8rem !important;
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid #333 !important;
    }

    .print-header h1 {
        font-size: 1.2rem !important;
        margin-bottom: 0.15rem !important;
        color: #000 !important;
    }

    .print-header p {
        font-size: 0.75rem !important;
        margin: 0 !important;
        color: #555 !important;
        line-height: 1.2 !important;
    }

    .print-footer {
        margin-top: 1rem !important;
        padding-top: 0.5rem !important;
        border-top: 1px solid #ccc !important;
        text-align: center !important;
        font-size: 0.7rem !important;
        color: #666 !important;
    }

    /* --------------------------------------------------------
       26.3 RESET POUR L'IMPRESSION
       -------------------------------------------------------- */
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        color: black !important;
        font-size: 10.5pt !important;
        line-height: 1.4 !important;
    }

    .section,
    .section-alt {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .content-box {
        margin: 0.5rem 0 !important;
        padding: 0.5rem 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    /* --------------------------------------------------------
       26.4 TITRES COMPACTS
       -------------------------------------------------------- */
    .section-title {
        display: block !important;
        color: #000 !important;
        border-bottom: 1px solid #333 !important;
        font-size: 1.15rem !important;
        margin: 0 0 0.6rem 0 !important;
        padding-bottom: 0.15rem !important;
        page-break-after: avoid;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    h1 { font-size: 1.4rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1.05rem !important; }
    h4 { font-size: 0.95rem !important; }
    h5 { font-size: 0.9rem !important; }

    p {
        margin-bottom: 0.4rem !important;
        orphans: 3;
        widows: 3;
    }

    /* --------------------------------------------------------
       26.5 ACCORDÉONS EN IMPRESSION
       -------------------------------------------------------- */
    .accordion {
        margin-top: 0 !important;
    }

    .accordion-item {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 0.8rem !important;
        page-break-inside: avoid;
        background: transparent !important;
    }

    .accordion-header {
        background: white !important;
        color: black !important;
        border-bottom: 1.5px solid #333 !important;
        padding: 0.3rem 0 !important;
        margin: 0 !important;
        page-break-after: avoid;
        font-size: 1rem !important;
    }

    .accordion-header span { color: black !important; }
    .accordion-header .accordion-icon { display: none !important; }
    .accordion-header .count { color: #666 !important; background: transparent !important; }

    .accordion-body {
        max-height: none !important;
        padding: 0.3rem 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    /* Sous-accordéons */
    .sous-accordion-wrapper {
        border: none !important;
        margin-bottom: 0.5rem !important;
        page-break-inside: avoid;
    }

    .sous-accordion-header {
        background: white !important;
        color: black !important;
        border-bottom: 1px solid #666 !important;
        padding: 0.25rem 0 !important;
        font-size: 0.95rem !important;
    }

    .sous-accordion-header span { color: black !important; }
    .sous-accordion-icon { display: none !important; }

    .sous-accordion-body {
        max-height: none !important;
        padding: 0.2rem 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    /* Afficher tout le contenu caché */
    .full-text { display: block !important; }

    /* --------------------------------------------------------
       26.6 IMAGES ET LOGOS RÉDUITS
       -------------------------------------------------------- */
    img {
        page-break-inside: avoid;
        background: transparent !important;
    }

    /* Logos dans les accordéons */
    .accordion-content-row .logo-col img,
    .accordion-content-row .logo-col img.logo-taille-x2 {
        max-width: 200px !important;
        width: auto !important;
        height: auto !important;
        margin: 0 auto 0.5rem auto !important;
        display: block !important;
    }

    .accordion-content-row .logo-col img.logo-taille-caf {
        max-width: 80px !important;
    }

    /* Logos dans les headers d'accordéons */
    .accordion-header img,
    .accordion-header .header-logo,
    .accordion-header .header-logo-large {
        max-width: 35px !important;
        width: 35px !important;
        height: 35px !important;
        object-fit: contain !important;
    }

    /* Images de contenu */
    .img-contenu-400,
    .accordion-body > img,
    .accordion-body-inner > img,
    .sous-accordion-body > img,
    .full-text > img,
    .sub-section > img {
        max-width: 250px !important;
        width: auto !important;
        height: auto !important;
        margin: 0.3rem auto !important;
        display: block !important;
    }

    /* Miniatures */
    .accordion-image,
    .accordion-body-inner .images img,
    .accordion-card img,
    .card img,
    .card-image {
        max-width: 150px !important;
        width: auto !important;
        height: auto !important;
        max-height: 120px !important;
        object-fit: contain !important;
    }

    /* Images dans les cartes écoles / mairies / lieux */
    .ecole-card img,
    .mairie-card img,
    .lieu-card img {
        max-width: 150px !important;
        height: auto !important;
    }

    /* Galeries */
    .photo-gallery img {
        max-width: 150px !important;
        width: auto !important;
        height: auto !important;
        max-height: 120px !important;
    }

    /* Sous-sections avec image */
    .subsection-with-image .image-wrapper img {
        max-width: 120px !important;
    }

    /* Image CC (carte du territoire) */
    .cc-image-wrapper img {
        max-width: 350px !important;
        margin: 0.3rem auto !important;
    }

    /* Logo MAM */
    .mam-logo-wrapper img {
        max-width: 200px !important;
        width: auto !important;
        margin: 0.3rem auto !important;
    }

    /* Image TER */
    .ter-content img {
        max-width: 180px !important;
        width: auto !important;
        height: auto !important;
    }

    /* Logo header principal */
    .header .logo img {
        max-width: 50px !important;
        height: auto !important;
    }

    /* --------------------------------------------------------
       26.7 IMPRESSION SÉLECTIVE
       -------------------------------------------------------- */
    body.print-has-selection .accordion-item:not(.print-selected) {
        display: none !important;
    }

    body.print-has-selection .content-box:not(:has(.print-selected)) {
        display: none !important;
    }

    body.print-has-selection .content-box:has(.print-selected) {
        display: block !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin: 1rem 0 !important;
    }

    .accordion-item.print-selected {
        display: block !important;
        page-break-inside: avoid;
    }

    body.print-has-selection .content-box:has(.print-selected) > h3 {
        display: block !important;
        font-size: 1.05rem !important;
        color: #000 !important;
        border-bottom: 1px solid #999 !important;
        padding-bottom: 0.15rem !important;
        margin-bottom: 0.5rem !important;
    }

    body.print-has-selection .content-box:has(.print-selected) > p {
        display: none !important;
    }

    /* Impression individuelle des écoles */
    body.print-has-selection .ecole-card:not(.print-selected) {
        display: none !important;
    }

    body.print-has-selection .ecole-card.print-selected {
        display: block !important;
        page-break-inside: avoid;
        border: 1px solid #999 !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Impression individuelle des squares/skateparks */
    body.print-has-selection .lieu-card:not(.print-selected) {
        display: none !important;
    }

    body.print-has-selection .lieu-card.print-selected {
        display: block !important;
        page-break-inside: avoid;
        border: 1px solid #999 !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* ============================================================
       ✅ AJOUT : IMPRESSION INDIVIDUELLE DES MAIRIES
       ============================================================ */
    body.print-has-selection .mairie-card:not(.print-selected) {
        display: none !important;
    }

    body.print-has-selection .mairie-card.print-selected {
        display: block !important;
        page-break-inside: avoid;
        border: 1px solid #999 !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Neutraliser l'en-tête cliquable de la mairie sélectionnée */
    body.print-has-selection .mairie-card.print-selected .mairie-card-header {
        background: transparent !important;
        color: #000 !important;
        padding: 0 !important;
        cursor: default !important;
    }

    body.print-has-selection .mairie-card.print-selected .mairie-card-header h4 {
        color: #000 !important;
        font-size: 1rem !important;
        margin-bottom: 0.3rem !important;
    }

    body.print-has-selection .mairie-card.print-selected .mairie-card-icon {
        display: none !important;
    }

    /* Toujours afficher le corps de la mairie sélectionnée à l'impression */
    body.print-has-selection .mairie-card.print-selected .mairie-card-body {
        max-height: none !important;
        padding: 0.3rem 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    body.print-has-selection .mairie-card.print-selected .mairie-card-body a {
        color: #000 !important;
        text-decoration: none !important;
    }

    /* ============================================================
       ✅ AJOUT : IMPRESSION INDIVIDUELLE DES SOUS-ACCORDÉONS
       (collèges, structures jeunesse, etc.)
       ============================================================ */
    body.print-has-selection .sous-accordion-wrapper:not(.print-selected) {
        display: none !important;
    }

    body.print-has-selection .sous-accordion-wrapper.print-selected {
        display: block !important;
        page-break-inside: avoid;
        border: 1px solid #999 !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Neutraliser l'en-tête cliquable du sous-accordéon sélectionné */
    body.print-has-selection .sous-accordion-wrapper.print-selected .sous-accordion-header {
        background: transparent !important;
        color: #000 !important;
        padding: 0 !important;
        cursor: default !important;
        border-bottom: 1px solid #999 !important;
    }

    body.print-has-selection .sous-accordion-wrapper.print-selected .sous-accordion-header span {
        color: #000 !important;
        font-size: 1rem !important;
    }

    body.print-has-selection .sous-accordion-wrapper.print-selected .sous-accordion-icon {
        display: none !important;
    }

    /* Toujours afficher le corps du sous-accordéon sélectionné */
    body.print-has-selection .sous-accordion-wrapper.print-selected .sous-accordion-body {
        max-height: none !important;
        padding: 0.3rem 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    /* Cacher les vidéos dans les sous-accordéons sélectionnés */
    body.print-has-selection .sous-accordion-wrapper.print-selected .video-wrapper,
    body.print-has-selection .sous-accordion-wrapper.print-selected .video-thumb,
    body.print-has-selection .sous-accordion-wrapper.print-selected .video-caption,
    body.print-has-selection .sous-accordion-wrapper.print-selected .video-credit {
        display: none !important;
    }

    /* Cacher les cases à cocher et leurs labels à l'impression */
    .ecole-print-row,
    .lieu-print-row,
    .mairie-print-row,
    .lieu-print-row {
        display: none !important;
    }

    /* Cacher les images des cartes sélectionnées pour ne garder que le texte */
    body.print-has-selection .ecole-card.print-selected img,
    body.print-has-selection .lieu-card.print-selected img,
    body.print-has-selection .mairie-card.print-selected img,
    body.print-has-selection .sous-accordion-wrapper.print-selected > .sous-accordion-body > img {
        display: none !important;
    }

   /* Réafficher les ancêtres d'une carte sélectionnée */
    body.print-has-selection .accordion-item.print-selected {
        display: block !important;
    }

    body.print-has-selection .content-box.print-selected {
        display: block !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    body.print-has-selection .accordion-card-grid.print-selected {
        display: block !important;
    }

    /* Quand une carte est sélectionnée, masquer les autres cartes du même parent */
    body.print-has-selection .mairie-card:not(.print-selected),
    body.print-has-selection .ecole-card:not(.print-selected),
    body.print-has-selection .lieu-card:not(.print-selected),
    body.print-has-selection .sous-accordion-wrapper:not(.print-selected) {
        display: none !important;
    }

    /* Afficher explicitement les cartes sélectionnées */
    body.print-has-selection .mairie-card.print-selected,
    body.print-has-selection .ecole-card.print-selected,
    body.print-has-selection .lieu-card.print-selected,
    body.print-has-selection .sous-accordion-wrapper.print-selected {
        display: block !important;
        page-break-inside: avoid;
    }

    /* --------------------------------------------------------
       26.8 TABLEAUX
       -------------------------------------------------------- */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
        margin: 0.5rem 0 !important;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* Répéter l'en-tête sur chaque page */
    }

    tfoot {
        display: table-footer-group;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    th, td {
        padding: 0.3rem 0.5rem !important;
        border: 1px solid #999 !important;
        text-align: left !important;
        vertical-align: top !important;
    }

    th {
        background: #f0f0f0 !important;
        font-weight: 700 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    td {
        background: white !important;
        color: #000 !important;
    }

    /* --------------------------------------------------------
       26.9 LISTES
       -------------------------------------------------------- */
    ul, ol {
        margin-left: 1.2rem !important;
        margin-bottom: 0.5rem !important;
        padding-left: 0.5rem !important;
    }

    li {
        margin-bottom: 0.15rem !important;
        page-break-inside: avoid;
        line-height: 1.35 !important;
    }

    ul li::marker,
    ol li::marker {
        color: #333 !important;
    }

    /* Listes imbriquées */
    ul ul, ol ol, ul ol, ol ul {
        margin-top: 0.15rem !important;
        margin-bottom: 0.15rem !important;
        margin-left: 1rem !important;
    }

    /* --------------------------------------------------------
       26.10 LIENS (URL en clair, sauf exceptions)
       -------------------------------------------------------- */
    a[href]:not([href^="#"]):not([href^="tel:"]):not([href^="mailto:"])::after {
        content: " (" attr(href) ")";
        font-size: 0.75em;
        color: #555;
        word-break: break-all;
        font-weight: normal;
    }

    a[href^="#"]::after,
    a[href^="tel:"]::after,
    a[href^="mailto:"]::after {
        content: none !important;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }

    /* --------------------------------------------------------
       26.11 CARTES ET GRILLES
       -------------------------------------------------------- */
    .cards-grid,
    .cards-grid-2,
    .cards-grid-3,
    .cards-grid-4,
    .accordion-card-grid,
    .ecoles-grid,
    .logos-grid,
    .photo-gallery {
        display: block !important;
        margin: 0.3rem 0 !important;
    }

    .card,
    .accordion-card,
    .ecole-card,
    .mairie-card,
    .lieu-card,
    .logo-item {
        display: block !important;
        margin-bottom: 0.5rem !important;
        padding: 0.4rem !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        background: white !important;
        border-left: 3px solid #666 !important;
    }

    .card h3, .card h4,
    .accordion-card h3, .accordion-card h4,
    .ecole-card h4,
    .mairie-card h4 {
        font-size: 0.95rem !important;
        margin-bottom: 0.2rem !important;
    }

    /* --------------------------------------------------------
       26.12 VIDÉOS ET CALAMÉO
       -------------------------------------------------------- */
    iframe {
        display: none !important;
    }

    /* --------------------------------------------------------
       26.13 BADGES ET ÉTIQUETTES
       -------------------------------------------------------- */
    .badge {
        display: inline-block !important;
        background: transparent !important;
        border: 1px solid #666 !important;
        color: #000 !important;
        padding: 0.05rem 0.4rem !important;
        border-radius: 4px !important;
        font-size: 0.7rem !important;
    }

    /* --------------------------------------------------------
       26.14 SAUTS DE PAGE
       -------------------------------------------------------- */
    .content-box,
    .subsection,
    .sub-section {
        page-break-inside: auto;
    }

    /* Éviter les coupures au milieu d'un bloc logo + texte */
    .accordion-content-row {
        page-break-inside: avoid;
    }

    /* --------------------------------------------------------
       26.15 PAGES BLANCHES : ÉVITER LES GRANDS VIDES
       -------------------------------------------------------- */
    body > main {
        display: block !important;
        page-break-before: avoid !important;
    }

    .section {
        page-break-before: avoid !important;
    }

    /* --------------------------------------------------------
       26.16 COULEURS IMPRESSION (optionnel)
       -------------------------------------------------------- */
    /* Forcer l'impression des couleurs de fond (nécessite l'accord de l'utilisateur) */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
