/* Accesibilidad Kit Digital — estilos */

/* ---------- Enlace "Saltar al contenido" ---------- */
.kda-skip-link {
	position: absolute !important;
	left: 8px;
	top: -100px;
	z-index: 1000001;
	padding: 10px 16px;
	background: #000 !important;
	color: #fff !important;
	font: 600 16px/1.3 Arial, Helvetica, sans-serif;
	text-decoration: underline !important;
	border-radius: 4px;
}
.kda-skip-link:focus {
	top: 8px;
	outline: 3px solid #ffbf00 !important;
	outline-offset: 2px;
}
#kda-main:focus { outline: none; }

/* ---------- Foco visible (WCAG 2.4.7) ---------- */
html.kda-focus :focus-visible {
	outline: 3px solid #0b57d0 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #fff !important;
}

/* Mientras se mide el contraste, sin transiciones (para leer los colores reales) */
html.kda-measuring *, html.kda-measuring *::before, html.kda-measuring *::after { transition: none !important; }

/* ---------- Enlaces dentro de textos (WCAG 1.4.1) ---------- */
html:not(.kda-measuring) a[data-kda-ul] {
	text-decoration-line: underline !important;
	text-decoration-thickness: from-font;
	text-underline-offset: 2px;
}

/* ---------- Reducir movimiento (WCAG 2.3.3) ---------- */
@media (prefers-reduced-motion: reduce) {
	html.kda-rm *, html.kda-rm *::before, html.kda-rm *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ================================================================== */
/* Modos de la barra                                                   */
/* ================================================================== */

/* Escala de grises / contraste negativo: se aplica al contenido, no a la barra */
html.kda-gray body > *:not(.kda-root):not(#pojo-a11y-toolbar) { filter: grayscale(100%) !important; }
html.kda-neg body { background: #000 !important; }
html.kda-neg body > *:not(.kda-root):not(#pojo-a11y-toolbar) { filter: invert(100%) hue-rotate(180deg) !important; }
html.kda-neg body > *:not(.kda-root) img,
html.kda-neg body > *:not(.kda-root) video,
html.kda-neg body > *:not(.kda-root) picture,
html.kda-neg body > *:not(.kda-root) iframe,
html.kda-neg body > *:not(.kda-root) [style*="background-image"] { filter: invert(100%) hue-rotate(180deg) !important; }
html.kda-gray.kda-neg body > *:not(.kda-root):not(#pojo-a11y-toolbar) { filter: grayscale(100%) invert(100%) hue-rotate(180deg) !important; }

/* Alto contraste: fondo negro, texto blanco, enlaces amarillos */
html.kda-hc body,
html.kda-hc body *:not(.kda-root):not(.kda-root *):not(img):not(video):not(svg):not(path):not(iframe) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.kda-hc body a:not(.kda-root *),
html.kda-hc body a:not(.kda-root *) * { color: #ff0 !important; text-decoration: underline !important; }
html.kda-hc body button:not(.kda-root *), html.kda-hc body input, html.kda-hc body select, html.kda-hc body textarea { border: 2px solid #fff !important; }
html.kda-hc body svg:not(.kda-root *) { fill: currentColor; }

/* Fondo claro: fondo blanco, texto negro */
html.kda-light body,
html.kda-light body *:not(.kda-root):not(.kda-root *):not(img):not(video):not(svg):not(path):not(iframe) {
	background-color: #fff !important;
	background-image: none !important;
	color: #000 !important;
	text-shadow: none !important;
}
html.kda-light body a:not(.kda-root *),
html.kda-light body a:not(.kda-root *) * { color: #0033cc !important; text-decoration: underline !important; }

/* Subrayar todos los enlaces */
html.kda-underline body a:not(.kda-root *) { text-decoration-line: underline !important; }

/* Fuente legible */
html.kda-font body *:not(.kda-root *):not(i):not([class*="icon"]):not([class*="fa-"]):not(.dashicons) {
	font-family: Verdana, Arial, Helvetica, sans-serif !important;
}

/* Espaciado de texto (WCAG 1.4.12) */
html.kda-spacing body *:not(.kda-root *) {
	letter-spacing: .12em !important;
	word-spacing: .16em !important;
	line-height: 1.5 !important;
}
html.kda-spacing body p:not(.kda-root *) { margin-bottom: 2em !important; }

/* Resaltar títulos */
html.kda-titles body :is(h1,h2,h3,h4,h5,h6,[role="heading"]):not(.kda-root *) {
	outline: 3px dashed #c00 !important;
	outline-offset: 4px;
}

/* Cursor grande */
html.kda-cursor, html.kda-cursor body * {
	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 3l30 25-14 1.5 8.5 16-6 3-8.5-16L6 42z' fill='%23000' stroke='%23fff' stroke-width='2.5'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* Detener animaciones */
html.kda-noanim *:not(.kda-root *), html.kda-noanim *::before, html.kda-noanim *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* Guía de lectura */
.kda-guide {
	position: fixed;
	left: 0;
	right: 0;
	height: 12px;
	margin-top: -6px;
	background: rgba(255, 191, 0, .35);
	border-top: 2px solid #000;
	border-bottom: 2px solid #000;
	pointer-events: none;
	z-index: 999998;
	display: none;
}
html.kda-guide-on .kda-guide { display: block; }

/* ================================================================== */
/* Barra de herramientas                                               */
/* ================================================================== */

.kda-root, .kda-root * {
	box-sizing: border-box;
	font-family: Arial, Helvetica, sans-serif !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	text-transform: none;
	filter: none !important;
}
.kda-root {
	position: fixed;
	top: var(--kda-top, 160px);
	left: 0;
	z-index: 999999;
	font-size: 16px !important;
	line-height: 1.3 !important;
}
.kda-root.kda-right { left: auto; right: 0; }
/* Si el panel de Ally está abierto, nuestro botón se aparta para no taparlo */
body:has(#pojo-a11y-toolbar.pojo-a11y-toolbar-open) .kda-root { visibility: hidden; }

.kda-toggle {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0 6px 6px 0;
	background: var(--kda-btn, #1e293b) !important;
	color: #fff !important;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.kda-right .kda-toggle { border-radius: 6px 0 0 6px; }
.kda-toggle svg { width: 30px; height: 30px; fill: #fff; display: block; }
.kda-toggle:hover { filter: brightness(1.25) !important; }
.kda-root :focus-visible {
	outline: 3px solid #ffbf00 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #000 !important;
}

.kda-panel {
	position: absolute;
	top: 0;
	left: 56px;
	width: 320px;
	max-width: calc(100vw - 64px);
	max-height: calc(100vh - var(--kda-top, 160px) - 16px);
	max-height: calc(100dvh - var(--kda-top, 160px) - 16px);
	min-height: 200px;
	overflow-y: auto;
	background: #fff !important;
	color: #1a1a1a !important;
	border: 1px solid #6b7280;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
	padding: 14px;
	text-align: left;
}
.kda-right .kda-panel { left: auto; right: 56px; }
.kda-panel[hidden] { display: none !important; }

.kda-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 12px;
}
.kda-title {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	color: #1a1a1a !important;
	background: none !important;
}
.kda-close {
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: 1px solid #6b7280 !important;
	border-radius: 6px;
	background: #fff !important;
	color: #1a1a1a !important;
	font-size: 22px !important;
	line-height: 1 !important;
	cursor: pointer;
}

.kda-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.kda-opt {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 64px;
	margin: 0;
	padding: 8px 6px;
	border: 2px solid #d1d5db !important;
	border-radius: 8px;
	background: #f3f4f6 !important;
	color: #1a1a1a !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-align: center;
	text-decoration: none !important;
	cursor: pointer;
}
.kda-opt:hover { border-color: #1e293b !important; }
.kda-opt svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.kda-opt[aria-pressed="true"] {
	background: #1e293b !important;
	border-color: #1e293b !important;
	color: #fff !important;
}
.kda-size {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px;
	border: 2px solid #d1d5db;
	border-radius: 8px;
	background: #f3f4f6 !important;
	color: #1a1a1a !important;
}
.kda-size .kda-opt { min-height: 44px; width: 64px; flex: none; font-size: 18px !important; }
.kda-size-label { font-size: 14px !important; font-weight: 600 !important; text-align: center; color: #1a1a1a !important; }

.kda-foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
}
.kda-reset {
	padding: 10px 14px;
	margin: 0;
	border: 0 !important;
	border-radius: 6px;
	background: #b91c1c !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	cursor: pointer;
}
.kda-foot a {
	color: #1d4ed8 !important;
	font-size: 14px !important;
	text-decoration: underline !important;
	background: none !important;
}

@media (max-width: 480px) {
	.kda-toggle { width: 44px; height: 44px; }
	.kda-toggle svg { width: 26px; height: 26px; }
	.kda-panel { left: 48px; width: calc(100vw - 56px); }
	.kda-right .kda-panel { right: 48px; }
}

@media print {
	.kda-root, .kda-guide, .kda-skip-link { display: none !important; }
}
