/* Ahoy Accessibility: page-side effects. All rules are keyed on classes on <html>.
   The widget lives in a shadow root (#ahoy-a11y), so these rules do not touch it. */

@font-face { font-family: "AhoyOpenDyslexic"; src: url("fonts/OpenDyslexic-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AhoyOpenDyslexic"; src: url("fonts/OpenDyslexic-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

/* Shortcode button */
.ahoy-a11y-open { cursor: pointer; }

/* Readable font (system fonts with good Hebrew/Arabic/Cyrillic support; icon fonts excluded) */
html.ahoy-readableFont body :not(#ahoy-a11y):not(i):not([class*="icon"]):not([class*="fa-"]):not([class*="dashicons"]):not([class*="eicon"]) {
	font-family: Arial, "Helvetica Neue", Tahoma, "Segoe UI", sans-serif !important;
}
/* Dyslexia font. OpenDyslexic has Latin glyphs only; Hebrew falls back to Arial. */
html.ahoy-dyslexicFont body :not(#ahoy-a11y):not(i):not([class*="icon"]):not([class*="fa-"]):not([class*="dashicons"]):not([class*="eicon"]) {
	font-family: "AhoyOpenDyslexic", Arial, sans-serif !important;
}

/* Big cursor */
html.ahoy-bigCursor, html.ahoy-bigCursor body * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1 3.8 7.2-2.6 1.3-3.8-7.3L4 20z' fill='%23000' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

/* Line height (WCAG 1.4.12 uses 1.5) */
html.ahoy-lineHeight-1 body :not(#ahoy-a11y) { line-height: 1.5 !important; }
html.ahoy-lineHeight-2 body :not(#ahoy-a11y) { line-height: 1.8 !important; }
html.ahoy-lineHeight-3 body :not(#ahoy-a11y) { line-height: 2.1 !important; }
html.ahoy-lineHeight-4 body :not(#ahoy-a11y) { line-height: 2.5 !important; }

/* Letter spacing (level 1 = WCAG 1.4.12 values) */
html.ahoy-letterSpacing-1 body :not(#ahoy-a11y) { letter-spacing: .12em !important; word-spacing: .16em !important; }
html.ahoy-letterSpacing-2 body :not(#ahoy-a11y) { letter-spacing: .2em !important; word-spacing: .25em !important; }
html.ahoy-letterSpacing-3 body :not(#ahoy-a11y) { letter-spacing: .3em !important; word-spacing: .35em !important; }

/* Text align: 1 left, 2 center, 3 right */
html.ahoy-textAlign-1 body :not(#ahoy-a11y) { text-align: left !important; }
html.ahoy-textAlign-2 body :not(#ahoy-a11y) { text-align: center !important; }
html.ahoy-textAlign-3 body :not(#ahoy-a11y) { text-align: right !important; }

/* Font weight */
html.ahoy-fontWeight-1 body :not(#ahoy-a11y) { font-weight: 700 !important; }
html.ahoy-fontWeight-2 body :not(#ahoy-a11y) { font-weight: 900 !important; }

/* Dark / light contrast */
html.ahoy-darkContrast, html.ahoy-darkContrast body, html.ahoy-darkContrast body :not(#ahoy-a11y) {
	background-color: #000 !important; color: #fff !important; border-color: #fff !important;
}
html.ahoy-darkContrast body a[href]:not(#ahoy-a11y) { color: #ffd23c !important; }
html.ahoy-lightContrast, html.ahoy-lightContrast body, html.ahoy-lightContrast body :not(#ahoy-a11y) {
	background-color: #fff !important; color: #000 !important; border-color: #000 !important;
}
html.ahoy-lightContrast body a[href]:not(#ahoy-a11y) { color: #0000cc !important; }

/* Filters. One slot for contrast, one for color. Applied to body children except the widget,
   so the widget stays readable. ponytail: a filter makes fixed descendants relative to that child;
   sticky headers can move while a filter is on. */
html { --ahoy-f1: contrast(1); --ahoy-f2: saturate(1); }
html.ahoy-highContrast { --ahoy-f1: contrast(1.6); }
html.ahoy-monochrome { --ahoy-f2: grayscale(1); }
html.ahoy-saturation-1 { --ahoy-f2: saturate(.4); }
html.ahoy-saturation-2 { --ahoy-f2: saturate(2.2); }
html:is(.ahoy-highContrast, .ahoy-monochrome, .ahoy-saturation) body > :not(#ahoy-a11y) {
	filter: var(--ahoy-f1) var(--ahoy-f2) !important;
}

/* Highlight links (after the contrast rules, so it wins) */
html.ahoy-highlightLinks body a[href]:not(#ahoy-a11y) {
	background: var(--ahoy-primary) !important; color: var(--ahoy-on-primary) !important;
	text-decoration: underline !important; outline: 2px solid #1a1a1a !important; outline-offset: 1px !important;
}

/* Highlight titles */
html.ahoy-highlightTitles body :is(h1, h2, h3, h4, h5, h6, [role="heading"]) {
	outline: 3px solid #1a1a1a !important; outline-offset: 3px !important;
	box-shadow: 0 0 0 6px var(--ahoy-primary) !important;
}

/* Hide images */
html.ahoy-hideImages body :is(img, picture, video[poster], [role="img"]):not(#ahoy-a11y) { visibility: hidden !important; }
html.ahoy-hideImages body :not(#ahoy-a11y) { background-image: none !important; }

/* Keyboard navigation: strong focus indicator */
html.ahoy-keyboardNav body :focus:not(#ahoy-a11y) { outline: 3px solid #1a1a1a !important; outline-offset: 2px !important; box-shadow: 0 0 0 6px var(--ahoy-primary) !important; }

/* Stop animations: jump to the end state, do not hide content */
html.ahoy-stopAnimations body *, html.ahoy-stopAnimations body *::before, html.ahoy-stopAnimations body *::after {
	animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
	transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}

@media print {
	#ahoy-a11y { display: none !important; }
	html[class*="ahoy-"] body > * { filter: none !important; }
}
