/*
 * Correctifs de thème, chargés sur toutes les pages (2026-10-16).
 *
 * Messages illisibles d'un thème à l'autre.
 * Quand on écrit dans un éditeur (Trumbowyg, TinyMCE) en mode sombre, Chrome et surtout
 * Safari sur Mac recopient la couleur calculée dans le texte : en effaçant une ligne, en
 * collant, en mettant en gras, ils ajoutent <span style="color: rgb(240, 244, 248)">.
 * Le message garde ce blanc pour toujours, et un lecteur en thème clair voit du blanc sur
 * blanc. L'inverse arrive aussi (gris foncé du thème clair lu en thème sombre).
 * On neutralise uniquement les couleurs EXACTES des deux thèmes : une couleur choisie
 * volontairement dans l'éditeur (rouge, vert...) reste affichée. Le blanc et le noir purs
 * ne sont pas touchés : trop de pages les utilisent exprès.
 */

/* Couleurs du thème sombre lues en thème clair : on reprend la couleur normale du texte */
html:not(.dark-mode) [style*="color: rgb(240, 244, 248)"],
html:not(.dark-mode) [style*="color:rgb(240, 244, 248)"],
html:not(.dark-mode) [style*="color: #f0f4f8"],
html:not(.dark-mode) [style*="color:#f0f4f8"],
html:not(.dark-mode) [style*="color: rgb(148, 163, 184)"],
html:not(.dark-mode) [style*="color: #94a3b8"],
html:not(.dark-mode) [style*="color: rgb(96, 165, 250)"] {
	color: inherit !important;
}

/* Fonds du thème sombre recopiés dans un message lu en thème clair */
html:not(.dark-mode) [style*="background-color: rgb(13, 18, 33)"],
html:not(.dark-mode) [style*="background-color: rgb(21, 29, 51)"],
html:not(.dark-mode) [style*="background-color: rgb(30, 42, 74)"],
html:not(.dark-mode) [style*="background-color: rgb(38, 54, 92)"] {
	background-color: transparent !important;
}

/* Couleurs du thème clair lues en thème sombre */
html.dark-mode [style*="color: rgb(66, 70, 86)"],
html.dark-mode [style*="color: #424656"],
html.dark-mode [style*="color: rgb(51, 51, 51)"],
html.dark-mode [style*="color: rgb(102, 102, 102)"] {
	color: inherit !important;
}
html.dark-mode [style*="background-color: rgb(255, 255, 255)"],
html.dark-mode [style*="background-color: #ffffff"],
html.dark-mode [style*="background-color: rgb(245, 249, 255)"] {
	background-color: transparent !important;
}

/* Couleurs du thème Halloween recopiées dans un message, lu ensuite hors Halloween */
html:not(.tm-halloween) [style*="color: rgb(243, 238, 252)"],
html:not(.tm-halloween) [style*="color: rgb(185, 167, 214)"],
html:not(.tm-halloween) [style*="color: rgb(255, 154, 60)"] {
	color: inherit !important;
}
html:not(.tm-halloween) [style*="background-color: rgb(18, 11, 28)"],
html:not(.tm-halloween) [style*="background-color: rgb(29, 18, 41)"],
html:not(.tm-halloween) [style*="background-color: rgb(42, 26, 61)"] {
	background-color: transparent !important;
}

/* Étiquettes d'état sur fond clair (tableau des véhicules, CT, alertes) (2026-10-16).
   Le texte blanc sur le vert « En service » ou l'orange « attention » était presque
   illisible (contraste de 2 pour 1). Texte foncé, dans tous les thèmes. Le thème sombre
   forçait le blanc sur toutes les étiquettes : d'où html.dark-mode dans les sélecteurs. */
.uk-label.tm-service,
.uk-label.uk-label-success,
html.dark-mode .uk-label.tm-service,
html.dark-mode .uk-label.uk-label-success {
	color: #06281b !important;
}
.uk-label.uk-label-warning,
html.dark-mode .uk-label.uk-label-warning {
	color: #3a1d00 !important;
}
