/*!
 * Feel Accessibility — efectos sobre la página.
 *
 * Todo cuelga de atributos data-feel-acc-* en <html>, que escribe el widget (o el script
 * de arranque antes del primer pintado). Sin atributos, este fichero no cambia nada.
 * El widget vive en un Shadow DOM: estas reglas no lo alcanzan.
 */

/* ---------- Tipografías (solo se descargan si se activan) ---------- */
@font-face {
	font-family: "Feel Atkinson Hyperlegible";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Feel Atkinson Hyperlegible";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Feel Atkinson Hyperlegible";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Feel Atkinson Hyperlegible";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2");
	unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Feel OpenDyslexic";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/opendyslexic-latin-400-normal.woff2") format("woff2");
}
@font-face {
	font-family: "Feel OpenDyslexic";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/opendyslexic-latin-700-normal.woff2") format("woff2");
}

/* ---------- Tamaño del texto ----------
 * El script mide el tamaño original de cada elemento con texto y lo guarda en
 * --feel-acc-fs / --feel-acc-lh; aquí solo se multiplica. Así no se acumula al
 * subir y bajar de nivel y los textos en em/rem no se escalan dos veces. */
html[data-feel-acc-text="1"] { --feel-acc-scale: 1.1; }
html[data-feel-acc-text="2"] { --feel-acc-scale: 1.2; }
html[data-feel-acc-text="3"] { --feel-acc-scale: 1.35; }
html[data-feel-acc-text="4"] { --feel-acc-scale: 1.5; }

html[data-feel-acc-text] [data-feel-acc-t]:not(#feel-acc-a):not(#feel-acc-b) {
	font-size: calc(var(--feel-acc-fs) * var(--feel-acc-scale, 1)) !important;
	line-height: var(--feel-acc-lh) !important;
}
html[data-feel-acc-text] body {
	overflow-wrap: break-word;
}

/* ---------- Espaciado del texto (WCAG 1.4.12 en el nivel 2) ---------- */
html[data-feel-acc-spacing="1"] { --feel-acc-lh-min: 1.5; --feel-acc-ls: 0.03em; --feel-acc-ws: 0.06em; --feel-acc-pm: 1.2em; }
html[data-feel-acc-spacing="2"] { --feel-acc-lh-min: 1.6; --feel-acc-ls: 0.12em; --feel-acc-ws: 0.16em; --feel-acc-pm: 2em; }
html[data-feel-acc-spacing="3"] { --feel-acc-lh-min: 1.8; --feel-acc-ls: 0.18em; --feel-acc-ws: 0.3em; --feel-acc-pm: 2.4em; }

html[data-feel-acc-spacing] body *:not(#feel-acc-a):not(#feel-acc-b) {
	letter-spacing: var(--feel-acc-ls) !important;
	word-spacing: var(--feel-acc-ws) !important;
}

html[data-feel-acc-spacing] body p:not(#feel-acc-a):not(#feel-acc-b) {
	margin-bottom: var(--feel-acc-pm) !important;
}

/* Debe ir después de la regla de tamaño: ambas tienen la misma especificidad. */
html[data-feel-acc-spacing] [data-feel-acc-t]:not(#feel-acc-a):not(#feel-acc-b) {
	line-height: max(var(--feel-acc-lh), var(--feel-acc-lh-min)) !important;
}

/* ---------- Tipografía ---------- */
html[data-feel-acc-font="legible"] body *:not(i, .fa, .fas, .far, .fab, .fal, .fad, [class*="fa-"], [class*="icon-"], [class*="-icon"], .dashicons, .material-icons, .material-symbols-outlined, [class*="glyphicon"], code, pre, kbd, samp):not(#feel-acc-a):not(#feel-acc-b) {
	font-family: "Feel Atkinson Hyperlegible", Verdana, "DejaVu Sans", Arial, sans-serif !important;
}

html[data-feel-acc-font="dyslexia"] body *:not(i, .fa, .fas, .far, .fab, .fal, .fad, [class*="fa-"], [class*="icon-"], [class*="-icon"], .dashicons, .material-icons, .material-symbols-outlined, [class*="glyphicon"], code, pre, kbd, samp):not(#feel-acc-a):not(#feel-acc-b) {
	font-family: "Feel OpenDyslexic", "Comic Sans MS", Verdana, sans-serif !important;
}

/* ---------- Alinear a la izquierda ---------- */
html[data-feel-acc-align] body *:not(#feel-acc-a):not(#feel-acc-b) {
	text-align: start !important;
}

/* ---------- Contraste y color ---------- */
html[data-feel-acc-contrast="mono"] {
	filter: grayscale(1);
}

/* Alto contraste oscuro */
html[data-feel-acc-contrast="dark"]:not(#feel-acc-a):not(#feel-acc-b),
html[data-feel-acc-contrast="dark"] body:not(#feel-acc-a):not(#feel-acc-b) {
	background: #000 !important;
	color: #fff !important;
}

html[data-feel-acc-contrast="dark"] body *:not(#feel-acc-a):not(#feel-acc-b) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

html[data-feel-acc-contrast="dark"] body *:not(#feel-acc-a):not(#feel-acc-b)::before,
html[data-feel-acc-contrast="dark"] body *:not(#feel-acc-a):not(#feel-acc-b)::after {
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
}

html[data-feel-acc-contrast="dark"] body a:not(#feel-acc-a):not(#feel-acc-b),
html[data-feel-acc-contrast="dark"] body a *:not(#feel-acc-a):not(#feel-acc-b) {
	color: #ffe600 !important;
	text-decoration: underline !important;
}

html[data-feel-acc-contrast="dark"] body :is(button, input, select, textarea, [role="button"]):not(#feel-acc-a):not(#feel-acc-b) {
	border: 2px solid #fff !important;
}

html[data-feel-acc-contrast="dark"] :not(#feel-acc-a):not(#feel-acc-b)::placeholder {
	color: #d0d0d0 !important;
}

/* Alto contraste claro */
html[data-feel-acc-contrast="light"]:not(#feel-acc-a):not(#feel-acc-b),
html[data-feel-acc-contrast="light"] body:not(#feel-acc-a):not(#feel-acc-b) {
	background: #fff !important;
	color: #000 !important;
}

html[data-feel-acc-contrast="light"] body *:not(#feel-acc-a):not(#feel-acc-b) {
	background-color: #fff !important;
	background-image: none !important;
	color: #000 !important;
	border-color: #000 !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

html[data-feel-acc-contrast="light"] body *:not(#feel-acc-a):not(#feel-acc-b)::before,
html[data-feel-acc-contrast="light"] body *:not(#feel-acc-a):not(#feel-acc-b)::after {
	background-image: none !important;
	color: #000 !important;
	border-color: #000 !important;
}

html[data-feel-acc-contrast="light"] body a:not(#feel-acc-a):not(#feel-acc-b),
html[data-feel-acc-contrast="light"] body a *:not(#feel-acc-a):not(#feel-acc-b) {
	color: #0000c8 !important;
	text-decoration: underline !important;
}

html[data-feel-acc-contrast="light"] body :is(button, input, select, textarea, [role="button"]):not(#feel-acc-a):not(#feel-acc-b) {
	border: 2px solid #000 !important;
}

html[data-feel-acc-contrast="light"] :not(#feel-acc-a):not(#feel-acc-b)::placeholder {
	color: #404040 !important;
}

/* ---------- Resaltar enlaces ---------- */
html[data-feel-acc-links] body a[href]:not(#feel-acc-a):not(#feel-acc-b) {
	background-color: #fff3a3 !important;
	color: #0b2a6f !important;
	text-decoration: underline !important;
	text-decoration-thickness: 0.12em !important;
	text-underline-offset: 0.18em !important;
	outline: 2px solid #0b2a6f !important;
	outline-offset: 1px !important;
	border-radius: 2px;
}

html[data-feel-acc-links] body a[href] *:not(#feel-acc-a):not(#feel-acc-b) {
	color: inherit !important;
	background-color: transparent !important;
}

/* ---------- Resaltar títulos ---------- */
html[data-feel-acc-headings] body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(#feel-acc-a):not(#feel-acc-b) {
	background-color: #fff3a3 !important;
	color: #14213d !important;
	outline: 3px solid #14213d !important;
	outline-offset: 3px !important;
}

html[data-feel-acc-headings] body :is(h1, h2, h3, h4, h5, h6, [role="heading"]) *:not(#feel-acc-a):not(#feel-acc-b) {
	color: inherit !important;
	background-color: transparent !important;
}

/* ---------- Foco de teclado muy visible (visible sobre cualquier fondo) ---------- */
html[data-feel-acc-focus] body :focus-visible:not(#feel-acc-a):not(#feel-acc-b) {
	outline: 4px solid #0b57d0 !important;
	outline-offset: 3px !important;
	box-shadow: 0 0 0 3px #fff, 0 0 0 11px #fff !important;
}

/* ---------- Ocultar imágenes ---------- */
html[data-feel-acc-images] body :is(img, picture, video, canvas):not(#feel-acc-a):not(#feel-acc-b) {
	visibility: hidden !important;
}

html[data-feel-acc-images] body *:not(#feel-acc-a):not(#feel-acc-b) {
	background-image: none !important;
}

/* Contenedores con imagen y texto: fondo liso que garantiza el contraste (lo calcula widget.js).
 * En los modos de alto contraste ya hay fondo sólido:not(#feel-acc-a):not(#feel-acc-b),
así que no se aplica. */
html[data-feel-acc-images]:not([data-feel-acc-contrast="dark"], [data-feel-acc-contrast="light"]) [data-feel-acc-bgi]:not(#feel-acc-a):not(#feel-acc-b) {
	background-color: var(--feel-acc-bgfix) !important;
}

/* ---------- Pausar animaciones ---------- */
html[data-feel-acc-motion] *:not(#feel-acc-a):not(#feel-acc-b),
html[data-feel-acc-motion] *:not(#feel-acc-a):not(#feel-acc-b)::before,
html[data-feel-acc-motion] *:not(#feel-acc-a):not(#feel-acc-b)::after {
	animation-duration: 0.001ms !important;
	animation-delay: 0s !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	transition-delay: 0s !important;
	scroll-behavior: auto !important;
}

/* ---------- Cursor grande ---------- */
html[data-feel-acc-cursor]:not(#feel-acc-a):not(#feel-acc-b),
html[data-feel-acc-cursor] body *:not(#feel-acc-a):not(#feel-acc-b) {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 3v32l8-7 6 13 7-3-6-13h11z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

html[data-feel-acc-cursor] body :is(a[href], button, [role="button"], input[type="submit"], input[type="button"], summary, label, select):not(#feel-acc-a):not(#feel-acc-b) {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 3v32l8-7 6 13 7-3-6-13h11z' fill='%23ffd400' stroke='%23000' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, pointer !important;
}
