/* Mode nuit — sarvis.fr
   Le thème est posé par un attribut data-theme sur <html> (voir js/nuit.js).
   Les blocs déjà sombres — héro, bandeau contact, pied de page, visionneuse —
   ne sont pas retouchés : ils fonctionnent tels quels dans les deux modes. */

html[data-theme="dark"]{
  color-scheme:dark;
  --card:#16304A;
  --cardb:#27506F;
  --txt:#DDE9F3;
  --grey:#9DB2C4;
  --titre:#E8F2FA;
  --surface:#12263A;
  --surface2:#0E2036;
  --page:#0B1926;
  --line:#1E3A55;
  --lien:#5CC2EA;
}

html[data-theme="dark"] body{background:var(--page);color:var(--txt)}
html[data-theme="dark"] a{color:var(--lien)}
html[data-theme="dark"] :is(a.btn,.btn,.btn.ghost){color:#fff}

/* titres et libellés qui portaient le marine en clair */
html[data-theme="dark"] :is(h1,h2,h3,h4,nav a,.burger,.tag,form label,.hours th,
  .place .acts a,.pole.vs .num,.pole-lots strong,.socle-g strong,.presta .p li strong,
  .presta .p .apres,.perim span,.barre-mobile a.mail,.chiffres b,.joindre a,
  .pers.dir,.pers.dir .role,fieldset.choix legend,.choix .opt b){color:var(--titre)}

/* surfaces blanches */
html[data-theme="dark"] :is(.card,.tag,form,.place,.pole,.presta .p,.chiffres div,
  .joindre>div,.pers,.rdvbox,.site){background:var(--surface)}
/* le fond de nav n'existe qu'en menu déroulant mobile — même condition qu'en mode jour */
@media (max-width:1060px){html[data-theme="dark"] nav{background:var(--surface)}}
html[data-theme="dark"] header{background:rgba(11,25,38,.94);border-bottom-color:var(--line)}
html[data-theme="dark"] .barre-mobile{background:rgba(11,25,38,.97);border-top-color:var(--line);box-shadow:0 -6px 20px rgba(0,0,0,.45)}
@media (max-width:1060px){
  html[data-theme="dark"] nav{border-bottom-color:var(--line);box-shadow:0 12px 26px rgba(0,0,0,.45)}
  html[data-theme="dark"] nav a{border-bottom-color:var(--line)}
}
html[data-theme="dark"] .sec.alt{background:linear-gradient(180deg,#0E2036 0%,#0B1926 100%)}
html[data-theme="dark"] .card:hover{box-shadow:0 10px 30px rgba(0,0,0,.5)}

/* filets et tableaux */
html[data-theme="dark"] :is(.hours th,.hours td,.pole-lots>div,.perim){border-color:var(--line)}

/* formulaires */
html[data-theme="dark"] :is(form input,form select,form textarea){background:#0F2337;color:var(--txt);border-color:var(--cardb)}
html[data-theme="dark"] :is(form input,form select,form textarea)::placeholder{color:#7E95A9}
html[data-theme="dark"] .choix .opt:has(input:checked){background:#17395A}

/* aplats clairs restants */
html[data-theme="dark"] .place .acts a{background:var(--surface2)}
html[data-theme="dark"] .mapbox{background:linear-gradient(135deg,#15304A 0%,#102941 100%)}
html[data-theme="dark"] .rdv-ph{background:linear-gradient(135deg,#12263A,#0E2036)}

/* galeries de la section « Notre structure » */
html[data-theme="dark"] .marque-wrap{background:linear-gradient(180deg,#122539,#0E2036)}
html[data-theme="dark"] .sv-gal__cap{color:var(--txt)}
html[data-theme="dark"] .sv-gal__thumb{background:var(--surface2)}

/* bascule jour / nuit */
.theme-bascule{
  display:inline-grid;place-items:center;flex:0 0 auto;
  width:38px;height:38px;margin-left:8px;padding:0;
  border:1px solid var(--cardb);border-radius:10px;
  background:transparent;color:var(--marine);cursor:pointer;
  transition:color .15s ease,border-color .15s ease;
}
.theme-bascule:hover{border-color:var(--cyan);color:var(--cyan)}
.theme-bascule:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.theme-bascule svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-bascule .ico-soleil{display:none}
html[data-theme="dark"] .theme-bascule{color:var(--titre)}
html[data-theme="dark"] .theme-bascule .ico-soleil{display:block}
html[data-theme="dark"] .theme-bascule .ico-lune{display:none}

/* l'icône vidéosurveillance portait le marine : invisible sur fond sombre */
html[data-theme="dark"] .pole.vs .ico svg{stroke:#7FB6E4}
html[data-theme="dark"] .pole .ico{background:#1B3A58}

/* ------------------------------------------------------------------ */
/* Page Realisations : classes absentes de la page d accueil.          */
/* Sans ces regles, la barre de filtres reste blanche et les textes    */
/* en --marine (chapeaux, strong, lots) disparaissent sur fond sombre. */
html[data-theme="dark"] .filterbar{background:var(--surface2);border-color:var(--line)}
html[data-theme="dark"] .filters button{background:var(--surface);color:var(--txt);border-color:var(--cardb)}
html[data-theme="dark"] .filters button[aria-pressed="true"]{background:var(--cyan);border-color:var(--cyan);color:#06202f}
html[data-theme="dark"] .gal figure{background:var(--surface)}
html[data-theme="dark"] .gal figcaption{background:var(--surface);color:var(--grey)}
html[data-theme="dark"] .lot{color:var(--lien);background:var(--surface2);border-color:var(--line)}
html[data-theme="dark"] .chapeau{color:var(--titre)}
html[data-theme="dark"] :is(strong,b){color:var(--titre)}
html[data-theme="dark"] .proj{border-color:var(--line)}