/* art-felx.com — Mode sombre autonome et compatible avec le portail
   Charger APRES les CSS existants. Ne change RIEN en mode clair.
   Active quand <html> porte dark-mode (portail existant)
   ou af-contraste-sombre (solution autonome hors ligne).
   Ne modifie pas le menu, les icônes SVG, les images ni les vidéos. */

html:is(.dark-mode, .af-contraste-sombre) {
  color-scheme: dark;
  background-color: #121212 !important;
}

html:is(.dark-mode, .af-contraste-sombre) body,
html:is(.dark-mode, .af-contraste-sombre) main,
html:is(.dark-mode, .af-contraste-sombre) main section,
html:is(.dark-mode, .af-contraste-sombre) main .section-inner,
html:is(.dark-mode, .af-contraste-sombre) main .centered-content,
html:is(.dark-mode, .af-contraste-sombre) .partage-reseaux {
  background-color: #121212 !important;
  color: #f0f0f0 !important;
}

/* Titres, légendes et textes souvent dotés d'une couleur imposée. */
html:is(.dark-mode, .af-contraste-sombre) :is(
  .titre-principal, .titre-genre, .image-description,
  .avis-traduction, .partage-reseaux h2
),
html:is(.dark-mode, .af-contraste-sombre) main .titre-noir5,
html:is(.dark-mode, .af-contraste-sombre) main :is(
  p, p span, h1, h2, h3, h4, blockquote, figcaption
),
html:is(.dark-mode, .af-contraste-sombre) .site-complet a,
html:is(.dark-mode, .af-contraste-sombre) .site-complet a:visited {
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
}

/* Les liens du texte conservent un repère visuel accessible. */
html:is(.dark-mode, .af-contraste-sombre) main a:not(.site-complet a) {
  color: #b8d9ff;
}

/* Le lecteur vidéo reste noir, sans altérer les œuvres graphiques. */
html:is(.dark-mode, .af-contraste-sombre) #video-player {
  background-color: #000 !important;
}

/* Petit contrôle local facultatif : seulement sur page ouverte seule.
   Dans le portail, aucun bouton supplémentaire n'est ajouté. */
.af-mode-controls {
  text-align: center;
  padding: .35rem .8rem .15rem;
  background: transparent !important;
}
.af-mode-controls .af-mode-toggle {
  font: inherit;
  font-size: .875rem;
  border: 1px solid #777;
  border-radius: .45rem;
  padding: .35rem .65rem;
  cursor: pointer;
  background-color: #fafafa;
  color: #161616;
}
.af-mode-controls .af-mode-toggle:focus-visible {
  outline: 3px solid #4c9dff;
  outline-offset: 2px;
}
html:is(.dark-mode, .af-contraste-sombre) .af-mode-controls .af-mode-toggle {
  background-color: #202124;
  color: #fff;
  border-color: #aaa;
}


/* POSITION COMMUNE JOUR–NUIT — sous le titre ou le sous-titre.
   Le déplacement réel est assuré par mode-sombre-local.js : le CSS
   règle uniquement l'alignement et l'espacement du bouton.
   Aucune incidence sur les boutons Jour/Nuit du portail index.html. */
.af-mode-controls {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap;
  clear: both;
  float: none !important;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: .6rem auto 1.4rem !important;
  padding: .25rem .75rem !important;
  text-align: center !important;
  background: transparent !important;
}
.af-mode-controls > .af-mode-toggle {
  position: static !important;
  float: none !important;
  max-width: 100%;
  margin: 0 auto !important;
  white-space: normal;
  line-height: 1.35;
  touch-action: manipulation;
}
