/* SIMA Motos : version sombre (suit le réglage « thème sombre » de l'appareil, via prefers-color-scheme).
   Les marqueurs data-hyo-f / data-hyo-c / data-hyo-b sont posés par sombre.js d'après les couleurs réelles de la page. */
@media (prefers-color-scheme: dark) {
  :root {
    --hyo-s-fond: #0f1317;        /* fond de page et sections blanches */
    --hyo-s-fond2: #161b21;       /* sections gris clair */
    --hyo-s-surface: #1d242b;     /* cartes, blocs, champs, menus déroulants (ex-blanc) */
    --hyo-s-surface2: #262e37;    /* onglets et accordéons fermés (ex-gris clair) */
    --hyo-s-bleuclair: #1a2a38;   /* carrés des pictogrammes */
    --hyo-s-texte: #e8ecef;
    --hyo-s-texte2: #aab4be;
    --hyo-s-bleu: #6fb5e6;        /* liens, surtitres, gros chiffres, pictogrammes */
    --hyo-s-filet: #2b333b;
    --hyo-s-filet-fort: #d5dade;
  }

  /* Le temps que sombre.js marque les éléments (quelques millisecondes), on évite un flash blanc.
     Filet de sécurité : la page s'affiche de toute façon après 0,7 s. */
  html:not(.hyo-sombre-ok) #page-container { visibility: hidden; animation: hyo-secours 0s linear .7s forwards; }
  html.hyo-sombre-ok #page-container { visibility: visible; animation: none; }
  @keyframes hyo-secours { to { visibility: visible; } }

  html, body, #page-container, #main-content, #et-main-area { background-color: var(--hyo-s-fond) !important; }
  body { color: var(--hyo-s-texte); }

  /* Les sélecteurs sont volontairement lourds (html body + marqueur répété) pour passer devant les règles Divi à 3 ou 4 classes avec !important */
  /* Fonds */
  html body [data-hyo-f="base"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f], html body #page-container [data-hyo-f="base"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f] { background-color: var(--hyo-s-fond) !important; }
  html body [data-hyo-f="blanc"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f], html body #page-container [data-hyo-f="blanc"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f] { background-color: var(--hyo-s-surface) !important; }
  html body [data-hyo-f="gris"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f], html body #page-container [data-hyo-f="gris"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f] { background-color: var(--hyo-s-fond2) !important; }
  html body [data-hyo-f="gris2"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f], html body #page-container [data-hyo-f="gris2"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f] { background-color: var(--hyo-s-surface2) !important; }
  html body [data-hyo-f="clair"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f], html body #page-container [data-hyo-f="clair"][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f] { background-color: var(--hyo-s-bleuclair) !important; }
  /* Textes */
  html body [data-hyo-c="noir"][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c], html body #page-container [data-hyo-c="noir"][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c] { color: var(--hyo-s-texte) !important; }
  html body [data-hyo-c="gris"][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c], html body #page-container [data-hyo-c="gris"][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c] { color: var(--hyo-s-texte2) !important; }
  html body [data-hyo-c="bleu"][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c], html body #page-container [data-hyo-c="bleu"][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c] { color: var(--hyo-s-bleu) !important; }
  /* Bordures */
  html body [data-hyo-b="clair"][data-hyo-b][data-hyo-b][data-hyo-b][data-hyo-b], html body #page-container [data-hyo-b="clair"][data-hyo-b][data-hyo-b][data-hyo-b][data-hyo-b] { border-color: var(--hyo-s-filet) !important; }
  html body [data-hyo-b="sombre"][data-hyo-b][data-hyo-b][data-hyo-b][data-hyo-b], html body #page-container [data-hyo-b="sombre"][data-hyo-b][data-hyo-b][data-hyo-b][data-hyo-b] { border-color: var(--hyo-s-filet-fort) !important; }

  /* En-tête et menu */
  #main-header, #main-header.et-fixed-header { background-color: #12171c !important; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) !important; }
  #logo { filter: invert(1) hue-rotate(180deg); }
  #top-menu > li > a::before { background: var(--hyo-s-bleu); }
  .nav li ul, .et_mobile_menu { border-top-color: var(--hyo-s-bleu) !important; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
  .et_mobile_menu li a { border-bottom-color: rgba(255, 255, 255, .06) !important; }
  /* Menu mobile : Divi le construit en JavaScript après coup, on fixe ses couleurs en dur en plus du marquage */
  .et_mobile_menu, #mobile_menu { background-color: var(--hyo-s-surface) !important; }
  .et_mobile_menu li a, #top-menu a, #top-menu li li a { color: var(--hyo-s-texte) !important; }
  .et_mobile_menu .menu-item-has-children > a { background-color: rgba(255, 255, 255, .04) !important; }
  .nav li ul, #top-menu li ul { background-color: var(--hyo-s-surface) !important; }

  /* Icône du menu mobile (trois traits) et loupe : noires dans Divi, invisibles sur l'en-tête sombre (constaté le 02/11/2026) */
  #main-header .mobile_menu_bar:before, #main-header .mobile_menu_bar:after, #et_search_icon:before, .et_close_search_field:after { color: var(--hyo-s-texte) !important; }

  #top-menu > li.current-menu-item > a, #top-menu > li.current-menu-ancestor > a, html #top-menu > li.current-menu-item > a { color: var(--hyo-s-bleu) !important; }

  /* Carte des revendeurs : liste et bulles arrivent après le chargement (AJAX), couleurs fixées en dur */
  #wpsl-wrap, #wpsl-result-list, #wpsl-stores li, #wpsl-stores p, #wpsl-search-wrap, #wpsl-search-wrap label, .wpsl-store-location { color: var(--hyo-s-texte) !important; }
  #wpsl-wrap a, #wpsl-stores a, .wpsl-directions, .wpsl-store-details, .leaflet-popup-content a { color: var(--hyo-s-bleu) !important; }
  #wpsl-stores li { border-bottom-color: var(--hyo-s-filet) !important; }
  #wpsl-wrap input, #wpsl-wrap select { color: var(--hyo-s-texte) !important; background-color: var(--hyo-s-surface) !important; border-color: var(--hyo-s-filet) !important; }
  #wpsl-search-btn, #wpsl-wrap #wpsl-search-btn { background-image: none !important; background-color: #004B7A !important; color: #fff !important; border: 0 !important; text-shadow: none !important; box-shadow: none !important; }

  /* Modules Divi dont les règles sont trop lourdes pour le marquage : titres d'accordéon et d'onglets, articles du blog, boutons contour */
  .et_pb_toggle_title, .et_pb_toggle .et_pb_toggle_title, .et_pb_tabs_controls li a, .et_pb_blog_grid .et_pb_post .entry-title a, .et_pb_post .entry-title a, .et_pb_post .post-content, .et_pb_post .post-content p, .et_pb_post .post-meta, .et_pb_post .post-meta a, .et_pb_post .more-link { color: var(--hyo-s-texte) !important; }
  .et_pb_post .post-meta, .et_pb_post .post-meta a { color: var(--hyo-s-texte2) !important; }
  /* Boutons : texte clair quel que soit le marqueur. Sélecteur plus lourd que la règle générale [data-hyo-c="bleu"] ci-dessus,
     sinon le texte d'un même bouton sortait blanc ou bleu selon le chargement (contrôle du 10/11/2026). */
  html body #page-container .et_pb_button[data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c] { color: var(--hyo-s-texte) !important; border-color: var(--hyo-s-filet-fort) !important; }
  html body #page-container .et_pb_button[data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c][data-hyo-c]:hover { color: #000 !important; background-color: var(--hyo-s-texte) !important; }

  /* Pictogrammes SVG maison (trait bleu) */
  svg[stroke="#004B7A"] { stroke: var(--hyo-s-bleu); }
  svg[stroke="#004B7A"] [fill="#004B7A"] { fill: var(--hyo-s-bleu); }
  svg[stroke="#004B7A"] [fill="#fff"] { fill: var(--hyo-s-bleuclair); }
  .et_pb_text_inner > h2:first-child::after, .hyo-h2::after { background: var(--hyo-s-bleu); }

  /* Accordéons et onglets Divi : icônes */
  .et_pb_toggle_title::before, .et_pb_toggle .et_pb_toggle_title::before { color: var(--hyo-s-bleu) !important; }

  /* Photos studio sur fond blanc (JPEG) : on les présente comme une vignette claire, volontaire */
  .hyo-bandeau-clair .hyo-studio { background: #fff; border-radius: 14px; }
  .hyo-carte-photo { border-radius: 6px 6px 0 0; }
  .hyo-carte { border-radius: 6px; overflow: hidden; }
  .hyo-btn-contour:hover { background: var(--hyo-s-texte) !important; color: #000 !important; }
  .hyo-faq-item summary::after { color: var(--hyo-s-bleu); }
  /* « + » des départements (liste des revendeurs) : bleu Hyosung illisible sur fond sombre, contraste 1,9:1 (contrôle du 12/11/2026) */
  .hyo-rev-dept summary::after { color: var(--hyo-s-bleu) !important; }
  .hyo-sm-bouton { color: var(--hyo-s-bleu) !important; }
  /* Onglets de la fiche : l'onglet ouvert se détache (même gris que les fermés avant, contrôle du 12/11/2026) */
  html body #page-container .hyo-onglet-btn[data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f], html body #page-container .hyo-onglet-btn { background-color: var(--hyo-s-fond2) !important; color: var(--hyo-s-texte2) !important; }
  html body #page-container .hyo-onglet-btn.est-actif[data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f][data-hyo-f], html body #page-container .hyo-onglet-btn.est-actif { background-color: var(--hyo-s-surface) !important; color: var(--hyo-s-texte) !important; box-shadow: inset 0 -3px 0 var(--hyo-s-bleu); }
  .hyo-onglets-nav { background-color: var(--hyo-s-fond2) !important; }

  /* Formulaires (Fluent Forms et autres) */
  ::placeholder { color: #7d8790 !important; opacity: 1; }
  .fluentform .ff-el-form-control:focus { border-color: var(--hyo-s-bleu) !important; box-shadow: 0 0 0 3px rgba(111, 181, 230, .2); }

  /* Carte des revendeurs (Leaflet / OpenStreetMap) : fond de carte assombri, bulles et liste en sombre */
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.7); }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--hyo-s-surface) !important; color: var(--hyo-s-texte) !important; box-shadow: 0 6px 20px rgba(0, 0, 0, .6); }
  /* Texte des bulles : le nom du revendeur (gras) restait gris foncé sur fond sombre (1.6.14, contrôle du 18/11/2026) */
  .leaflet-popup-content, .leaflet-popup-content p, .leaflet-popup-content strong, .leaflet-popup-content span, .leaflet-popup-content div { color: var(--hyo-s-texte) !important; }
  .leaflet-popup-content a { color: var(--hyo-s-bleu) !important; }
  .leaflet-popup-close-button { color: var(--hyo-s-texte2) !important; }
  .leaflet-popup-close-button:hover { color: var(--hyo-s-texte) !important; }
  .leaflet-control-attribution { background: rgba(15, 19, 23, .8) !important; color: var(--hyo-s-texte2) !important; }
  .leaflet-control-attribution a { color: var(--hyo-s-bleu) !important; }
  .leaflet-bar a { background: var(--hyo-s-surface) !important; color: var(--hyo-s-texte) !important; border-bottom-color: var(--hyo-s-filet) !important; }
  .leaflet-container { background: var(--hyo-s-fond2) !important; }

  /* Ombres plus profondes sur fond sombre */
  .et_pb_image_wrap, .et_pb_blog_grid .et_pb_post, .hyo-carte { box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
}
