/**
 * Accessibility effects, applied via body.a11y-* classes toggled by
 * assets/js/effects.js (and mirrored synchronously before first paint by
 * the no-FOUC script in includes/class-render.php).
 *
 * Every rule below is scoped under `#wp-a11y-content-wrap` (the page's real
 * content, printed between wp_body_open and the end of wp_footer) rather
 * than bare `body` - this keeps the FAB/panel (siblings printed *after* the
 * wrapper closes) completely unaffected by any effect, and avoids `filter`
 * on an ancestor breaking their `position: fixed` (a CSS `filter` creates a
 * new containing block for fixed-position descendants).
 *
 * Class naming: `a11y-<kebab-case-id>` for booleans, `a11y-<kebab-case-id>-<level>`
 * for steppers (level 1..max; level 0 = default, no class).
 */

/* ---------------------------------------------------------------------- */
/* Fonts (self-hosted, OFL-licensed - see assets/fonts/THIRDPARTY.md)      */
/* ---------------------------------------------------------------------- */

@font-face {
	font-family: 'Atkinson Hyperlegible';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/atkinson-hyperlegible-400.woff2') format('woff2');
}

@font-face {
	font-family: 'Atkinson Hyperlegible';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/atkinson-hyperlegible-700.woff2') format('woff2');
}

@font-face {
	font-family: 'Lexend';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/lexend-400.woff2') format('woff2');
}

@font-face {
	font-family: 'Lexend';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/lexend-700.woff2') format('woff2');
}

@font-face {
	font-family: 'OpenDyslexic';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/opendyslexic-400.woff2') format('woff2');
}

@font-face {
	font-family: 'OpenDyslexic';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/opendyslexic-700.woff2') format('woff2');
}

/* ---------------------------------------------------------------------- */
/* Composable filter stack (invert / saturation / color-blind / blue-light) */
/* ---------------------------------------------------------------------- */

#wp-a11y-content-wrap {
	filter: var( --wp-a11y-f-invert, ) var( --wp-a11y-f-saturate, ) var( --wp-a11y-f-color, ) var( --wp-a11y-f-bluelight, );
}

body.a11y-invert-colors #wp-a11y-content-wrap {
	--wp-a11y-f-invert: invert(1) hue-rotate(180deg);
}

body.a11y-saturation-1 #wp-a11y-content-wrap {
	--wp-a11y-f-saturate: saturate(2);
}
body.a11y-saturation-2 #wp-a11y-content-wrap {
	--wp-a11y-f-saturate: saturate(0.5);
}
body.a11y-saturation-3 #wp-a11y-content-wrap {
	--wp-a11y-f-saturate: grayscale(1);
}

body.a11y-color-change-1 #wp-a11y-content-wrap {
	--wp-a11y-f-color: url('#wp-a11y-protanopia');
}
body.a11y-color-change-2 #wp-a11y-content-wrap {
	--wp-a11y-f-color: url('#wp-a11y-deuteranopia');
}
body.a11y-color-change-3 #wp-a11y-content-wrap {
	--wp-a11y-f-color: url('#wp-a11y-tritanopia');
}

body.a11y-blue-light-filter-1 #wp-a11y-content-wrap {
	--wp-a11y-f-bluelight: sepia(0.15) saturate(1.1);
}
body.a11y-blue-light-filter-2 #wp-a11y-content-wrap {
	--wp-a11y-f-bluelight: sepia(0.3) saturate(1.2) hue-rotate(-10deg);
}
body.a11y-blue-light-filter-3 #wp-a11y-content-wrap {
	--wp-a11y-f-bluelight: sepia(0.5) saturate(1.3) hue-rotate(-15deg);
}

/* ---------------------------------------------------------------------- */
/* Typography                                                              */
/* ---------------------------------------------------------------------- */

body.a11y-readable-font #wp-a11y-content-wrap,
body.a11y-readable-font #wp-a11y-content-wrap * {
	font-family: 'Atkinson Hyperlegible', sans-serif !important;
}

body.a11y-dyslexic-font-1 #wp-a11y-content-wrap,
body.a11y-dyslexic-font-1 #wp-a11y-content-wrap * {
	font-family: 'Lexend', sans-serif !important;
}
body.a11y-dyslexic-font-2 #wp-a11y-content-wrap,
body.a11y-dyslexic-font-2 #wp-a11y-content-wrap * {
	font-family: 'OpenDyslexic', sans-serif !important;
}

body.a11y-highlight-titles #wp-a11y-content-wrap h1,
body.a11y-highlight-titles #wp-a11y-content-wrap h2,
body.a11y-highlight-titles #wp-a11y-content-wrap h3,
body.a11y-highlight-titles #wp-a11y-content-wrap h4,
body.a11y-highlight-titles #wp-a11y-content-wrap h5,
body.a11y-highlight-titles #wp-a11y-content-wrap h6 {
	color: var( --wp-a11y-highlighttitles, #eab308 ) !important;
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 4px;
}

body.a11y-highlight-links #wp-a11y-content-wrap a {
	color: var( --wp-a11y-highlightlinks, #3b82f6 ) !important;
	text-decoration: underline !important;
	background: color-mix( in srgb, var( --wp-a11y-highlightlinks, #3b82f6 ) 12%, transparent );
}

body.a11y-highlight-buttons #wp-a11y-content-wrap button,
body.a11y-highlight-buttons #wp-a11y-content-wrap .button,
body.a11y-highlight-buttons #wp-a11y-content-wrap input[type='submit'],
body.a11y-highlight-buttons #wp-a11y-content-wrap input[type='button'] {
	outline: 3px solid var( --wp-a11y-highlightbuttons, #f97316 ) !important;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px color-mix( in srgb, var( --wp-a11y-highlightbuttons, #f97316 ) 25%, transparent );
}

body.a11y-text-size-1 #wp-a11y-content-wrap { font-size: 112%; }
body.a11y-text-size-2 #wp-a11y-content-wrap { font-size: 125%; }
body.a11y-text-size-3 #wp-a11y-content-wrap { font-size: 150%; }
body.a11y-text-size-4 #wp-a11y-content-wrap { font-size: 200%; }

body.a11y-line-height-1 #wp-a11y-content-wrap * { line-height: 1.5 !important; }
body.a11y-line-height-2 #wp-a11y-content-wrap * { line-height: 1.8 !important; }
body.a11y-line-height-3 #wp-a11y-content-wrap * { line-height: 2.2 !important; }

body.a11y-text-spacing-1 #wp-a11y-content-wrap * { letter-spacing: 0.05em !important; }
body.a11y-text-spacing-2 #wp-a11y-content-wrap * { letter-spacing: 0.1em !important; }
body.a11y-text-spacing-3 #wp-a11y-content-wrap * { letter-spacing: 0.2em !important; }

body.a11y-word-spacing-1 #wp-a11y-content-wrap * { word-spacing: 0.15em !important; }
body.a11y-word-spacing-2 #wp-a11y-content-wrap * { word-spacing: 0.3em !important; }
body.a11y-word-spacing-3 #wp-a11y-content-wrap * { word-spacing: 0.5em !important; }

body.a11y-text-align-1 #wp-a11y-content-wrap * { text-align: left !important; }
body.a11y-text-align-2 #wp-a11y-content-wrap * { text-align: center !important; }
body.a11y-text-align-3 #wp-a11y-content-wrap * { text-align: right !important; }
body.a11y-text-align-4 #wp-a11y-content-wrap * { text-align: justify !important; }

/* ---------------------------------------------------------------------- */
/* Color & contrast                                                        */
/* ---------------------------------------------------------------------- */

body.a11y-contrast-1 #wp-a11y-content-wrap {
	background: #1a1a1a !important;
	color: #f0f0f0 !important;
}
body.a11y-contrast-1 #wp-a11y-content-wrap :is(header, footer, nav, aside, article, main, section, div) {
	background-color: #1a1a1a !important;
	color: #f0f0f0 !important;
}
body.a11y-contrast-1 #wp-a11y-content-wrap a { color: #8ab4f8 !important; }

body.a11y-contrast-2 #wp-a11y-content-wrap {
	background: #f4ecd8 !important;
	color: #3b2f1e !important;
}
body.a11y-contrast-2 #wp-a11y-content-wrap :is(header, footer, nav, aside, article, main, section, div) {
	background-color: #f4ecd8 !important;
	color: #3b2f1e !important;
}
body.a11y-contrast-2 #wp-a11y-content-wrap a { color: #7a4a12 !important; }

body.a11y-contrast-3 #wp-a11y-content-wrap {
	background: #000 !important;
	color: #fff !important;
}
body.a11y-contrast-3 #wp-a11y-content-wrap :is(header, footer, nav, aside, article, main, section, div) {
	background-color: #000 !important;
	color: #fff !important;
}
body.a11y-contrast-3 #wp-a11y-content-wrap a {
	color: #ffff00 !important;
	text-decoration: underline !important;
}
body.a11y-contrast-3 #wp-a11y-content-wrap button,
body.a11y-contrast-3 #wp-a11y-content-wrap .button {
	background: #fff !important;
	color: #000 !important;
	border: 2px solid #fff !important;
}

/* ---------------------------------------------------------------------- */
/* Media & animation                                                       */
/* ---------------------------------------------------------------------- */

body.a11y-hide-images #wp-a11y-content-wrap img,
body.a11y-hide-images #wp-a11y-content-wrap svg,
body.a11y-hide-images #wp-a11y-content-wrap picture,
body.a11y-hide-images #wp-a11y-content-wrap video,
body.a11y-hide-images #wp-a11y-content-wrap iframe {
	visibility: hidden !important;
}

body.a11y-pause-animations #wp-a11y-content-wrap * {
	animation-play-state: paused !important;
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}

/* ---------------------------------------------------------------------- */
/* Focus & navigation                                                      */
/* ---------------------------------------------------------------------- */

body.a11y-cursor-1 #wp-a11y-content-wrap,
body.a11y-cursor-1 #wp-a11y-content-wrap * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="black" stroke="white" stroke-width="1" d="M3 2 L21 12 L13 13 L10 21 Z"/></svg>') 4 4, auto !important;
}
body.a11y-cursor-2 #wp-a11y-content-wrap,
body.a11y-cursor-2 #wp-a11y-content-wrap * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="white" stroke="black" stroke-width="1" d="M3 2 L21 12 L13 13 L10 21 Z"/></svg>') 4 4, auto !important;
}

body.a11y-focus-mode-1 #wp-a11y-content-wrap :is(header, footer, nav, aside, [role='banner'], [role='contentinfo'], [role='complementary'], [role='navigation'], .widget-area, .sidebar) {
	opacity: 0.35;
}

body.a11y-focus-mode-2 #wp-a11y-content-wrap :is(header, footer, nav, aside, [role='banner'], [role='contentinfo'], [role='complementary'], [role='navigation'], .widget-area, .sidebar),
body.a11y-focus-mode-3 #wp-a11y-content-wrap :is(header, footer, nav, aside, [role='banner'], [role='contentinfo'], [role='complementary'], [role='navigation'], .widget-area, .sidebar) {
	display: none !important;
}
body.a11y-focus-mode-2 #wp-a11y-content-wrap :is(main, article, [role='main']),
body.a11y-focus-mode-3 #wp-a11y-content-wrap :is(main, article, [role='main']) {
	max-width: 70ch;
	margin-inline: auto;
	float: none !important;
}
body.a11y-focus-mode-3 #wp-a11y-content-wrap img,
body.a11y-focus-mode-3 #wp-a11y-content-wrap svg,
body.a11y-focus-mode-3 #wp-a11y-content-wrap picture,
body.a11y-focus-mode-3 #wp-a11y-content-wrap video {
	visibility: hidden !important;
}
