/*
Theme Name: Douvres
Description: Site officiel de la Mairie de Douvres - reproduction fidele du modele (fond lave neon + mur de pierre organique, curseur plume, nav Nexus en verre, calendrier interactif). Contenu 100% editable : breves, agenda, mot du maire, alertes, annonces des associations (validation mairie), recherche instantanee, admin simplifie + visite guidee.
Author: Maël Davidenko
Author URI: mailto:mael.davidenko@outlook.fr
Version: 2.22.5
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: douvres
*/


        /* --- VARIABLES --- */
        :root {
            --bg-pure: #F8FAFC;
            --text-dark: #0B132B;
            --text-muted: #475569;
            
            --neon-blue: #1E293B;
            --neon-cyan: #475569;
            --neon-pink: #F43F5E;
            --neon-purple: #C084FC;
            --neon-gold: #FBBF24;
            
            --alert-bg: #C85A40; 
            
            --font-ui: 'Plus Jakarta Sans', sans-serif;
            --font-serif: 'Playfair Display', serif;

            --glass-bg: rgba(255, 255, 255, 0.7);
            --glass-border: rgba(255, 255, 255, 0.9);

            /* ambiance unique « pro », validee par la mairie */
            --blob-1:#444B5A; --blob-2:#687085; --blob-3:#9098A8; --blob-4:#555C6B; --blob-5:#AEB4C0; --blob-6:#767E8C;
            --veil:rgba(246,247,249,.36);
            
            --transition-fluid: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);

            /* gouttiere laterale : le contenu n'est JAMAIS colle aux bords (surtout mobile) */
            --dv-gutter: 20px;

            /* Texture grain tactile */
            --stone-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
            
            /* LE MUR DE PIERRE RÉVOLUTIONNAIRE (Masque SVG organique générant des pierres irrégulières et usées) */
            --organic-stone-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300' width='400' height='300'%3E%3Cdefs%3E%3Cfilter id='rough' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.025' numOctaves='3' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='15' xChannelSelector='R' yChannelSelector='G'/%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23rough)' fill='%23FFF'%3E%3Crect x='15' y='15' width='160' height='90' rx='25'/%3E%3Crect x='195' y='10' width='200' height='100' rx='30'/%3E%3Crect x='-20' y='125' width='130' height='85' rx='20'/%3E%3Crect x='130' y='130' width='160' height='95' rx='35'/%3E%3Crect x='310' y='120' width='120' height='85' rx='25'/%3E%3Crect x='20' y='235' width='190' height='90' rx='30'/%3E%3Crect x='230' y='245' width='180' height='80' rx='25'/%3E%3Ccircle cx='185' cy='115' r='14'/%3E%3Ccircle cx='300' cy='225' r='16'/%3E%3Ccircle cx='10' cy='220' r='12'/%3E%3C/g%3E%3C/svg%3E");
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        /* supprime tout micro-delai de tap (double-tap-zoom) : les clics repondent tout de suite */
        a, button, [role="button"], input, select, label, summary { touch-action: manipulation; }

        body.custom-cursor-active, body.custom-cursor-active * { cursor: none !important; }

        /* overflow-x:clip empeche le debordement horizontal SANS creer de conteneur de
           defilement -> l en-tete « sticky » continue de tenir (hidden le cassait). */
        html { overflow-x: hidden; overflow-x: clip; }
        body {
            font-family: var(--font-ui); color: var(--text-dark);
            background-color: #F1F5F9; /* Base très claire */
            overflow-x: hidden; overflow-x: clip; -webkit-font-smoothing: antialiased;
        }

        .container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }

        /* --- SYSTÈME D'ARRIÈRE-PLAN SUPERPOSÉ --- */
        
        /* 1. La Lave Néon (Couche du fond, très intense) */
        .lava-background { position: fixed; inset: 0; z-index: -6; overflow: hidden; filter: url('#gooey'); }
        .blob { position: absolute; border-radius: 50%; filter: blur(50px); animation: float-blob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1); mix-blend-mode: screen; }
        
        /* 6 Sources lumineuses pour traverser les ouvertures */
        /* Couleurs pilotees par l'ambiance active (var --blob-N) */
        .blob-1 { width: 500px; height: 500px; background: var(--blob-1); top: 0%; left: 10%; animation-delay: 0s; opacity: 0.40; }
        .blob-2 { width: 600px; height: 600px; background: var(--blob-2); bottom: -10%; right: 5%; animation-delay: -5s; opacity: 0.38; }
        .blob-3 { width: 450px; height: 450px; background: var(--blob-3); top: 40%; left: 40%; animation-delay: -10s; opacity: 0.34; }
        .blob-4 { width: 400px; height: 400px; background: var(--blob-4); top: 20%; right: 20%; animation-delay: -3s; opacity: 0.34; }
        .blob-5 { width: 350px; height: 350px; background: var(--blob-5); bottom: 20%; left: 20%; animation-delay: -7s; opacity: 0.34; }
        .blob-6 { width: 550px; height: 550px; background: var(--blob-6); top: 10%; right: 40%; animation-delay: -12s; opacity: 0.36; }

        /* 2. Filtre flou léger pour fusionner les néons (Plasma) */
        .lava-glass-overlay { position: fixed; inset: 0; background: var(--veil); backdrop-filter: blur(34px); z-index: -5; pointer-events: none; }
        @media (max-width: 760px){ .lava-glass-overlay { backdrop-filter: blur(14px); } }

        /* 3. Le Mur de pierre troué (image generee : faussé, fissuré, courbé, tres estompé).
              Les trous sont transparents -> les neons (couches du dessous) percent uniquement par la. */
        .stone-wall-layer {
            position: fixed; inset: 0; z-index: -4; pointer-events: none;
            background-image: url("assets/img/img-1-f9b3a30a.png");
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            /* fond tres discret */
            opacity: 0.92;
        }

        @keyframes float-blob {
            0% { transform: translate(0, 0) scale(1); }
            50% { transform: translate(15vw, 15vh) scale(1.2); }
            100% { transform: translate(-10vw, -10vh) scale(0.85); }
        }

        /* --- CURSEUR PERSONNALISE : plume / texte / bouton (facon jeu Rust) --- */
        #ink-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 9997; mix-blend-mode: difference; }

        /* conteneur plume : transform-origin = la POINTE (nib) -> elle colle au point d'encre */
        #custom-cursor {
            position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
            --nib-x: 6.8%; --nib-y: 94.2%;         /* position de la pointe dans l'image */
            transform-origin: 0 0;                 /* rotation autour du coin = la pointe, posee sur le curseur */
            will-change: transform; transition: opacity 0.2s;
        }
        .feather-img {
            display: block; width: 68px; height: auto;
            /* decale l'image pour que la POINTE tombe sur le coin du conteneur (= le curseur). En %, donc robuste a la taille reelle. */
            transform: translate(calc(-1 * var(--nib-x)), calc(-1 * var(--nib-y)));
            filter: drop-shadow(2px 4px 6px rgba(11,19,43,0.34)) drop-shadow(0 1px 1px rgba(11,19,43,0.22));
        }

        /* point d'encre : la pointe ecrit ici */
        /* point d'encre supprime (la plume ecrit directement sa trainee) */
        #cursor-dot { display: none; }

        /* mode TEXTE : I-beam d'encre */
        #cursor-ibeam {
            position: fixed; top: 0; left: 0; width: 3px; height: 26px; background: var(--text-dark);
            pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); transition: opacity 0.15s;
        }
        #cursor-ibeam::before, #cursor-ibeam::after {
            content: ""; position: absolute; left: 50%; transform: translateX(-50%);
            width: 11px; height: 3px; background: var(--text-dark);
        }
        #cursor-ibeam::before { top: 0; } #cursor-ibeam::after { bottom: 0; }

        /* mode BOUTON : anneau d'encre qui pulse autour du point */
        #cursor-ring {
            position: fixed; top: 0; left: 0; width: 30px; height: 30px;
            border: 2px solid var(--text-dark); border-radius: 50%;
            pointer-events: none; z-index: 9998; transform: translate(-50%, -50%); transition: opacity 0.15s;
        }
        body.ctx-button #cursor-ring { animation: ring-pulse 1.1s ease-in-out infinite; }
        @keyframes ring-pulse {
            0%,100% { width: 30px; height: 30px; opacity: 0.9; }
            50%     { width: 38px; height: 38px; opacity: 0.5; }
        }

        /* visibilite selon le contexte */
        #custom-cursor, #cursor-dot, #cursor-ibeam, #cursor-ring { opacity: 0; }
        body.cursor-ready.ctx-default #custom-cursor,
        body.cursor-ready.ctx-button  #custom-cursor { opacity: 1; }
        body.cursor-ready.ctx-default #cursor-dot    { opacity: 1; }
        body.cursor-ready.ctx-button  #cursor-ring   { opacity: 1; }
        body.cursor-ready.ctx-text    #cursor-ibeam  { opacity: 1; }

        /* --- BANDEAU DÉROULANT --- */
        .marquee-wrapper {
            background: var(--alert-bg); color: white; padding: 12px 0;
            overflow: hidden; white-space: nowrap;
            position: relative; z-index: 1001; font-size: 0.9rem; font-weight: 700;
            letter-spacing: 1px; text-transform: uppercase;
        }
        /* width:max-content => le contenu prend sa vraie largeur (2 groupes) : translateX(-50%)
           avance donc EXACTEMENT d un groupe = boucle sans couture. */
        .marquee-content { display: flex; width: max-content; animation: scroll-left 26s linear infinite; will-change: transform; }
        /* chaque groupe = au moins un ecran de large, alertes reparties uniformement :
           defilement continu et regulier meme avec une seule alerte. */
        .mq-seq { display: flex; align-items: center; justify-content: space-around; flex: 0 0 auto; min-width: min(100vw, 100%); box-sizing: border-box; }
        .mq-seq span { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; padding: 0 32px; }
        .marquee-wrapper:hover .marquee-content { animation-play-state: paused; } /* pause au survol pour lire */
        @keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
        @media (prefers-reduced-motion: reduce) {
            .marquee-content { animation: none; width: 100%; }
            .mq-seq { min-width: 0; flex: 1 1 100%; justify-content: center; gap: 32px; }
            .mq-seq[aria-hidden="true"] { display: none; }
            .blob { animation: none; }                 /* fond fige : zero calcul par frame */
            .lava-background { filter: none; }
            html { scroll-behavior: auto; }
            .accueil-bg, #cursor-ring, .news-card, .service-card, .nav-visual-card img, .rub-card, .passe-card { animation: none !important; transition: none !important; transform: none !important; }
        }
        /* MOBILE : le fond « lave » cesse d'animer (6 blobs floutes sous le filtre gooey = tres
           couteux PAR FRAME sur telephone). Il reste colore mais statique -> batterie + fluidite. */
        @media (max-width: 900px) {
            .blob { animation: none; }
        }

        /* --- L'ÎLOT "NEXUS" --- */
        /* ===== EN-TETE : pilule flottante + menu deroulant a images (ouverture au CLIC via bouton Menu) ===== */
        .nexus-wrapper { position: sticky; top: 18px; left: 0; width: 100%; display: flex; justify-content: center; z-index: 1000; padding: 0 16px; margin: 18px 0 40px; }
        .nexus-hub { background: var(--glass-bg); backdrop-filter: blur(30px); border: 1px solid var(--glass-border); border-radius: 100px; width: 560px; max-width: 100%; transition: var(--transition-fluid); box-shadow: 0 10px 40px rgba(0,0,0,0.08); overflow: hidden; display: flex; flex-direction: column; }
        .nexus-hub.open { width: 940px; border-radius: 30px; box-shadow: 0 30px 60px -12px rgba(11,19,43,0.20); }
        .nexus-bar { display: flex; align-items: center; padding: 10px 12px 10px 22px; gap: 12px; }
        .n-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
        .n-blason { height: 46px; width: auto; display: block; filter: drop-shadow(0 3px 6px rgba(11,19,43,0.2)); }
        .n-name { font-family: var(--font-serif); font-weight: 700; font-style: italic; font-size: 1.7rem; color: var(--text-dark); line-height: 1; }
        .n-search { flex-grow: 1; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; white-space: nowrap; cursor: pointer; padding: 8px 4px; border-radius: 100px; }
        .n-search:hover { color: var(--text-dark); }
        /* le bouton MENU : cible franche, toujours visible, se transforme en croix a l'ouverture */
        .n-menu { flex-shrink: 0; display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.5); color: var(--text-dark); font-family: var(--font-ui); font-weight: 800; font-size: 0.86rem; padding: 10px 16px 10px 13px; border-radius: 100px; cursor: pointer; transition: background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
        .n-menu:hover { background: #fff; box-shadow: 0 6px 16px rgba(11,19,43,0.1); }
        .n-menu:focus-visible { outline: 2px solid var(--neon-blue); outline-offset: 2px; }
        .n-menu-ico { position: relative; width: 18px; height: 13px; display: inline-block; }
        .n-menu-ico span { position: absolute; left: 0; width: 100%; height: 2.2px; border-radius: 2px; background: currentColor; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; }
        .n-menu-ico span:nth-child(1) { top: 0; }
        .n-menu-ico span:nth-child(2) { top: 50%; transform: translateY(-50%); }
        .n-menu-ico span:nth-child(3) { bottom: 0; }
        .nexus-hub.open .n-menu-ico span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
        .nexus-hub.open .n-menu-ico span:nth-child(2) { opacity: 0; }
        .nexus-hub.open .n-menu-ico span:nth-child(3) { bottom: auto; top: 50%; transform: translateY(-50%) rotate(-45deg); }
        .nexus-dropdown { height: 0; opacity: 0; overflow: hidden; padding: 0 22px; display: grid; grid-template-columns: 2fr 1fr; gap: 22px; transition: var(--transition-fluid); pointer-events: none; }
        .nexus-hub.open .nexus-dropdown { height: 470px; opacity: 1; padding: 8px 22px 26px; pointer-events: auto; }
        /* ===== DEUX SYSTEMES DEDIES =====
           PC (souris) : ouverture au SURVOL, le bouton « Menu » est masqué (inutile a la souris).
           Mobile/tactile : pas de survol -> le bouton « Menu » (tap) ouvre via .open. */
        @media (hover: hover) and (pointer: fine) {
            .nexus-wrapper:hover .nexus-hub { width: 940px; border-radius: 30px; box-shadow: 0 30px 60px -12px rgba(11,19,43,0.20); }
            .nexus-wrapper:hover .nexus-dropdown { height: 470px; opacity: 1; padding: 8px 22px 26px; pointer-events: auto; }
            .n-menu { display: none; }
        }
        .nav-visual-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; gap: 12px; }
        .nav-visual-card { position: relative; border-radius: 18px; overflow: hidden; text-decoration: none; color: #fff; display: flex; align-items: flex-end; padding: 16px; background: var(--text-dark); border: 1px solid rgba(255,255,255,0.35); }
        .nav-visual-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; transition: 0.6s; z-index: 1; filter: grayscale(18%); }
        .nav-visual-card:hover img { transform: scale(1.06); opacity: 0.4; }
        .nav-visual-card span { font-family: var(--font-serif); font-size: 1.3rem; font-style: italic; position: relative; z-index: 3; text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
        .nexus-widget { background: rgba(248,250,252,0.75); border-radius: 18px; padding: 24px; border: 1px solid var(--glass-border); display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
        @media (max-width: 760px){
            .nexus-wrapper { top: 12px; margin: 12px 0 30px; padding: 0 12px; }
            .nexus-hub, .nexus-hub.open { width: 100%; }
            .nexus-bar { padding: 8px 10px; gap: 8px; }
            .n-blason { height: 40px; }
            .n-name { font-size: 1.45rem; }
            .n-search { flex-grow: 1; justify-content: flex-end; }
            .n-search span { display: none; }
            .n-menu { padding: 11px 14px; }
            .n-menu-txt { display: none; } /* sur mobile l'icone suffit, on gagne de la place */
            .n-menu-ico { width: 20px; height: 15px; }
            .nexus-dropdown { grid-template-columns: 1fr; }
            .nexus-hub.open .nexus-dropdown { height: auto; max-height: 76vh; overflow-y: auto; padding: 10px 16px 20px; }
            .nav-visual-grid { grid-auto-rows: 100px; }
        }


        /* --- ACCUEIL --- */
        .accueil-section { position: relative; height: 75vh; min-height: 600px; margin: 0 40px 60px; border-radius: 32px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.8); }
        .accueil-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform 20s ease-out; }
        .accueil-section:hover .accueil-bg { transform: scale(1.03); }
        .accueil-gradient { position: absolute; inset: 0; z-index: 2; background: linear-gradient(to right, rgba(11,19,43,0.85) 0%, rgba(11,19,43,0.3) 60%, transparent 100%); }

        .pinned-note-wrapper { position: absolute; top: 50%; left: 8%; transform: translateY(-50%) rotate(-2.6deg); z-index: 3; max-width: 550px; transition: var(--transition-fluid); }
        .pinned-note-wrapper:hover { transform: translateY(-52%) rotate(0deg) scale(1.02); z-index: 10;}
        
        /* Bout de scotch qui tient le mot du maire */
        .note-tape { position: absolute; top: -15px; left: 50%; width: 140px; height: 34px; transform: translateX(-50%) rotate(-3.5deg); z-index: 4; background: linear-gradient(135deg, rgba(228,232,240,0.60), rgba(206,212,224,0.48)); box-shadow: 0 4px 10px rgba(0,0,0,0.14); backdrop-filter: blur(2px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 7px, #000 calc(100% - 7px), transparent); mask-image: linear-gradient(90deg, transparent, #000 7px, #000 calc(100% - 7px), transparent); }
        .note-tape::after { content:''; position:absolute; inset:0; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.09) 0 5px, rgba(255,255,255,0) 5px 11px); }

        .pinned-note {
            background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(25px);
            padding: 50px 40px 40px; border-radius: 24px 24px 40px 24px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
            border: 1px solid rgba(255,255,255,1);
            position: relative; overflow: hidden;
        }

        .note-tag { background: var(--text-dark); color: white; padding: 6px 16px; border-radius: 100px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; display: inline-block; margin-bottom: 24px; }
        .note-title { font-family: var(--font-serif); font-size: 3.2rem; line-height: 1; margin-bottom: 24px; color: var(--text-dark); font-style: italic; }
        .note-text { font-size: 1.15rem; line-height: 1.6; color: var(--text-muted); font-weight: 500; margin-bottom: 32px; }
        
        .mayor-signature { display: flex; align-items: center; gap: 16px; border-top: 1px solid #E2E8F0; padding-top: 24px; }
        .mayor-signature img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); filter: grayscale(100%); }
        .mayor-signature h4 { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 2px; line-height: 1; }
        .mayor-signature span { font-size: 0.85rem; font-weight: 700; color: var(--neon-blue); text-transform: uppercase; letter-spacing: 1px; }

        /* --- LE KIOSQUE --- */
        .kiosque-section { padding: 60px 40px 120px; }
        .section-header { margin-bottom: 40px; display: flex; justify-content: space-between; align-items: flex-end; }
        .section-title { font-family: var(--font-serif); font-size: clamp(2.3rem, 7vw, 4.5rem); line-height: 1; color: var(--text-dark); }
        .section-title span { color: var(--neon-cyan); font-style: italic; }
        
        .news-grid { display: flex; gap: 24px; height: 500px; }
        
        .news-card {
            flex: 1; position: relative; border-radius: 32px; overflow: hidden;
            transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
            background: var(--text-dark); box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            border: 1px solid rgba(255,255,255,0.6);
        }
        .news-card:hover { flex: 3; box-shadow: 0 20px 40px rgba(6, 182, 212, 0.2); }
        
        .news-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transition: 0.6s; filter: grayscale(20%); z-index: 1;}
        .news-card:hover img { opacity: 0.8; transform: scale(1.02); filter: grayscale(0%); }
        .news-card-gradient { position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,19,43,0.9) 0%, transparent 70%); z-index: 3;}

        .news-content { position: absolute; bottom: 0; left: 0; width: 100%; padding: 40px; color: white; display: flex; flex-direction: column; justify-content: flex-end; z-index: 4;}
        .news-tag { background: rgba(255,255,255,0.2); backdrop-filter: blur(10px); padding: 6px 16px; border-radius: 100px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; width: fit-content; margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.3); }
        .news-title { font-family: var(--font-serif); font-weight: 700; font-style: italic; font-size: 2.2rem; line-height: 1.1; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: 0.4s; }
        .news-card:hover .news-title { white-space: normal; font-size: 3.2rem; }
        
        .news-hidden-text { max-height: 0; opacity: 0; overflow: hidden; transition: 0.6s ease; font-size: 1.1rem; color: rgba(255,255,255,0.9); }
        .news-card:hover .news-hidden-text { max-height: 100px; opacity: 1; margin-top: 16px; }

    
        /* ===== LE MOIS A DOUVRES : Actualites + Agenda ===== */
        .month-section { padding: 30px 0 110px; }
        .month-section .section-header { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:42px; flex-wrap:wrap; }
        .month-pill { font-family: var(--font-ui); font-weight:800; font-size:.78rem; letter-spacing:2px; text-transform:uppercase; color:#fff; background:var(--text-dark); padding:11px 22px; border-radius:100px; box-shadow:0 10px 26px rgba(11,19,43,.2); }
        .month-layout { display:grid; grid-template-columns:1.7fr 1fr; gap:32px; align-items:start; }

        .actu-featured { position:relative; display:block; border-radius:26px; overflow:hidden; text-decoration:none; color:#fff; box-shadow:0 24px 60px rgba(11,19,43,.22); aspect-ratio:16/10; }
        .actu-featured img { width:100%; height:100%; object-fit:cover; transition:transform .9s cubic-bezier(.2,.8,.2,1); }
        .actu-featured:hover img { transform:scale(1.06); }
        .actu-featured .grad { position:absolute; inset:0; background:linear-gradient(to top, rgba(8,11,26,.93) 0%, rgba(8,11,26,.4) 46%, transparent 76%); }
        .actu-featured .body { position:absolute; left:0; right:0; bottom:0; padding:34px; }
        .actu-date { font-size:.76rem; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; opacity:.9; margin-bottom:12px; display:flex; align-items:center; gap:12px; }
        .actu-tag { display:inline-block; padding:5px 13px; border-radius:100px; font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:#fff; }
        .actu-featured h3 { font-family:var(--font-serif); font-style:italic; font-weight:700; font-size:2.5rem; line-height:1.04; margin-bottom:14px; }
        .actu-featured p { font-size:.97rem; line-height:1.55; max-width:580px; opacity:.92; }

        .actu-list { display:flex; flex-direction:column; gap:13px; margin-top:18px; }
        .actu-item { display:flex; gap:18px; align-items:center; background:var(--glass-bg); backdrop-filter:blur(20px); border:1px solid var(--glass-border); border-radius:18px; padding:13px; text-decoration:none; color:var(--text-dark); transition:transform .3s, box-shadow .3s; box-shadow:0 6px 20px rgba(11,19,43,.06); }
        .actu-item:hover { transform:translateX(7px); box-shadow:0 14px 32px rgba(11,19,43,.13); }
        .actu-thumb { width:96px; height:74px; border-radius:13px; object-fit:cover; flex-shrink:0; }
        .actu-thumb.ph { display:flex; align-items:center; justify-content:center; font-family:var(--font-serif); font-style:italic; font-size:1.6rem; color:#fff; }
        .actu-item .meta { font-size:.7rem; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:#59637A; margin-bottom:6px; display:flex; align-items:center; gap:8px; }
        .actu-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
        .actu-item h4 { font-family:var(--font-serif); font-style:italic; font-size:1.28rem; line-height:1.12; }

        .agenda-card { background:var(--glass-bg); backdrop-filter:blur(24px); border:1px solid var(--glass-border); border-radius:26px; padding:26px; box-shadow:0 24px 60px rgba(11,19,43,.12); position:sticky; top:24px; }
        .agenda-title { font-family:var(--font-serif); font-style:italic; font-size:1.8rem; margin-bottom:3px; }
        .agenda-sub { font-size:.8rem; color:#59637A; margin-bottom:22px; }
        .cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
        .cal-head .m { font-weight:800; font-size:.96rem; letter-spacing:.4px; }
        .cal-nav { display:flex; gap:7px; }
        .cal-nav button { width:31px; height:31px; border-radius:10px; border:1px solid rgba(11,19,43,.12); background:transparent; cursor:pointer; color:var(--text-dark); font-size:1.05rem; line-height:1; display:flex; align-items:center; justify-content:center; transition:.2s; }
        .cal-nav button:hover { background:var(--text-dark); color:#fff; border-color:var(--text-dark); }
        .cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
        .cal-dow { text-align:center; font-size:.64rem; font-weight:800; color:#69748A; padding-bottom:7px; }
        @media (max-width:760px){ .cal-nav button { width:40px; height:40px; } }
        /* focus clavier visible partout (RGAA) */
        a:focus-visible, button:focus-visible, [role="button"]:focus-visible, .nav-visual-card:focus-visible, .service-card:focus-visible, .actu-item:focus-visible, .actu-featured:focus-visible, .rub-card:focus-visible, .passe-card:focus-visible, .dvs-chip:focus-visible, .cal-cell:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--neon-blue); outline-offset: 2px; border-radius: 6px; }
        .cal-cell { aspect-ratio:1; display:flex; align-items:center; justify-content:center; font-size:.82rem; border-radius:10px; position:relative; color:var(--text-dark); }
        .cal-cell.empty { visibility:hidden; }
        .cal-cell.has-ev { cursor:pointer; font-weight:800; }
        .cal-cell.has-ev:hover { background:rgba(110,132,174,.16); }
        .cal-cell.today { box-shadow:inset 0 0 0 2px var(--text-dark); font-weight:800; }
        .cal-cell.sel { background:var(--text-dark); color:#fff; }
        .cal-evdot { position:absolute; bottom:6px; left:50%; transform:translateX(-50%); width:5px; height:5px; border-radius:50%; }
        .cal-cell.sel .cal-evdot { background:#fff !important; }
        .agenda-divider { height:1px; background:rgba(11,19,43,.08); margin:20px 0 14px; }
        .agenda-list { display:flex; flex-direction:column; gap:5px; max-height:340px; overflow-y:auto; padding-right:4px; }
        .agenda-list::-webkit-scrollbar { width:6px; } .agenda-list::-webkit-scrollbar-thumb { background:rgba(11,19,43,.15); border-radius:6px; }
        .ag-item { display:flex; gap:14px; padding:10px; border-radius:14px; transition:background .2s; }
        .ag-item:hover { background:rgba(110,132,174,.1); }
        .ag-chip { flex-shrink:0; width:52px; text-align:center; border-radius:13px; padding:8px 0; color:#fff; }
        .ag-chip .d { font-size:1.35rem; font-weight:800; font-family:var(--font-serif); line-height:1; }
        .ag-chip .mo { font-size:.6rem; font-weight:800; text-transform:uppercase; letter-spacing:1px; opacity:.92; margin-top:2px; }
        .ag-body { min-width:0; align-self:center; }
        .ag-body .t { font-family:var(--font-serif); font-style:italic; font-size:1.12rem; line-height:1.13; }
        .ag-body .det { font-size:.75rem; color:#59637A; margin-top:4px; display:flex; gap:12px; flex-wrap:wrap; }
        .ag-body .det span { display:inline-flex; align-items:center; gap:4px; }
        .ag-today-badge { font-size:.58rem; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:#fff; background:#B6A883; padding:2px 8px; border-radius:100px; margin-left:8px; vertical-align:middle; }
        .ag-empty { font-size:.85rem; color:#59637A; padding:16px; text-align:center; }
        .ag-alllink { display:inline-flex; align-items:center; gap:6px; margin-top:16px; font-size:.82rem; font-weight:800; color:var(--text-dark); text-decoration:none; cursor:pointer; transition:.2s; }
        .ag-alllink:hover { color:#6E84AE; }
        @media (max-width:900px){ .month-layout { grid-template-columns:1fr; } .agenda-card { position:static; } .actu-featured h3 { font-size:1.9rem; } }
    
    
    
        /* ===== VIE PRATIQUE (services) ===== */
        .services-section { padding: 30px 0 110px; }
        .section-lead { font-family: var(--font-ui); font-size: 1.05rem; color: var(--text-muted); max-width: 440px; line-height: 1.6; }
        .services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 22px; margin-top: 14px; }
        .service-card { background: var(--glass-bg); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 22px; padding: 30px 28px; text-decoration: none; box-shadow: 0 12px 36px rgba(0,0,0,0.07); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; display: block; }
        .service-card:hover { transform: translateY(-6px); box-shadow: 0 26px 56px rgba(0,0,0,0.13); }
        .service-ic { width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan)); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,0.14); }
        .service-ic svg { width: 28px; height: 28px; }
        .service-card h3 { font-family: var(--font-serif); font-size: 1.5rem; color: var(--text-dark); margin-bottom: 8px; }
        .service-card p { font-family: var(--font-ui); font-size: .94rem; color: var(--text-muted); line-height: 1.55; }
        .arrivants-banner { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 30px 36px; border-radius: 24px; background: linear-gradient(120deg, var(--neon-blue), var(--neon-cyan)); color: #fff; box-shadow: 0 18px 44px rgba(0,0,0,0.16); }
        .arrivants-banner h3 { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 4px; }
        .arrivants-banner p { font-family: var(--font-ui); font-size: .98rem; opacity: .94; max-width: 560px; }
        .arrivants-banner a { flex-shrink: 0; background: #fff; color: var(--text-dark); font-family: var(--font-ui); font-weight: 700; font-size: .95rem; padding: 14px 26px; border-radius: 100px; text-decoration: none; transition: transform .25s; white-space: nowrap; }
        .arrivants-banner a:hover { transform: scale(1.05); }

        /* ===== PATRIMOINE (photo lavoir) ===== */
        .patrimoine-section { padding: 30px 0 120px; }
        .patr-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: stretch; margin-top: 14px; }
        .patr-photo { position: relative; border-radius: 28px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.18); margin: 0; min-height: 440px; }
        .patr-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s ease; }
        .patr-photo:hover img { transform: scale(1.05); }
        .patr-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 56px 30px 24px; background: linear-gradient(to top, rgba(11,19,43,0.85), transparent); color: #fff; font-family: var(--font-ui); font-size: 1rem; }
        .patr-photo figcaption strong { font-family: var(--font-serif); font-style: italic; font-size: 1.5rem; display: block; margin-bottom: 4px; }
        .patr-list { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
        .patr-item { display: flex; gap: 18px; align-items: flex-start; padding: 17px 16px; border-radius: 18px; transition: background .3s; }
        .patr-item:hover { background: var(--glass-bg); }
        .patr-ic { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; background: var(--glass-bg); border: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center; color: var(--neon-blue); }
        .patr-ic svg { width: 24px; height: 24px; }
        .patr-item h4 { font-family: var(--font-serif); font-size: 1.32rem; color: var(--text-dark); margin-bottom: 2px; }
        .patr-item p { font-family: var(--font-ui); font-size: .9rem; color: var(--text-muted); line-height: 1.5; }
        @media (max-width: 900px){ .patr-layout { grid-template-columns: 1fr; } .patr-photo { min-height: 320px; } }
        /* ===== CONFORT + FLECHE REMONTER + RESPONSIVE ===== */
        html { scroll-behavior: smooth; }
        section[id] { scroll-margin-top: 100px; }

        .to-top { position: fixed; bottom: 24px; right: 24px; z-index: 1500; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); backdrop-filter: blur(18px); box-shadow: 0 10px 28px rgba(0,0,0,0.16); display: flex; align-items: center; justify-content: center; color: var(--text-dark); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .3s, transform .3s, visibility .3s, background .25s, color .25s; }
        .to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
        .to-top:hover { background: var(--text-dark); color: #fff; }
        .to-top svg { width: 24px; height: 24px; }

        @media (max-width: 760px){
            /* gouttiere garantie : au moins --dv-gutter, plus si encoche (iPhone…) */
            .container { padding-left: max(var(--dv-gutter), env(safe-area-inset-left)); padding-right: max(var(--dv-gutter), env(safe-area-inset-right)); }
            /* le cadre de l'image (hero) : bordure nette + coins arrondis sur mobile */
            .accueil-section { height: auto; min-height: 0; margin: 0 var(--dv-gutter) 40px; display: flex; align-items: center; padding: 40px 18px; border: 2px solid rgba(255,255,255,0.95); box-shadow: 0 16px 40px rgba(11,19,43,0.20); }
            .pinned-note-wrapper { position: relative; top: auto; left: auto; transform: none; width: 100%; max-width: 480px; margin: 0 auto; }
            .pinned-note-wrapper:hover { transform: none; }
            /* le mot du maire encadré nettement (la bordure blanche d'origine est invisible sur la photo) */
            .pinned-note { padding: 40px 22px 26px; border-radius: 20px 20px 30px 20px; background: rgba(255,255,255,0.94); border: 1.5px solid rgba(11,19,43,0.14); box-shadow: 0 18px 44px rgba(11,19,43,0.24); }
            .note-title { font-size: 2rem; }
            .note-text { font-size: 1rem; margin-bottom: 24px; }
            .mayor-signature img { width: 54px; height: 54px; }
            .mayor-signature h4 { font-size: 1.5rem; }
            /* padding VERTICAL seulement : la gouttiere laterale vient de .container (plus de blocs colles aux bords) */
            .kiosque-section { padding-block: 24px 64px; }
            .month-section, .services-section, .patrimoine-section { padding-block: 20px 64px; }
            .section-header { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 26px; }
            .news-grid { flex-direction: column; height: auto; gap: 18px; }
            .news-card { flex: none; height: 290px; }
            .news-card:hover { flex: none; }
            .news-title { white-space: normal; font-size: 1.9rem; }
            .news-card:hover .news-title { font-size: 1.9rem; }
            .news-content { padding: 28px; }
            .arrivants-banner { padding: 24px 22px; }
            .arrivants-banner h3 { font-size: 1.5rem; }
            .patr-photo figcaption { padding: 44px 22px 20px; }
        }
        @media (max-width: 560px){
            .to-top { bottom: 16px; right: 16px; width: 46px; height: 46px; }
        }

    