/* Confort de lecture – styles appliqués à la page (le widget lui-même est isolé dans un Shadow DOM) */

@font-face {
	font-family: "FDCL OpenDyslexic";
	src: url("fonts/opendyslexic-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "FDCL OpenDyslexic";
	src: url("fonts/opendyslexic-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "FDCL Atkinson";
	src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "FDCL Atkinson";
	src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ---------- Interligne (WCAG 1.4.12 : au moins 1,5) ---------- */
html.fdcl-lh-1 body *:not(#fdcl-root) { line-height: 1.5 !important; }
html.fdcl-lh-2 body *:not(#fdcl-root) { line-height: 1.8 !important; }
html.fdcl-lh-3 body *:not(#fdcl-root) { line-height: 2.1 !important; }

/* ---------- Espacement lettres / mots (WCAG 1.4.12 : 0,12em / 0,16em) ---------- */
html.fdcl-ls-1 body *:not(#fdcl-root) { letter-spacing: .12em !important; word-spacing: .16em !important; }
html.fdcl-ls-2 body *:not(#fdcl-root) { letter-spacing: .2em !important; word-spacing: .3em !important; }

/* ---------- Polices (les polices d'icônes sont épargnées) ---------- */
html.fdcl-font-dyslexic body *:not(#fdcl-root):not(i):not([class*="icon"]):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.dashicons):not(.material-icons):not(.material-symbols-outlined) {
	font-family: "FDCL OpenDyslexic", "Comic Sans MS", sans-serif !important;
}
html.fdcl-font-readable body *:not(#fdcl-root):not(i):not([class*="icon"]):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.dashicons):not(.material-icons):not(.material-symbols-outlined) {
	font-family: "FDCL Atkinson", Verdana, Tahoma, sans-serif !important;
}

/* ---------- Gras ---------- */
html.fdcl-bold body *:not(#fdcl-root) { font-weight: 700 !important; }

/* ---------- Alignement à gauche ---------- */
html.fdcl-align body :is(p, li, dd, dt, blockquote, figcaption, td, th, h1, h2, h3, h4, h5, h6, label, .elementor-widget-container) {
	text-align: left !important;
}

/* ---------- Surligner les liens ---------- */
html.fdcl-links body a[href]:not(#fdcl-root) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: .2em !important;
	outline: 2px dashed currentColor !important;
	outline-offset: 2px !important;
}

/* ---------- Surligner les titres ---------- */
html.fdcl-headings body :is(h1, h2, h3, h4, h5, h6, [role="heading"]) {
	outline: 3px solid #f4b400 !important;
	outline-offset: 4px !important;
	border-radius: 2px;
}

/* ---------- Focus clavier renforcé ---------- */
html.fdcl-focus body *:focus,
html.fdcl-focus body *:focus-visible {
	outline: 3px solid #ffd400 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px #111 !important;
}

/* ---------- Contrastes ---------- */
html.fdcl-contrast-dark body,
html.fdcl-contrast-dark body *:not(#fdcl-root) {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.fdcl-contrast-dark body a[href],
html.fdcl-contrast-dark body a[href] * { color: #ffeb3b !important; }
html.fdcl-contrast-dark body :is(button, [role="button"], input, select, textarea),
html.fdcl-contrast-dark body :is(button, [role="button"]) * { color: #fff !important; border: 1px solid #fff !important; }

html.fdcl-contrast-light body,
html.fdcl-contrast-light body *:not(#fdcl-root) {
	background-color: #fff !important;
	color: #000 !important;
	border-color: #000 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.fdcl-contrast-light body a[href],
html.fdcl-contrast-light body a[href] * { color: #0000c8 !important; }
html.fdcl-contrast-light body :is(button, [role="button"], input, select, textarea) { border: 1px solid #000 !important; }

html.fdcl-contrast-mono { filter: grayscale(1); }
html.fdcl-contrast-lowsat { filter: saturate(.45); }

/* ---------- Grand curseur ---------- */
html.fdcl-cursor,
html.fdcl-cursor body *:not(#fdcl-root) {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 3l33 18-14 3.5L18 39z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}
html.fdcl-cursor body :is(a[href], button, [role="button"], label, select, summary),
html.fdcl-cursor body :is(a[href], button, [role="button"]) * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 3l33 18-14 3.5L18 39z' fill='%23ffd400' stroke='%23000' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, pointer !important;
}

/* ---------- Arrêter les animations ---------- */
html.fdcl-noanim *,
html.fdcl-noanim *::before,
html.fdcl-noanim *::after {
	animation-duration: .001ms !important;
	animation-delay: 0s !important;
	animation-iteration-count: 1 !important;
	transition-duration: .001ms !important;
	transition-delay: 0s !important;
	scroll-behavior: auto !important;
}

/* ---------- Masquer les images ---------- */
html.fdcl-noimg body :is(img, picture, video, svg:not([aria-hidden="true"]) image, canvas, [role="img"]):not(#fdcl-root) { visibility: hidden !important; }
html.fdcl-noimg body *:not(#fdcl-root) { background-image: none !important; }

/* ---------- Lecture vocale ---------- */
html.fdcl-tts body :is(p, li, h1, h2, h3, h4, h5, h6, td, th, blockquote, figcaption, dd, dt):hover { cursor: help; }
.fdcl-speaking {
	outline: 3px solid #f4b400 !important;
	outline-offset: 3px !important;
	background-color: rgba(255, 235, 59, .35) !important;
}

/* ---------- Bouton d'ouverture à placer dans le site (shortcode) ---------- */
.fdcl-open-link { cursor: pointer; }

@media print {
	#fdcl-root { display: none !important; }
}
