/**
 * SVETMI Access — page-level effect styles.
 * Applied via html/body classes.
 * Excluded from all page-level effects: #uax-widget, #wpadminbar and their descendants.
 */

/* ── Text size (html % — widget uses px) ───────────────────── */

html.uax-text-size-110 {
	font-size: 110%;
}

html.uax-text-size-120 {
	font-size: 120%;
}

html.uax-text-size-130 {
	font-size: 130%;
}

html.uax-text-size-140 {
	font-size: 140%;
}

#uax-widget {
	font-size: 16px !important;
}

/* ── Readable font ─────────────────────────────────────────── */

html.uax-readable-font body :where(
	p, li, a, span, div, h1, h2, h3, h4, h5, h6,
	td, th, label, input, textarea, select, button
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	font-family: Arial, Helvetica, "Segoe UI", Tahoma, sans-serif !important;
}

/* ── Line height ───────────────────────────────────────────── */

html.uax-line-height-16 body :where(
	p, li, span, div, h1, h2, h3, h4, h5, h6, td, th, label, a
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	line-height: 1.6 !important;
}

html.uax-line-height-18 body :where(
	p, li, span, div, h1, h2, h3, h4, h5, h6, td, th, label, a
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	line-height: 1.8 !important;
}

html.uax-line-height-20 body :where(
	p, li, span, div, h1, h2, h3, h4, h5, h6, td, th, label, a
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	line-height: 2 !important;
}

/* ── Letter spacing ────────────────────────────────────────── */

html.uax-letter-spacing-05 body :where(
	p, li, span, div, h1, h2, h3, h4, h5, h6, td, th, label, a
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	letter-spacing: 0.05em !important;
}

html.uax-letter-spacing-10 body :where(
	p, li, span, div, h1, h2, h3, h4, h5, h6, td, th, label, a
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	letter-spacing: 0.1em !important;
}

html.uax-letter-spacing-15 body :where(
	p, li, span, div, h1, h2, h3, h4, h5, h6, td, th, label, a
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	letter-spacing: 0.15em !important;
}

/* ── Highlight links ───────────────────────────────────────── */

html.uax-highlight-links body a[href]:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
}

/* ── Highlight headings ────────────────────────────────────── */

html.uax-highlight-headings body :where(h1, h2, h3, h4, h5, h6):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	background-color: rgba(26, 43, 109, 0.08) !important;
	border-right: 4px solid #1a2b6d !important;
	padding: 0.2em 0.5em !important;
}

/* ── Grayscale (overlay — preserves widget colors) ─────────── */

html.uax-grayscale::after {
	content: "";
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99990;
	pointer-events: none;
	backdrop-filter: grayscale(100%);
	-webkit-backdrop-filter: grayscale(100%);
}

/* ── Contrast modes ────────────────────────────────────────── */

html.uax-contrast-high body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	background-color: #000000 !important;
	color: #ffffff !important;
	border-color: #ffffff !important;
}

html.uax-contrast-high body a[href]:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: #ffff00 !important;
}

html.uax-contrast-high body :where(button, input, select, textarea):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	background-color: #000000 !important;
	color: #ffffff !important;
	border: 2px solid #ffffff !important;
}

html.uax-contrast-dark body {
	background-color: #121212 !important;
	color: #f1f1f1 !important;
}

html.uax-contrast-dark body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	background-color: inherit;
	color: inherit;
	border-color: #555555 !important;
}

html.uax-contrast-dark body a[href]:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: #8ec8ff !important;
}

html.uax-contrast-light body {
	background-color: #ffffff !important;
	color: #000000 !important;
}

html.uax-contrast-light body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: #000000 !important;
	border-color: #000000 !important;
}

html.uax-contrast-light body a[href]:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: #0000cc !important;
	text-decoration: underline !important;
}

/* ── Large cursor ──────────────────────────────────────────── */

html.uax-large-cursor,
html.uax-large-cursor body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.5' d='M4 2l22 14-9 1 4 12-4 2-3-12-10 1z'/%3E%3C/svg%3E") 2 2, auto !important;
}

html.uax-large-cursor body :is(a, button, [role="button"], input[type="submit"], input[type="button"], label[for], select, summary):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.5' d='M4 2l22 14-9 1 4 12-4 2-3-12-10 1z'/%3E%3C/svg%3E") 2 2, pointer !important;
}

/* ── Focus highlight ───────────────────────────────────────── */

html.uax-focus-highlight body :is(
	a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *):focus-visible {
	outline: 3px solid #2563eb !important;
	outline-offset: 3px !important;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3) !important;
}

/* ── Large click targets (conservative) ────────────────────── */

html.uax-large-targets body :is(a, button, input[type="button"], input[type="submit"], input[type="reset"]):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	min-height: 44px;
	padding-top: 0.35em;
	padding-bottom: 0.35em;
}

/* ── Reading guide ─────────────────────────────────────────── */

#uax-reading-guide {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999900;
	width: 100%;
	height: 0;
	margin: 0;
	padding: 0;
	border: none;
	border-top: 2px solid #1e40af;
	background: none;
	pointer-events: none;
	transform: translateY(-1px);
	will-change: top;
}

/* ── Reading window ────────────────────────────────────────── */

#uax-reading-window-top,
#uax-reading-window-bottom {
	position: fixed;
	left: 0;
	z-index: 999900;
	width: 100%;
	margin: 0;
	padding: 0;
	border: none;
	background-color: rgba(0, 0, 0, 0.55);
	pointer-events: none;
}

#uax-reading-window-top {
	top: 0;
}

#uax-reading-window-bottom {
	/* top and height set by JS */
}

#uax-reading-window-border-top,
#uax-reading-window-border-bottom {
	position: fixed;
	left: 0;
	z-index: 999901;
	width: 100%;
	height: 0;
	margin: 0;
	padding: 0;
	border: none;
	border-top: 2px solid rgba(30, 64, 175, 0.85);
	background: none;
	pointer-events: none;
	will-change: top;
}

/* ── Custom colors ─────────────────────────────────────────── */

html.uax-custom-background-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light),
html.uax-custom-background-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light) body,
html.uax-custom-background-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light) body > :not(#wpadminbar):not(#uax-widget),
html.uax-custom-background-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light) body :is(
	main,
	article,
	section,
	header,
	footer,
	aside,
	nav,
	#page,
	#primary,
	#content,
	#secondary,
	.site,
	.site-content,
	.content-area,
	[role="main"],
	[role="document"],
	[role="banner"],
	[role="contentinfo"],
	[role="navigation"]
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *),
html.uax-custom-background-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light) #page > :is(
	div,
	main,
	section,
	header,
	footer,
	aside
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	background-color: var(--uax-custom-background) !important;
}

html.uax-custom-headings-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light) body :where(
	h1, h2, h3, h4, h5, h6
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: var(--uax-custom-headings) !important;
}

html.uax-custom-content-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light) body :where(
	p, li, blockquote, td, th
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: var(--uax-custom-content) !important;
}

html.uax-custom-content-active:not(.uax-contrast-high):not(.uax-contrast-dark):not(.uax-contrast-light):not(.uax-highlight-links) body a[href]:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: inherit !important;
}

/* ── Stop animations ───────────────────────────────────────── */

html.uax-stop-animations body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *),
html.uax-stop-animations body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *)::before,
html.uax-stop-animations body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *)::after {
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}

/* ── Hide images ───────────────────────────────────────────── */

html.uax-hide-images body :is(img, picture):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	opacity: 0 !important;
}

html.uax-hide-images body img:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	visibility: hidden !important;
}

/* ── Image alt descriptions ────────────────────────────────── */

.uax-img-alt-caption {
	display: block;
	margin-top: 0.35em;
	padding: 0.35em 0.5em;
	border-right: 3px solid #1a2b6d;
	background-color: rgba(26, 43, 109, 0.06);
	color: #1a2b6d;
	font-size: 0.85em;
	line-height: 1.4;
}

/* ── Reading mode (non-destructive — text only) ────────────── */

html.uax-reading-mode body :where(
	p, li, blockquote, td, th
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	line-height: 1.75 !important;
	text-shadow: none !important;
	font-weight: 400 !important;
	letter-spacing: 0.01em !important;
}

html.uax-reading-mode body :where(
	h1, h2, h3, h4, h5, h6
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	text-shadow: none !important;
	line-height: 1.35 !important;
}

html.uax-reading-mode body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	text-shadow: none !important;
}

/* ── Highlight text (conservative) ─────────────────────────── */

html.uax-highlight-text body :where(
	p, li, span, div, td, th, blockquote, label
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	color: #111827 !important;
	font-weight: 500 !important;
}

/* ── Text alignment ────────────────────────────────────────── */

html.uax-text-align-right body :where(
	p, li, blockquote, h1, h2, h3, h4, h5, h6
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	text-align: right !important;
}

html.uax-text-align-center body :where(
	p, li, blockquote, h1, h2, h3, h4, h5, h6
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	text-align: center !important;
}

html.uax-text-align-left body :where(
	p, li, blockquote, h1, h2, h3, h4, h5, h6
):not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	text-align: left !important;
}

/* ── Paragraph spacing ─────────────────────────────────────── */

html.uax-paragraph-spacing-1 body p:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	margin-bottom: 1.5em !important;
}

html.uax-paragraph-spacing-2 body p:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	margin-bottom: 2em !important;
}

html.uax-paragraph-spacing-3 body p:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	margin-bottom: 2.5em !important;
}

/* ── Stop flashing (narrow — blink/flicker only) ───────────── */

html.uax-stop-flashing body :not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	animation-name: none !important;
	animation-play-state: paused !important;
}

html.uax-stop-flashing body marquee:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	display: none !important;
}

html.uax-stop-flashing body blink:not(#uax-widget, #uax-widget *, #wpadminbar, #wpadminbar *) {
	animation: none !important;
	opacity: 1 !important;
}
