/* Nueva Sierra – Accesibilidad v1.0.0 */

/* ---------- Preferencias aplicadas al sitio (nunca al propio widget) ---------- */

html.ns-a11y-contrast body,
html.ns-a11y-contrast body *:not(.ns-a11y-root):not(.ns-a11y-root *) {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #6b6b6b !important;
	box-shadow: none !important;
	text-shadow: none !important;
}
html.ns-a11y-contrast body a:not(.ns-a11y-root):not(.ns-a11y-root *),
html.ns-a11y-contrast body a:not(.ns-a11y-root):not(.ns-a11y-root *) *:not(.ns-a11y-root) {
	color: #ffe14d !important;
}
html.ns-a11y-contrast body img:not(.ns-a11y-root *) {
	filter: none !important;
	opacity: 1 !important;
}

html.ns-a11y-links body a:not(.ns-a11y-root *) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
}

html.ns-a11y-font body :is(p, li, h1, h2, h3, h4, h5, h6, a, span, div, label, button, input, textarea, select, blockquote, figcaption, time, td, th, strong, em, b, small):not([class*="icon"]):not(.ns-a11y-root *) {
	font-family: "Atkinson Hyperlegible", Verdana, Tahoma, sans-serif !important;
	letter-spacing: 0.015em !important;
	word-spacing: 0.06em !important;
}

/* ---------- Widget ---------- */

.ns-a11y-root {
	--ns-red: #c8141c;
	--ns-red-dark: #9e0f15;
	--ns-ink: #1d1d1b;
	--ns-muted: #5a5a58;
	--ns-line: #e6e3df;
	--ns-soft: #f6f4f1;
	font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: var(--ns-ink);
}
.ns-a11y-root *,
.ns-a11y-root *::before,
.ns-a11y-root *::after {
	box-sizing: border-box;
}
.ns-a11y-root button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	font: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}
.ns-a11y-root button:focus-visible {
	outline: 3px solid #1a5fd6;
	outline-offset: 2px;
}

.ns-a11y-root .ns-a11y-fab {
	position: fixed;
	left: max(18px, env(safe-area-inset-left, 0px));
	bottom: max(18px, env(safe-area-inset-bottom, 0px));
	z-index: 99990;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--ns-red);
	color: #fff;
	display: flex !important;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.ns-a11y-root .ns-a11y-fab:hover { background: var(--ns-red-dark); }
.ns-a11y-root .ns-a11y-fab[aria-expanded="true"] { background: var(--ns-ink); }
.ns-a11y-root .ns-a11y-fab svg { width: 28px; height: 28px; fill: currentColor; }

.ns-a11y-panel {
	position: fixed;
	left: max(18px, env(safe-area-inset-left, 0px));
	bottom: calc(max(18px, env(safe-area-inset-bottom, 0px)) + 64px);
	z-index: 99991;
	width: 312px;
	max-width: calc(100vw - 36px);
	max-height: calc(100vh - 110px);
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--ns-line);
	border-top: 4px solid var(--ns-red);
	border-radius: 10px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
	padding: 16px 16px 14px;
}
.ns-a11y-panel[hidden] { display: none !important; }

.ns-a11y-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.ns-a11y-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	color: var(--ns-ink);
}
.ns-a11y-root .ns-a11y-close {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex !important;
	align-items: center;
	justify-content: center;
	color: var(--ns-muted) !important;
}
.ns-a11y-root .ns-a11y-close:hover { background: var(--ns-soft); color: var(--ns-ink) !important; }
.ns-a11y-root .ns-a11y-close svg { width: 18px; height: 18px; stroke: currentColor; }

.ns-a11y-size {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 0;
	border-top: 1px solid var(--ns-line);
}
.ns-a11y-label { font-weight: 600; }
.ns-a11y-root .ns-a11y-stepper {
	display: flex;
	align-items: center;
	border: 1px solid var(--ns-line);
	border-radius: 8px;
	overflow: hidden;
}
.ns-a11y-root .ns-a11y-stepper button {
	width: 42px;
	height: 38px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	background: var(--ns-soft);
}
.ns-a11y-root .ns-a11y-stepper button:hover:not([disabled]) { background: #ece8e3; }
.ns-a11y-root .ns-a11y-stepper button[disabled] { opacity: 0.35; cursor: default; }
.ns-a11y-root .ns-a11y-stepper output {
	min-width: 56px;
	text-align: center;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.ns-a11y-root .ns-a11y-toggle {
	width: 100%;
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 0;
	border-top: 1px solid var(--ns-line);
}
.ns-a11y-root .ns-a11y-toggle-text { display: flex; flex-direction: column; }
.ns-a11y-root .ns-a11y-toggle-text strong { font-weight: 600; }
.ns-a11y-root .ns-a11y-toggle-text small { font-size: 13px; color: var(--ns-muted); margin-top: 1px; }
.ns-a11y-root .ns-a11y-switch {
	flex: 0 0 auto;
	position: relative;
	width: 42px;
	height: 24px;
	border-radius: 12px;
	background: #c9c5c0;
	transition: background-color 0.15s ease;
}
.ns-a11y-root .ns-a11y-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
.ns-a11y-root .ns-a11y-toggle[aria-pressed="true"] .ns-a11y-switch { background: var(--ns-red); }
.ns-a11y-root .ns-a11y-toggle[aria-pressed="true"] .ns-a11y-switch::after { transform: translateX(18px); }

.ns-a11y-root .ns-a11y-reset {
	display: block !important;
	width: 100%;
	margin-top: 6px;
	padding: 10px 12px;
	border-radius: 8px;
	text-align: center;
	font-weight: 600;
	color: var(--ns-red-dark) !important;
	border: 1px solid var(--ns-line);
}
.ns-a11y-root .ns-a11y-reset:hover { background: var(--ns-soft); }

/* ---------- Lector de voz ---------- */

.ns-reader {
	--ns-red: #c8141c;
	--ns-red-dark: #9e0f15;
	--ns-ink: #1d1d1b;
	--ns-muted: #5a5a58;
	--ns-line: #e6e3df;
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 24px;
	padding: 12px 14px;
	border: 1px solid var(--ns-line);
	border-left: 4px solid var(--ns-red);
	border-radius: 8px;
	background: #fff;
	font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
	color: var(--ns-ink);
	line-height: 1.35;
}
.ns-reader button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.ns-reader button:focus-visible { outline: 3px solid #1a5fd6; outline-offset: 2px; }
.ns-reader .ns-reader-play {
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--ns-red);
	color: #fff;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease;
}
.ns-reader .ns-reader-play:hover { background: var(--ns-red-dark); }
.ns-reader .ns-reader-play svg { width: 20px; height: 20px; fill: currentColor; }
.ns-reader-info { flex: 1 1 auto; min-width: 0; }
.ns-reader-title { display: block; font-size: 15px; font-weight: 700; }
.ns-reader-meta { display: block; font-size: 13px; color: var(--ns-muted); margin-top: 1px; }
.ns-reader-bar {
	height: 4px;
	margin-top: 8px;
	border-radius: 2px;
	background: var(--ns-line);
	overflow: hidden;
}
.ns-reader-bar span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--ns-red);
	transition: width 0.3s ease;
}
.ns-reader .ns-reader-ctrl {
	flex: 0 0 auto;
	min-width: 40px;
	height: 36px;
	padding: 0 10px !important;
	border-radius: 18px;
	border: 1px solid var(--ns-line);
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--ns-ink);
	font-variant-numeric: tabular-nums;
}
.ns-reader .ns-reader-ctrl:hover { background: #f6f4f1; }
.ns-reader .ns-reader-ctrl svg { width: 14px; height: 14px; fill: currentColor; }
.ns-reader .ns-reader-ctrl[hidden] { display: none !important; }

@media (max-width: 480px) {
	.ns-reader { gap: 10px; padding: 10px 12px; }
	.ns-reader .ns-reader-ctrl { min-width: 36px; padding: 0 8px !important; }
}

@media (prefers-reduced-motion: reduce) {
	.ns-a11y-root *, .ns-reader * { transition: none !important; }
}

html.ns-a11y-contrast .ns-reader-play,
html.ns-a11y-contrast .ns-reader-ctrl { border: 2px solid #fff !important; }
html.ns-a11y-contrast .ns-reader-bar span { background-color: #ffe14d !important; }
