/*
 * Iris — widget d'accessibilité visiteur.
 *
 * Feuille du document : polices, bouclier de l'hôte #iris-root et effets visiteurs. L'interface vit dans la
 * racine fantôme de #iris-root et a sa propre feuille (iris-ui.css), hors de portée du CSS du thème.
 * Les effets sont posés sur <html> (html.iris-*) et ciblent « body > *:not(#iris-root) » : le bouton et le
 * panneau ne subissent jamais leurs propres filtres.
 * Pile de z-index : bouton Iris 999997, badge Hermès 999998, panneau Iris 1000000.
 * Contrat : docs/superpowers/specs/2026-11-26-iris-lot1-contrat.md.
 */

/* Police dyslexie : le fichier est embarqué dans front/fonts/ ; pile de repli en son absence. */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('fonts/OpenDyslexic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Police de l'interface (Inter Tight, OFL, sous-ensemble latin) : téléchargée seulement quand le panneau s'affiche. */
@font-face {
  font-family: 'Inter Tight Iris';
  src: url('fonts/InterTight-Iris.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Hôte de la racine fantôme : rien n'hérite du thème (police, couleur, interlignage, curseur…), même
   un « div { … !important } », « body * { … !important } » ou « div:empty { display: none } ».
   .iris-host est posé par le JS une fois la racine fantôme attachée. */
#iris-root.iris-host {
  all: initial !important;
  display: block !important;
  position: static !important;
}

/* ===================================================================
   Effets sur la page (html.iris-*), hors #iris-root
   =================================================================== */

/* Contenu : taille du texte (zoom ; repli sur la taille de l'élément racine) */
html.iris-font-size body > *:not(#iris-root) { zoom: var(--iris-font-scale, 1); }
@supports not (zoom: 1) {
  html.iris-font-size { font-size: calc(100% * var(--iris-font-scale, 1)); }
}

/* Hauteur de ligne */
html[data-iris-line-height="1"] body > *:not(#iris-root),
html[data-iris-line-height="1"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { line-height: 1.6 !important; }
html[data-iris-line-height="2"] body > *:not(#iris-root),
html[data-iris-line-height="2"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { line-height: 1.9 !important; }
html[data-iris-line-height="3"] body > *:not(#iris-root),
html[data-iris-line-height="3"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { line-height: 2.3 !important; }

/* Espacement des lettres (effet visiteur : autorisé) */
html.iris-letter-spacing body > *:not(#iris-root),
html.iris-letter-spacing body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { letter-spacing: .12em !important; word-spacing: .16em !important; }

/* Polices */
html.iris-readable-font body > *:not(#iris-root),
html.iris-readable-font body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { font-family: Verdana, Tahoma, 'Segoe UI', Arial, sans-serif !important; }
html.iris-dyslexia-font body > *:not(#iris-root),
html.iris-dyslexia-font body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { font-family: 'OpenDyslexic', 'Lexend', 'Comic Sans MS', sans-serif !important; }
html.iris-font-weight body > *:not(#iris-root),
html.iris-font-weight body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { font-weight: 700 !important; }

/* Alignement */
html[data-iris-text-align="left"] body > *:not(#iris-root),
html[data-iris-text-align="left"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: left !important; }
html[data-iris-text-align="center"] body > *:not(#iris-root),
html[data-iris-text-align="center"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: center !important; }
html[data-iris-text-align="right"] body > *:not(#iris-root),
html[data-iris-text-align="right"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: right !important; }
html[data-iris-text-align="justify"] body > *:not(#iris-root),
html[data-iris-text-align="justify"] body > *:not(#iris-root) *:not(svg):not(svg *):not(i):not([class*="fa-"]):not(.dashicons):not(.material-icons) { text-align: justify !important; }

/* Liens. Le soulignement vaut dans tous les cas. L'aplat jaune et le texte noir, seulement hors contraste :
   un contraste a déjà sa couleur de lien, et un aplat jaune sous un lien cyan serait illisible.
   Un lien qui contient une image ou une vidéo (logo blanc, carte à vignette) ne reçoit pas l'aplat, pas plus que
   l'élément qui enveloppe l'image : un logo blanc resterait blanc sur jaune. Ses éléments de texte, eux, le reçoivent. */
html.iris-highlight-links body > *:not(#iris-root) a,
html.iris-highlight-links body > *:not(#iris-root) a * {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
}
html.iris-highlight-links:not([class*="iris-contrast-"]) body > *:not(#iris-root) a:not([data-iris-link-overlay]):not(:has(img, picture, video, canvas, iframe, embed, object)),
html.iris-highlight-links:not([class*="iris-contrast-"]) body > *:not(#iris-root) a:not([data-iris-link-overlay]) *:not([data-iris-link-overlay]):not([data-iris-link-overlay] *):not(img):not(picture):not(video):not(canvas):not(svg):not(svg *):not(iframe):not(embed):not(object):not(:has(img, picture, video, canvas, iframe, embed, object)) {
  background-color: #ffeb3b !important;
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
/* Calque sur une vignette (marqué par le JS) : jamais d'aplat qui masquerait l'image ; un lien en calque a un contour. */
html.iris-highlight-links body > *:not(#iris-root) a[data-iris-link-overlay] {
  outline: 3px solid #ffeb3b !important;
  outline-offset: -3px !important;
}

/* Grand curseur */
html.iris-big-cursor body > *:not(#iris-root),
html.iris-big-cursor body > *:not(#iris-root) * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'><path d='M5 3l14 8-6 2 4 7-3 1.5-4-7-5 4z' fill='black' stroke='white' stroke-width='1.4' stroke-linejoin='round'/></svg>") 4 2, auto !important;
}

/* Couleurs : contrastes (exclusifs entre eux côté JS).
   Le texte et les bordures prennent les couleurs du contraste partout ; les fonds, seulement là où il y en a un :
   le JS classe chaque élément d'après son style d'origine (data-iris-bg) puis pose html.iris-bg-ready.
   solid = fond opaque ou image derrière du texte → couleur du contraste ; soft = voile ou calque décoratif →
   transparent ; sans attribut = transparent d'origine, inchangé. Un <canvas> fixe, un calque en dégradé ou un
   fond semi-transparent ne deviennent donc jamais des plaques opaques. Les médias ne reçoivent aucun fond.
   Avant le classement (premier rendu, préférence stockée) : repli opaque, médias exclus. */
html.iris-contrast-dark,
html.iris-contrast-dark body { background: #121212 !important; color: #f2f2f2 !important; }
html.iris-contrast-dark body > *:not(#iris-root),
html.iris-contrast-dark body > *:not(#iris-root) * {
  color: #f2f2f2 !important;
  -webkit-text-fill-color: currentColor !important;
  border-color: #7a7a7a !important;
  text-shadow: none !important;
}
html.iris-contrast-dark:not(.iris-bg-ready) body > *:not(#iris-root):not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-dark:not(.iris-bg-ready) body > *:not(#iris-root) *:not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-dark body > *:not(#iris-root)[data-iris-bg="solid"],
html.iris-contrast-dark body > *:not(#iris-root) [data-iris-bg="solid"] {
  background-color: #121212 !important;
  background-image: none !important;
}
html.iris-contrast-dark body > *:not(#iris-root) a,
html.iris-contrast-dark body > *:not(#iris-root) a * { color: #8ab4f8 !important; }

html.iris-contrast-light,
html.iris-contrast-light body { background: #fff !important; color: #000 !important; }
html.iris-contrast-light body > *:not(#iris-root),
html.iris-contrast-light body > *:not(#iris-root) * {
  color: #000 !important;
  -webkit-text-fill-color: currentColor !important;
  border-color: #000 !important;
  text-shadow: none !important;
}
html.iris-contrast-light:not(.iris-bg-ready) body > *:not(#iris-root):not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-light:not(.iris-bg-ready) body > *:not(#iris-root) *:not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-light body > *:not(#iris-root)[data-iris-bg="solid"],
html.iris-contrast-light body > *:not(#iris-root) [data-iris-bg="solid"] {
  background-color: #fff !important;
  background-image: none !important;
}
html.iris-contrast-light body > *:not(#iris-root) a,
html.iris-contrast-light body > *:not(#iris-root) a * { color: #0000c8 !important; }

html.iris-contrast-high,
html.iris-contrast-high body { background: #000 !important; color: #ff0 !important; }
html.iris-contrast-high body > *:not(#iris-root),
html.iris-contrast-high body > *:not(#iris-root) * {
  color: #ff0 !important;
  -webkit-text-fill-color: currentColor !important;
  border-color: #ff0 !important;
  text-shadow: none !important;
}
html.iris-contrast-high:not(.iris-bg-ready) body > *:not(#iris-root):not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-high:not(.iris-bg-ready) body > *:not(#iris-root) *:not(img):not(picture):not(video):not(canvas):not(svg):not(iframe):not(embed):not(object),
html.iris-contrast-high body > *:not(#iris-root)[data-iris-bg="solid"],
html.iris-contrast-high body > *:not(#iris-root) [data-iris-bg="solid"] {
  background-color: #000 !important;
  background-image: none !important;
}
html.iris-contrast-high body > *:not(#iris-root) a,
html.iris-contrast-high body > *:not(#iris-root) a * { color: #0ff !important; }

html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root)[data-iris-bg="soft"],
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root) [data-iris-bg="soft"] {
  background-color: transparent !important;
  background-image: none !important;
}
/* Fond d'état (survol, focus, bouton pressé) d'un élément transparent au repos : jamais classé, il garderait son
   fond clair d'origine sous un texte forcé clair. Il reste transparent. */
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root) :not([data-iris-bg]):is(:hover, :focus, :focus-visible, :active),
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root):not([data-iris-bg]):is(:hover, :focus, :focus-visible, :active) {
  background-color: transparent !important;
  background-image: none !important;
}
/* Image décorative en calque derrière un texte (halo, forme floutée) : classée « decor » par le JS, effacée. Elle
   garderait sinon ses couleurs sous un texte forcé clair. visibility et non display : la mise en page ne bouge pas. */
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root):is([data-iris-bg="decor"], [data-iris-bg="decor"] *),
html.iris-bg-ready[class*="iris-contrast-"] body > *:not(#iris-root) :is([data-iris-bg="decor"], [data-iris-bg="decor"] *) {
  visibility: hidden !important;
  transition: none !important;
}
/* Lecture des fonds d'origine (JS) : aucune transition ne doit fausser la valeur lue. */
html.iris-bg-probe body *,
html.iris-bg-probe body *::before,
html.iris-bg-probe body *::after { transition: none !important; }

/* Monochrome et saturation partagent une seule propriété filter */
html.iris-monochrome { --iris-gray: 1; }
html[data-iris-saturation="low"] { --iris-sat: .45; }
html[data-iris-saturation="high"] { --iris-sat: 2; }
/* Surcouche fixe sous le bouton (999997) et le panneau (1000000) : aucun filter sur le contenu,
   donc les position:fixed du thème restent intacts et le widget n'est pas filtré.
   Pseudo-élément de <html> : il existe dès que le mini-script de tête a posé la classe,
   avant le JS différé, donc aucun flash en couleur. */
html.iris-monochrome::after,
html[data-iris-saturation]::after {
  content: "";
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
  z-index: 999996;
  -webkit-backdrop-filter: grayscale(var(--iris-gray, 0)) saturate(var(--iris-sat, 1));
  backdrop-filter: grayscale(var(--iris-gray, 0)) saturate(var(--iris-sat, 1));
}

/* Orientation */
html.iris-keyboard-nav body > *:not(#iris-root):focus,
html.iris-keyboard-nav body > *:not(#iris-root) *:focus {
  outline: 4px solid #ff6a00 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #fff !important;
}

html.iris-hide-images img,
html.iris-hide-images picture,
html.iris-hide-images video,
html.iris-hide-images canvas,
html.iris-hide-images [role="img"] { opacity: 0 !important; }
html.iris-hide-images body > *:not(#iris-root),
html.iris-hide-images body > *:not(#iris-root) * { background-image: none !important; }

/* Titres. Hors contraste : aplat jaune pâle, texte noir jusque dans les éléments du titre (un span blanc d'origine
   resterait blanc sur jaune). Sous un contraste : aucun aplat (il perdrait contre le fond du contraste et laisserait
   un texte noir sur noir), contour de la couleur du texte du contraste. */
html.iris-highlight-titles body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) {
  outline: 3px solid #6200ea !important;
  outline-offset: 3px !important;
}
html.iris-highlight-titles:not([class*="iris-contrast-"]) body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) {
  background-color: #fff59d !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
}
html.iris-highlight-titles:not([class*="iris-contrast-"]) body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6),
html.iris-highlight-titles:not([class*="iris-contrast-"]) body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) *:not(svg *) {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}
html.iris-highlight-titles.iris-contrast-dark body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) { outline-color: #f2f2f2 !important; }
html.iris-highlight-titles.iris-contrast-light body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) { outline-color: #000 !important; }
html.iris-highlight-titles.iris-contrast-high body > *:not(#iris-root) :is(h1, h2, h3, h4, h5, h6) { outline-color: #ff0 !important; }

html.iris-highlight-content main,
html.iris-highlight-content [role="main"],
html.iris-highlight-content article,
html.iris-highlight-content .entry-content {
  outline: 3px solid #6200ea !important;
  outline-offset: 6px !important;
  background-color: rgba(255, 245, 157, .35) !important;
}

html.iris-stop-animations { scroll-behavior: auto !important; }
html.iris-stop-animations body > *:not(#iris-root),
html.iris-stop-animations body > *:not(#iris-root) *,
html.iris-stop-animations body > *:not(#iris-root)::before,
html.iris-stop-animations body > *:not(#iris-root)::after,
html.iris-stop-animations body > *:not(#iris-root) *::before,
html.iris-stop-animations body > *:not(#iris-root) *::after {
  animation-duration: .001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
html.iris-stop-animations body > *:not(#iris-root) [class*="marquee"],
html.iris-stop-animations body > *:not(#iris-root) [class*="ticker"],
html.iris-stop-animations body > *:not(#iris-root) [class*="carousel"],
html.iris-stop-animations body > *:not(#iris-root) [class*="slider"] { animation-play-state: paused !important; }

/* Lecture vocale : bloc en cours de lecture */
.iris-speaking { outline: 3px solid #f5a300 !important; outline-offset: 2px !important; }
