/*
 * style.css — Feuille de style principale du site de la Commune de Sand
 *
 * Organisation du fichier :
 *  1. Variables CSS (couleurs, polices)
 *  2. Reset et styles de base
 *  3. En-tête (header)
 *  4. Navigation
 *  5. Section héro (grande image d'accueil)
 *  6. Bandeau de statistiques
 *  7. Contenu principal
 *  8. Sections réutilisables (cartes, boutons)
 *  9. Pages spécifiques (arrêtés, sandimètre, contact)
 * 10. Pied de page (footer)
 * 11. Responsive (adaptation mobile)
 */

/* ============================================================
   1. VARIABLES CSS (thème du site — couleurs de commune-sand.com)
   Modifiez ces valeurs pour changer l'apparence globale.
   ============================================================ */
:root {
    /* Palette bleue — fidèle au site commune-sand.com (thème BeTheme) */
    --bleu-fonce:    #161922;   /* Bleu très sombre : header, footer, nav */
    --bleu-principal:#0095eb;   /* Bleu vif principal : boutons, liens actifs */
    --bleu-moyen:    #0089f7;   /* Bleu moyen : hover */
    --bleu-sombre:   #1E3096;   /* Bleu sombre : accents, icônes stats */
    --bleu-pale:     #e8f2fb;   /* Bleu très pâle : fonds de section */

    /* Alias pour rétrocompatibilité avec le reste du code */
    --vert-fonce:    var(--bleu-fonce);
    --vert-principal:var(--bleu-principal);
    --vert-moyen:    var(--bleu-moyen);
    --vert-clair:    #007cc3;
    --vert-pale:     var(--bleu-pale);

    /* Couleur dorée : mise en avant, badges */
    --or:            #f5a623;
    --or-clair:      #f9c846;

    /* Couleurs neutres */
    --blanc:         #ffffff;
    --fond-page:     #f5f7fa;
    --fond-gris:     #f0f2f5;
    --bordure:       #d0d8e8;
    --texte:         #1e2433;
    --texte-moyen:   #4a5568;
    --texte-clair:   #718096;

    /* Footer — même couleur sombre que la nav du site .com */
    --footer-fond:   #0f1219;
    --footer-texte:  #a0aec0;

    /* Dimensions */
    --largeur-max:   1180px;
    --rayon:         6px;      /* Arrondi des coins */
    --ombre:         0 2px 12px rgba(0,0,0,0.12);

    /* Typographie */
    --police-titre:  'Poppins', 'Segoe UI', sans-serif;
    --police-corps:  'Open Sans', 'Segoe UI', sans-serif;
}

/* ============================================================
   2. RESET ET STYLES DE BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--police-corps);
    color: var(--texte);
    background-color: var(--fond-page);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Accessibilité WCAG 2.1 ──────────────────────────────────
   Lien "Aller au contenu principal" — visible uniquement au clavier.
   Permet aux utilisateurs de lecteur d'écran et de navigation clavier
   de passer la barre de navigation pour accéder directement au contenu.
   ──────────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100px;          /* Caché hors de l'écran par défaut */
    left: 1rem;
    z-index: 9999;
    background: var(--bleu-fonce);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 0 0 6px 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;               /* Visible quand l'utilisateur navigue au clavier (Tab) */
    outline: 3px solid var(--or);
    outline-offset: 2px;
}

/* Focus visible pour la navigation clavier — WCAG 2.1 niveau AA */
:focus-visible {
    outline: 3px solid var(--bleu-principal);
    outline-offset: 3px;
    border-radius: 3px;
}

main {
    flex: 1;
}

a {
    color: var(--vert-principal);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--vert-moyen);
    text-decoration: underline;
}

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

h1, h2, h3, h4 {
    font-family: var(--police-titre);
    font-weight: 600;
    line-height: 1.25;
    color: var(--vert-fonce);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; margin: 1.5rem 0 0.8rem; }
h3 { font-size: 1.25rem; margin: 1.2rem 0 0.6rem; }

p { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }

/* Classe utilitaire : conteneur centré avec largeur max */
.conteneur {
    width: 100%;
    max-width: var(--largeur-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   3. EN-TÊTE (HEADER)
   ============================================================ */

/* Barre d'information fine en haut de la page */
.barre-info {
    background-color: var(--bleu-fonce);
    color: var(--footer-texte);
    font-size: 0.82rem;
    padding: 0.4rem 0;
    border-bottom: 2px solid var(--bleu-principal);
}

.barre-info .conteneur {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.barre-info a {
    color: var(--footer-texte);
}

.barre-info a:hover {
    color: var(--blanc);
    text-decoration: none;
}

/* Bloc principal de l'en-tête */
header.site-entete {
    background-color: var(--blanc);
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.entete-interieur {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    max-width: var(--largeur-max);
    margin: 0 auto;
    gap: 1rem;
}

/* Logo et nom du site */
.logo-lien {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo-lien img {
    height: 60px;
    width: auto;
}

/* Logo textuel (affiché si pas d'image logo) */
.logo-texte {
    display: flex;
    flex-direction: column;
}

.logo-nom {
    font-family: var(--police-titre);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--vert-fonce);
    line-height: 1.1;
}

.logo-slogan {
    font-size: 0.75rem;
    color: var(--texte-clair);
    font-style: italic;
}

/* Badge téléphone dans l'en-tête
   Sur mobile : affiche un lien d'appel (tel:)
   Sur bureau : affiche un lien vers le formulaire de contact
   La bascule est gérée par .tel-mobile / .tel-desktop en responsive */
.badge-telephone {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background-color: var(--bleu-pale);
    color: var(--bleu-sombre);
    border: 1px solid var(--bleu-principal);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-telephone a {
    color: var(--bleu-sombre);
    text-decoration: none;
    font-weight: 600;
}

.badge-telephone a:hover {
    color: var(--bleu-principal);
    text-decoration: none;
}

/* Par défaut (bureau) : lien de contact visible, lien tel: caché */
.tel-mobile  { display: none; }
.tel-desktop { display: inline; }

/* Bouton hamburger (mobile uniquement) */
.btn-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
}

.btn-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--vert-fonce);
    transition: all 0.3s ease;
}

/* ============================================================
   4. NAVIGATION
   ============================================================ */
nav.navigation-principale {
    background-color: var(--bleu-fonce);
}

.nav-liste {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: var(--largeur-max);
    margin: 0 auto;
}

.nav-liste > li {
    position: relative;
}

/* Lien de navigation */
.nav-liste > li > a {
    display: block;
    color: var(--blanc);
    padding: 1rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-liste > li > a:hover,
.nav-liste > li.actif > a {
    background-color: var(--vert-principal);
    color: var(--blanc);
}

/* Indicateur de sous-menu */
.nav-liste > li.a-sous-menu > a::after {
    content: ' ▾';
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Sous-menu déroulant */
.sous-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--blanc);
    min-width: 220px;
    box-shadow: var(--ombre);
    border-top: 3px solid var(--vert-principal);
    border-radius: 0 0 var(--rayon) var(--rayon);
    z-index: 999;
    list-style: none;
    padding: 0.4rem 0;
}

.nav-liste > li:hover .sous-menu,
.nav-liste > li:focus-within .sous-menu {
    display: block;
}

.sous-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--texte);
    font-size: 0.88rem;
    text-decoration: none;
    transition: background-color 0.15s;
}

.sous-menu li a:hover {
    background-color: var(--vert-pale);
    color: var(--vert-principal);
    text-decoration: none;
}

/* ============================================================
   5. SECTION HÉRO (grande image de la page d'accueil)
   ============================================================ */
.hero {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

/* Image de fond du héro */
.hero-fond {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Dégradé bleu par défaut — remplacé par la photo aérienne de Sand via l'admin */
    background-image: linear-gradient(135deg, #0f1219 0%, #1E3096 50%, #0095eb 100%);
    transition: transform 0.3s;
}

/* Couche sombre semi-transparente pour que le texte soit lisible sur la photo */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 18, 25, 0.50) 0%,
        rgba(15, 18, 25, 0.68) 100%
    );
}

.hero-contenu {
    position: relative;
    z-index: 1;
    color: var(--blanc);
    padding: 3rem 1.5rem;
    max-width: 800px;
}

.hero-titre {
    font-family: var(--police-titre);
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    margin-bottom: 0.75rem;
    color: var(--blanc);
}

.hero-sous-titre {
    font-size: 1.2rem;
    opacity: 0.92;
    font-weight: 300;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
}

/* Bouton(s) dans le héro */
.hero-boutons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   6. BANDEAU DE STATISTIQUES (chiffres clés)
   ============================================================ */
.bandeau-stats {
    background-color: var(--bleu-sombre);
    color: var(--blanc);
    padding: 2rem 0;
}

.bandeau-stats .conteneur {
    display: flex;
    justify-content: center;
    gap: 0;
}

.stat-item {
    text-align: center;
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.stat-item:last-child {
    border-right: none;
}

.stat-nombre {
    display: block;
    font-family: var(--police-titre);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.3rem;
    color: var(--or-clair);
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   7. CONTENU PRINCIPAL
   ============================================================ */

/* Zones de contenu standard avec espacement */
.section-contenu {
    padding: 3rem 0;
}

.section-contenu.fond-blanc {
    background-color: var(--blanc);
}

.section-contenu.fond-gris {
    background-color: var(--fond-gris);
}

/* Grille deux colonnes : texte + panneau info */
.grille-2col {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    align-items: start;
}

/* Titre de section avec trait vert */
.titre-section {
    font-family: var(--police-titre);
    font-size: 1.8rem;
    color: var(--vert-fonce);
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--vert-clair);
    display: inline-block;
}

/* Panneau d'information latéral */
.panneau-info {
    background-color: var(--bleu-fonce);
    color: var(--footer-texte);
    border-radius: var(--rayon);
    padding: 1.8rem;
    position: sticky;
    top: 100px;
}

.panneau-info h3 {
    color: var(--or-clair);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.panneau-info p, .panneau-info li {
    font-size: 0.9rem;
    color: var(--footer-texte);
    margin-bottom: 0.5rem;
}

.panneau-info a {
    color: var(--or-clair);
}

.panneau-info strong {
    color: var(--blanc);
}

/* ============================================================
   8. COMPOSANTS RÉUTILISABLES
   ============================================================ */

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--rayon);
    font-family: var(--police-titre);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1;
}

.btn-principal {
    background-color: var(--vert-principal);
    color: var(--blanc);
    border-color: var(--vert-principal);
}

.btn-principal:hover {
    background-color: var(--vert-moyen);
    border-color: var(--vert-moyen);
    color: var(--blanc);
    text-decoration: none;
}

.btn-contour {
    background-color: transparent;
    color: var(--blanc);
    border-color: rgba(255,255,255,0.7);
}

.btn-contour:hover {
    background-color: rgba(255,255,255,0.15);
    color: var(--blanc);
    text-decoration: none;
}

/* ── Bouton Facebook ────────────────────────────────────────────────────── */
/* Couleur officielle Facebook (#1877F2) avec logo SVG intégré */
.btn-facebook {
    background-color: #1877F2;
    color: #fff;
    border-color: #1877F2;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}
.btn-facebook:hover {
    background-color: #1565C0;
    border-color: #1565C0;
    color: #fff;
    text-decoration: none;
}

.btn-danger {
    background-color: #c0392b;
    color: var(--blanc);
    border-color: #c0392b;
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem;
}

.btn-danger:hover {
    background-color: #a93226;
    border-color: #a93226;
    color: var(--blanc);
    text-decoration: none;
}

/* Titre de page (breadcrumb visuel) */
.titre-page {
    background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu-sombre));
    color: var(--blanc);
    padding: 2.5rem 0;
    margin-bottom: 0;
}

.titre-page h1 {
    color: var(--blanc);
    font-size: 2rem;
    margin: 0;
}

.titre-page .fil-ariane {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.7);
    margin-top: 0.4rem;
}

.titre-page .fil-ariane a {
    color: rgba(255,255,255,0.75);
}

.titre-page .fil-ariane a:hover {
    color: var(--blanc);
    text-decoration: none;
}

/* Messages d'alerte (succès, erreur) */
.alerte {
    padding: 0.9rem 1.2rem;
    border-radius: var(--rayon);
    margin-bottom: 1.2rem;
    font-size: 0.92rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alerte-succes {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alerte-erreur {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alerte-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================================
   9. PAGES SPÉCIFIQUES
   ============================================================ */

/* ── Arrêtés ── */
.liste-arretes,
.liste-sandimetres {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.carte-arrete,
.carte-sandimetre {
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.carte-arrete:hover,
.carte-sandimetre:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.10);
}

/* Icône PDF à gauche */
.icone-document {
    flex-shrink: 0;
    width: 48px;
    height: 58px;
    background-color: var(--bleu-pale);
    border-radius: var(--rayon);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bleu-principal);
    font-size: 1.6rem;
}

.infos-document {
    flex: 1;
    min-width: 0;
}

.infos-document .titre-doc {
    font-family: var(--police-titre);
    font-size: 1rem;
    font-weight: 600;
    color: var(--vert-fonce);
    margin-bottom: 0.25rem;
}

.infos-document .date-doc {
    font-size: 0.82rem;
    color: var(--texte-clair);
    margin-bottom: 0.3rem;
}

.infos-document .desc-doc {
    font-size: 0.88rem;
    color: var(--texte-moyen);
    margin: 0;
}

.action-document {
    flex-shrink: 0;
}

/* ── Sandimètre : affichage avec couverture ── */
.carte-sandimetre.avec-couverture {
    align-items: flex-start;
}

.couverture-sandimetre {
    flex-shrink: 0;
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid var(--bordure);
    box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
}

.badge-numero {
    display: inline-block;
    background-color: var(--bleu-pale);
    color: var(--bleu-principal);
    border: 1px solid var(--bleu-principal);
    border-radius: 50px;
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

/* ── Formulaire de contact ── */
.formulaire-contact {
    background: var(--blanc);
    border-radius: var(--rayon);
    padding: 2rem;
    box-shadow: var(--ombre);
}

.champ-formulaire {
    margin-bottom: 1.2rem;
}

.champ-formulaire label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--vert-fonce);
    margin-bottom: 0.35rem;
}

.champ-formulaire label .requis {
    color: #c0392b;
    margin-left: 2px;
}

.champ-formulaire input,
.champ-formulaire textarea,
.champ-formulaire select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--bordure);
    border-radius: var(--rayon);
    font-family: var(--police-corps);
    font-size: 0.95rem;
    color: var(--texte);
    background-color: var(--fond-page);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.champ-formulaire input:focus,
.champ-formulaire textarea:focus,
.champ-formulaire select:focus {
    outline: none;
    border-color: var(--vert-principal);
    box-shadow: 0 0 0 3px rgba(46, 107, 62, 0.15);
    background-color: var(--blanc);
}

.champ-formulaire textarea {
    min-height: 140px;
    resize: vertical;
}

/* Case RGPD */
.champ-rgpd {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--texte-moyen);
}

.champ-rgpd input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    accent-color: var(--vert-principal);
}

/* ============================================================
   10. PIED DE PAGE (FOOTER)
   ============================================================ */
footer.site-footer {
    background-color: var(--bleu-fonce);
    color: var(--footer-texte);
    padding: 3rem 0 0;
    margin-top: auto;
}

.footer-grille {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-colonne h4 {
    font-family: var(--police-titre);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--or-clair);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-colonne p,
.footer-colonne li,
.footer-colonne address {
    font-size: 0.88rem;
    font-style: normal;
    line-height: 1.7;
    color: var(--footer-texte);
    margin-bottom: 0.4rem;
}

.footer-colonne a {
    color: var(--footer-texte);
    transition: color 0.2s;
}

.footer-colonne a:hover {
    color: var(--or-clair);
    text-decoration: none;
}

.footer-colonne ul {
    list-style: none;
    padding: 0;
}

.footer-colonne ul li::before {
    content: '› ';
    color: var(--vert-clair);
}

/* Barre de copyright en bas */
.footer-bas {
    padding: 1rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
}

.footer-bas a {
    color: rgba(255,255,255,0.45);
}

/* ============================================================
   11. RESPONSIVE — Adaptation aux petits écrans
   ============================================================ */

/* Tablette (moins de 1024px) */
@media (max-width: 1024px) {
    .grille-2col {
        grid-template-columns: 1fr;
    }

    .panneau-info {
        position: static;
    }

    .footer-grille {
        grid-template-columns: 1fr 1fr;
    }

    .hero-titre {
        font-size: 2.2rem;
    }
}

/* Mobile (moins de 768px) */
@media (max-width: 768px) {

    /* En-tête : sur mobile → lien tel: affiché, lien contact masqué */
    .badge-telephone .tel-mobile  { display: inline; }
    .badge-telephone .tel-desktop { display: none; }

    /* Bouton hamburger visible sur mobile */
    .btn-menu {
        display: flex;
    }

    /* Navigation : masquée par défaut sur mobile */
    nav.navigation-principale {
        display: none;
    }

    nav.navigation-principale.ouverte {
        display: block;
    }

    .nav-liste {
        flex-direction: column;
    }

    .nav-liste > li > a {
        padding: 0.85rem 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    /* Sous-menus mobiles : affichés en bloc sous le parent */
    .sous-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-top: none;
        background-color: rgba(0,0,0,0.2);
        padding: 0;
    }

    .sous-menu.ouverte {
        display: block;
    }

    .sous-menu li a {
        color: rgba(255,255,255,0.8);
        padding-left: 2.5rem;
    }

    /* Héro */
    .hero {
        min-height: 300px;
    }

    .hero-titre {
        font-size: 1.7rem;
    }

    .hero-sous-titre {
        font-size: 1rem;
    }

    /* Stats */
    .bandeau-stats .conteneur {
        flex-direction: column;
        gap: 0;
    }

    .stat-item {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding: 1rem;
    }

    .stat-item:last-child {
        border-bottom: none;
    }

    /* Footer */
    .footer-grille {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Cartes de documents */
    .carte-arrete,
    .carte-sandimetre {
        flex-direction: column;
        align-items: flex-start;
    }

    .barre-info .message-info {
        display: none;
    }
}

/* Très petit mobile */
@media (max-width: 480px) {
    .conteneur {
        padding: 0 1rem;
    }

    .hero-titre {
        font-size: 1.4rem;
    }

    .hero-boutons {
        flex-direction: column;
    }

    .titre-section {
        font-size: 1.4rem;
    }
}

/* ============================================================
   12. BANNIÈRE RGPD — CONSENTEMENT AUX COOKIES
   ============================================================ */

/* Bandeau fixe en bas de l'écran */
.cookie-bandeau {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(22, 25, 34, 0.97);
    color: #dde4f0;
    padding: 1.1rem 1.5rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    border-top: 3px solid var(--bleu-principal);
    font-size: 0.87rem;
    line-height: 1.55;
}

/* Zone de texte explicatif */
.cookie-texte {
    flex: 1;
    min-width: 260px;
}

.cookie-texte a {
    color: var(--bleu-principal);
    text-decoration: underline;
}

.cookie-texte a:hover {
    color: var(--bleu-moyen);
}

/* Boutons d'action */
.cookie-boutons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

/* Bouton "Accepter" */
.cookie-bouton-accepter {
    background: var(--bleu-principal);
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: var(--rayon);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--police-titre);
    transition: background 0.2s;
    white-space: nowrap;
}

.cookie-bouton-accepter:hover {
    background: var(--bleu-moyen);
}

/* Bouton "Refuser" */
.cookie-bouton-refuser {
    background: transparent;
    color: #dde4f0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.6rem 1.2rem;
    border-radius: var(--rayon);
    cursor: pointer;
    font-size: 0.88rem;
    font-family: var(--police-titre);
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-bouton-refuser:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Lien "En savoir plus" */
.cookie-bouton-info {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    text-decoration: underline;
    white-space: nowrap;
    transition: color 0.2s;
}

.cookie-bouton-info:hover {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

/* Sur mobile : empile verticalement */
@media (max-width: 640px) {
    .cookie-bandeau {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-boutons {
        width: 100%;
    }
}

/* ============================================================
   13. LIGHTBOX — AFFICHAGE D'IMAGES EN PLEIN ÉCRAN
   ============================================================ */

/* Fond sombre semi-transparent qui couvre toute la page */
.lightbox-fond {
    display: none; /* Caché par défaut — affiché via JS avec la classe .actif */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

/* Affiché via JavaScript */
.lightbox-fond.actif {
    display: flex;
}

/* Image affichée dans la lightbox */
.lightbox-fond img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
    display: block;
}

/* Bouton de fermeture (×) en haut à droite */
.lightbox-fermer {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.2rem 0.5rem;
    z-index: 10001;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-fermer:hover {
    opacity: 1;
}

/* Curseur "zoom-in" sur les images avec lightbox dans le contenu des pages */
.contenu-wysiwyg img.img-lightbox {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.contenu-wysiwyg img.img-lightbox:hover {
    opacity: 0.88;
}

/* ============================================================
   14. CAPTCHA ANTI-SPAM (formulaire de contact)
   ============================================================ */

/* Zone de vérification mathématique */
.champ-captcha {
    background: var(--bleu-pale);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.champ-captcha label {
    font-weight: 600;
    color: var(--bleu-sombre);
    margin: 0;
}

.champ-captcha input[type="number"] {
    width: 90px !important;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ============================================================
   15. ALIGNEMENT D'IMAGES (figure / figcaption) — éditeur WYSIWYG
   ============================================================
   Ces classes sont insérées automatiquement par l'éditeur WYSIWYG
   de l'administration quand vous choisissez un alignement d'image.
   Elles fonctionnent à l'intérieur de .contenu-wysiwyg.
   ============================================================ */

/*
 * Conteneur de figure : supprime les marges par défaut du navigateur
 * et ajoute un peu d'espace autour de l'image.
 */
.contenu-wysiwyg figure {
    margin: 0;
    padding: 0;
}

/*
 * Légende sous l'image (balise <figcaption>).
 * Style discret et italique, centré par rapport à l'image.
 */
.contenu-wysiwyg figcaption {
    font-size: 0.82rem;
    color: var(--texte-moyen, #718096);
    font-style: italic;
    text-align: center;
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* ── Centré ─────────────────────────────────────────────────────────────── */
/* L'image est centrée horizontalement, avec un retour à la ligne avant/après */
.contenu-wysiwyg figure.img-centre {
    display: block;
    text-align: center;
    margin: 1.2rem auto;
    clear: both;
}
.contenu-wysiwyg figure.img-centre img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ── Alignement gauche (texte flotte à droite) ──────────────────────────── */
.contenu-wysiwyg figure.img-gauche {
    float: left;
    margin: 0.5rem 1.4rem 1rem 0;
    max-width: 45%;
    clear: left;
}
.contenu-wysiwyg figure.img-gauche img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* ── Alignement droite (texte flotte à gauche) ──────────────────────────── */
.contenu-wysiwyg figure.img-droite {
    float: right;
    margin: 0.5rem 0 1rem 1.4rem;
    max-width: 45%;
    clear: right;
}
.contenu-wysiwyg figure.img-droite img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* ── Pleine largeur ─────────────────────────────────────────────────────── */
/* L'image prend toute la largeur de la colonne de contenu */
.contenu-wysiwyg figure.img-pleine-largeur {
    display: block;
    width: 100%;
    margin: 1.2rem 0;
    clear: both;
}
.contenu-wysiwyg figure.img-pleine-largeur img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Nettoyage des flottants après une figure flottante */
.contenu-wysiwyg p::after,
.contenu-wysiwyg section::after {
    content: '';
    display: table;
    clear: both;
}

/* Sur mobile : les images flottantes passent en pleine largeur */
@media (max-width: 600px) {
    .contenu-wysiwyg figure.img-gauche,
    .contenu-wysiwyg figure.img-droite {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
}

/* ============================================================
   16. STYLES DE TABLEAUX — insérés par l'éditeur WYSIWYG
   ============================================================
   Ces classes sont utilisées par l'éditeur lors de l'insertion
   d'un tableau. Elles s'appliquent dans .contenu-wysiwyg.
   ============================================================ */

/* Base commune à tous les styles de tableaux */
.contenu-wysiwyg table {
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.2rem 0;
    overflow-x: auto;
    display: block;
}

.contenu-wysiwyg table caption {
    caption-side: top;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--texte-moyen, #718096);
    margin-bottom: 0.5rem;
    text-align: left;
    font-weight: 600;
}

.contenu-wysiwyg table th,
.contenu-wysiwyg table td {
    padding: 0.55rem 0.8rem;
    text-align: left;
    vertical-align: top;
}

/* En-tête de tableau */
.contenu-wysiwyg table thead th {
    background-color: var(--bleu-fonce, #161922);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ── Tableau à lignes horizontales seulement ────────────────────────────── */
.contenu-wysiwyg table.tableau-basique th,
.contenu-wysiwyg table.tableau-basique td {
    border-bottom: 1px solid var(--bordure, #d0d8e8);
}

/* ── Tableau grille (toutes cellules bordées) ───────────────────────────── */
.contenu-wysiwyg table.tableau-grille,
.contenu-wysiwyg table.tableau-grille th,
.contenu-wysiwyg table.tableau-grille td {
    border: 1px solid var(--bordure, #d0d8e8);
}

/* ── Tableau zébré (lignes alternées) ───────────────────────────────────── */
.contenu-wysiwyg table.tableau-zebre tbody tr:nth-child(even) {
    background-color: var(--bleu-pale, #f0f5ff);
}
.contenu-wysiwyg table.tableau-zebre th,
.contenu-wysiwyg table.tableau-zebre td {
    border-bottom: 1px solid var(--bordure, #d0d8e8);
}

/* ── Tableau sans bordure ───────────────────────────────────────────────── */
.contenu-wysiwyg table.tableau-sans-bordure th,
.contenu-wysiwyg table.tableau-sans-bordure td {
    border: none;
}

/* Sur mobile : tous les tableaux deviennent scrollables horizontalement */
@media (max-width: 700px) {
    .contenu-wysiwyg table {
        font-size: 0.82rem;
    }
    .contenu-wysiwyg table th,
    .contenu-wysiwyg table td {
        padding: 0.4rem 0.5rem;
    }
}

/* ============================================================
   17. POLICES DE CARACTÈRES — sélecteur de police (éditeur WYSIWYG)
   ============================================================
   Classes insérées par Quill (format "font") quand une police est
   choisie dans le contenu. Doivent être définies ici aussi car le
   contenu de .contenu-wysiwyg est du HTML brut échappé tel quel.
   ============================================================ */
.contenu-wysiwyg .ql-font-opensans { font-family: 'Open Sans', sans-serif; }
.contenu-wysiwyg .ql-font-poppins   { font-family: 'Poppins', sans-serif; }
.contenu-wysiwyg .ql-font-georgia   { font-family: Georgia, serif; }
.contenu-wysiwyg .ql-font-arial     { font-family: Arial, sans-serif; }

/* ============================================================
   18. VIDÉO INTÉGRÉE — fichier uploadé depuis l'éditeur WYSIWYG
   ============================================================
   Distinct des embeds YouTube/Vimeo (natifs Quill, gérés par
   .ql-video ailleurs) : ici la balise <video> HTML5 native.
   ============================================================ */
.contenu-wysiwyg video {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    margin: 1.2rem 0 0;
    background: #000;
}
.contenu-wysiwyg figure:has(video) {
    margin: 1.2rem 0;
}


/* ══════════════════════════════════════════════════════════════════════════════
   POPUP D'ANNONCE — Fenêtre modale configurable
   Géré via Admin > Paramètres > Annonce.
   ══════════════════════════════════════════════════════════════════════════════ */

/* Overlay plein écran — fond assombri */
.popup-annonce-overlay {
    position: fixed;
    inset: 0;                         /* top/right/bottom/left = 0 */
    z-index: 9999;
    background: rgba(0, 0, 0, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Empêche le scroll du body quand la popup est ouverte */
body.popup-annonce-ouverte {
    overflow: hidden;
}

/* Boîte centrale de la popup */
.popup-annonce-boite {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.30);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: popup-entree 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation d'apparition avec léger rebond */
@keyframes popup-entree {
    from { opacity: 0; transform: scale(0.88) translateY(-18px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* Zone du contenu WYSIWYG */
.popup-annonce-contenu {
    padding: 2rem 2rem 1rem;
}

/* Pied de la popup — aligné à droite */
.popup-annonce-pied {
    padding: 0.8rem 2rem 1.6rem;
    display: flex;
    justify-content: flex-end;
}

/* Bouton de fermeture */
.popup-annonce-btn {
    background: var(--bleu-principal, #0095eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--police-titre, Poppins, sans-serif);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.popup-annonce-btn:hover  { background: var(--bleu-fonce, #005fa3); }
.popup-annonce-btn:active { transform: scale(0.97); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .popup-annonce-boite  { border-radius: 10px; max-height: 92vh; }
    .popup-annonce-contenu { padding: 1.2rem 1.2rem 0.8rem; }
    .popup-annonce-pied   { padding: 0.6rem 1.2rem 1.2rem; }
    .popup-annonce-btn    { width: 100%; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   ENCART D'ANNONCE — Bloc sur la page d'accueil (avant "Découvrir Sand")
   Géré via Admin > Paramètres > Annonce (mode encart).
   ══════════════════════════════════════════════════════════════════════════════ */

.encart-annonce {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
    border-left: 5px solid var(--bleu-principal, #0095eb);
    padding: 1.6rem 0;
}

/* Conteneur interne : contenu à gauche, bouton à droite */
.encart-annonce .conteneur {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

/* Zone du contenu WYSIWYG de l'encart */
.encart-annonce-contenu {
    flex: 1;
}

/* Bouton de fermeture de l'encart */
.encart-annonce-fermer {
    flex-shrink: 0;
    margin-top: 0.2rem;
    background: var(--bleu-principal, #0095eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--police-titre, Poppins, sans-serif);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
}
.encart-annonce-fermer:hover  { background: var(--bleu-fonce, #005fa3); }
.encart-annonce-fermer:active { transform: scale(0.97); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .encart-annonce .conteneur {
        flex-direction: column;
        gap: 1rem;
    }
    .encart-annonce-fermer {
        width: 100%;
        text-align: center;
    }
}
