/**
 * Infinity Accessibility Toolbar - front-end styles
 * -----------------------------------------------------------------------------
 * Scoped with the .ia11y- prefix so nothing here can collide with LEC-theme,
 * Elementor or JetEngine class names.
 *
 * The contrast themes use `!important` deliberately. Elementor writes inline
 * styles and highly specific selectors directly onto elements; a high-contrast
 * mode that does not override those is useless to the person who needs it.
 */

:root {
	--ia11y-accent: #0b5e8a;
}

/* ---------------------------------------------------------------- skip link */

.ia11y-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 12px 20px;
	background: #fff;
	color: #000;
	font: 600 16px/1.4 system-ui, sans-serif;
	text-decoration: underline;
	border: 3px solid var(--ia11y-accent);
	border-radius: 0 0 6px 0;
}

.ia11y-skip-link:focus {
	left: 0;
}

/* ------------------------------------------------------------ launch button */

.ia11y-btn {
	position: fixed;
	bottom: 20px;
	z-index: 99998;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--ia11y-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 3px 14px rgba(0, 0, 0, .3);
	transition: transform .15s ease;
}

.ia11y-btn:hover { transform: scale(1.07); }

.ia11y-btn:focus-visible,
.ia11y-panel button:focus-visible {
	outline: 3px solid #ffbf47;
	outline-offset: 2px;
}

.ia11y-btn.ia11y-bottom-right { right: 20px; }
.ia11y-btn.ia11y-bottom-left  { left: 20px; }

/* -------------------------------------------------------------------- panel */

.ia11y-panel {
	position: fixed;
	bottom: 84px;
	z-index: 99999;
	width: 320px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 110px);
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid #c9d2d8;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ia11y-panel[hidden] { display: none; }

.ia11y-panel.ia11y-bottom-right { right: 20px; }
.ia11y-panel.ia11y-bottom-left  { left: 20px; }

.ia11y-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 14px 16px;
	background: var(--ia11y-accent);
	color: #fff;
	border-radius: 9px 9px 0 0;
}

.ia11y-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
}

.ia11y-close {
	width: 30px;
	height: 30px;
	flex: 0 0 auto;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 5px;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.ia11y-close:hover { background: rgba(255, 255, 255, .18); }

.ia11y-body { padding: 14px 16px 18px; }

.ia11y-h {
	margin: 16px 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #55636d;
}

.ia11y-body > .ia11y-h:first-child { margin-top: 0; }

.ia11y-hint {
	margin: 0 0 8px;
	font-size: 13px;
	color: #55636d;
}

/* ------------------------------------------------------------ font stepper */

.ia11y-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ia11y-step {
	flex: 0 0 auto;
	width: 46px;
	height: 40px;
	background: #eef2f5;
	border: 1px solid #c9d2d8;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 700;
	color: #1a1a1a;
	cursor: pointer;
}

.ia11y-step:hover { background: #dfe6eb; }

.ia11y-gauge {
	flex: 1 1 auto;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------- toggles / grid */

.ia11y-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.ia11y-toggle {
	padding: 10px 8px;
	background: #eef2f5;
	border: 1px solid #c9d2d8;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	text-align: center;
	cursor: pointer;
}

.ia11y-toggle:hover { background: #dfe6eb; }

.ia11y-toggle[aria-pressed="true"] {
	background: var(--ia11y-accent);
	border-color: var(--ia11y-accent);
	color: #fff;
}

.ia11y-toggle[aria-pressed="true"]::before { content: "\2713\00a0"; }

/* --------------------------------------------------------------- themes */

.ia11y-themes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.ia11y-theme {
	padding: 10px 8px;
	border: 2px solid #c9d2d8;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.ia11y-theme[aria-checked="true"] {
	border-color: var(--ia11y-accent);
	box-shadow: inset 0 0 0 2px var(--ia11y-accent);
}

.ia11y-theme-default { background: #fff;    color: #1a1a1a; }
.ia11y-theme-dark    { background: #000;    color: #fff; }
.ia11y-theme-light   { background: #fff;    color: #000; border-color:#000; }
.ia11y-theme-yellow  { background: #000;    color: #ff0; }
.ia11y-theme-blue    { background: #003b6f; color: #fff; }

/* --------------------------------------------------------------- reset */

.ia11y-reset {
	width: 100%;
	margin-top: 18px;
	padding: 11px;
	background: #fff;
	border: 2px solid #a33;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 700;
	color: #a33;
	cursor: pointer;
}

.ia11y-reset:hover { background: #a33; color: #fff; }

.ia11y-live {
	margin: 8px 0 0;
	font-size: 13px;
	color: #2a6a3a;
	text-align: center;
}

/* "Read aloud is not available in Welsh on this device." Amber, not red: this is
   a limitation to report, not an error the visitor caused. Empty by default, so
   it collapses when there is nothing to say. */
.ia11y-speech-status:not(:empty) {
	margin: 8px 0 0;
	padding: 8px 10px;
	background: #fff8e6;
	border-left: 3px solid #e0a800;
	border-radius: 0 4px 4px 0;
	font-size: 13px;
	line-height: 1.45;
	color: #5c4600;
}

/* =========================================================================
 * VISITOR PREFERENCES - applied to <html>
 * ====================================================================== */

/* ----- text size. 1rem steps of 12.5% ---------------------------------- */

html[data-ia11y-font="-1"] { font-size: 87.5%; }
html[data-ia11y-font="1"]  { font-size: 112.5%; }
html[data-ia11y-font="2"]  { font-size: 125%; }
html[data-ia11y-font="3"]  { font-size: 137.5%; }
html[data-ia11y-font="4"]  { font-size: 150%; }

/* Elementor hard-codes px font sizes. Scale them proportionally so the
   stepper actually does something on this theme. */
html[data-ia11y-font="1"] body :is(p, li, span, a, h1, h2, h3, h4, h5, h6, td, th, label, button, input, blockquote):not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) { font-size: 1.125em !important; }
html[data-ia11y-font="2"] body :is(p, li, span, a, h1, h2, h3, h4, h5, h6, td, th, label, button, input, blockquote):not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) { font-size: 1.25em !important; }
html[data-ia11y-font="3"] body :is(p, li, span, a, h1, h2, h3, h4, h5, h6, td, th, label, button, input, blockquote):not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) { font-size: 1.375em !important; }
html[data-ia11y-font="4"] body :is(p, li, span, a, h1, h2, h3, h4, h5, h6, td, th, label, button, input, blockquote):not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) { font-size: 1.5em !important; }

/* ----- reflow: let scaled text escape Elementor's fixed boxes -------------
 *
 * Scaling the text is only half the job. Elementor pins heights and sets
 * overflow:hidden on its wrappers, so enlarged text is CLIPPED rather than
 * reflowed. Measured on the live clinic site at 150%: the "Book an Appointment"
 * button had 627px of content inside a 263px box with overflow:hidden - the
 * label was cut in half. That is worse than useless to the person who needed
 * the bigger text.
 *
 * WCAG 1.4.4 (Resize Text) requires content to stay readable and functional at
 * 200% "without loss of content or functionality". A clipped button label is
 * loss of content, so this is not cosmetic polish - it is the requirement.
 *
 * Verified on the live site: this takes clipped elements from 5 to 1 at max
 * scale. The survivor is the page wrapper overflowing horizontally, which costs
 * a scrollbar, not content.
 *
 * Note the :not() list on .elementor-element. Carousels and sliders rely on
 * overflow:hidden to clip their track - unclip those and the whole slide reel
 * splays across the page. Confirmed the swiper still clips after this change.
 *
 * All of it is scoped to :not([data-ia11y-font="0"]), so a visitor who never
 * touches the stepper gets the site exactly as designed. */

html[data-ia11y-font]:not([data-ia11y-font="0"]) body :is(a, button, h1, h2, h3, h4, h5, h6, span, p, li, label):not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	white-space: normal !important;
	overflow-wrap: break-word;
	max-width: 100%;
}

html[data-ia11y-font]:not([data-ia11y-font="0"]) body .elementor-element:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *):not(.swiper):not(.swiper-container):not(.elementor-widget-image-carousel):not(.elementor-widget-slides) {
	height: auto !important;
	min-height: 0 !important;
	overflow: visible !important;
}

html[data-ia11y-font]:not([data-ia11y-font="0"]) body :is(
	.elementor-button, .elementor-button-wrapper, .elementor-widget-container,
	.elementor-heading-title, .elementor-field-group, .elementor-form
):not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	height: auto !important;
	min-height: 0 !important;
	line-height: 1.35 !important;
	overflow: visible !important;
}

/* Never scale the toolbar itself.
 *
 * The exclusion lives in the scaling selectors above (:not(.ia11y-ui *)), which
 * is the only place it can reliably live: trying to "undo" the scale afterwards
 * loses the specificity fight against the !important that beats Elementor, and
 * the panel's own headings blow up. Belt and braces, we also pin the panel's
 * typography explicitly, at a specificity high enough to win regardless. */
html[data-ia11y-font] .ia11y-panel { font-size: 15px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-title  { font-size: 16px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-h      { font-size: 12px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-close  { font-size: 20px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-step   { font-size: 16px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-gauge  { font-size: 15px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-toggle,
html[data-ia11y-font] .ia11y-panel .ia11y-theme  { font-size: 13px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-hint,
html[data-ia11y-font] .ia11y-panel .ia11y-live   { font-size: 13px !important; }
html[data-ia11y-font] .ia11y-panel .ia11y-reset  { font-size: 14px !important; }

/* ----- contrast themes -------------------------------------------------- */

html[data-ia11y-theme="dark"] body,
html[data-ia11y-theme="dark"] body *:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

html[data-ia11y-theme="dark"] a:not(.ia11y-ui *):not(#wpadminbar *) { color: #4dc3ff !important; }

html[data-ia11y-theme="light"] body,
html[data-ia11y-theme="light"] body *:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	background-color: #fff !important;
	background-image: none !important;
	color: #000 !important;
	border-color: #000 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

html[data-ia11y-theme="light"] a:not(.ia11y-ui *):not(#wpadminbar *) { color: #00307a !important; }

html[data-ia11y-theme="yellow"] body,
html[data-ia11y-theme="yellow"] body *:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	background-color: #000 !important;
	background-image: none !important;
	color: #ff0 !important;
	border-color: #ff0 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

html[data-ia11y-theme="yellow"] a:not(.ia11y-ui *):not(#wpadminbar *) { color: #0ff !important; }

html[data-ia11y-theme="blue"] body,
html[data-ia11y-theme="blue"] body *:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	background-color: #003b6f !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #cfe4f5 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

html[data-ia11y-theme="blue"] a:not(.ia11y-ui *):not(#wpadminbar *) { color: #ffe27a !important; }

/* Keep logos and clinical photos legible: in contrast modes, images get a thin
   outline so they do not disappear into a black background. */
html[data-ia11y-theme]:not([data-ia11y-theme="default"]) img:not(.ia11y-ui img):not(#wpadminbar img) {
	outline: 1px solid currentColor;
}

/* ----- readable font ---------------------------------------------------- */

html.ia11y-dyslexia body *:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	font-family: "Atkinson Hyperlegible", Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
	letter-spacing: .02em !important;
}

/* ----- text spacing (mirrors WCAG 1.4.12 Text Spacing) ------------------ */

html.ia11y-spacing body :is(p, li, dd, dt, blockquote, figcaption):not(.ia11y-ui *):not(#wpadminbar *) {
	line-height: 1.8 !important;
	letter-spacing: .12em !important;
	word-spacing: .16em !important;
	margin-bottom: 2em !important;
}

/* ----- highlight links -------------------------------------------------- */

html.ia11y-links a:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	text-decoration: underline !important;
	text-underline-offset: 3px !important;
	background: #ff0 !important;
	color: #000 !important;
	box-shadow: 0 0 0 2px #ff0 !important;
}

/* ----- stop animations -------------------------------------------------- */

html.ia11y-stopmotion *:not(.ia11y-ui *) {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

html.ia11y-stopmotion video:not(.ia11y-ui *) {
	/* Cannot pause via CSS; the JS half is intentionally out of scope.
	   Autoplaying video should be removed at the theme level instead. */
}

/* ----- hide images ------------------------------------------------------ */

html.ia11y-hideimages img:not(.ia11y-ui img):not(#wpadminbar img),
html.ia11y-hideimages svg:not(.ia11y-ui svg):not(.ia11y-ui),
html.ia11y-hideimages video {
	visibility: hidden !important;
}

html.ia11y-hideimages *:not(.ia11y-ui):not(.ia11y-ui *):not(#wpadminbar):not(#wpadminbar *) {
	background-image: none !important;
}

/* ----- large cursor ----------------------------------------------------- */

html.ia11y-bigcursor,
html.ia11y-bigcursor * {
	cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M6 2 L6 38 L15 30 L21 44 L28 41 L22 27 L34 27 Z' fill='white' stroke='black' stroke-width='2.5'/></svg>") 4 2, auto !important;
}

html.ia11y-bigcursor a,
html.ia11y-bigcursor button,
html.ia11y-bigcursor [role="button"] {
	cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M16 4 a4 4 0 0 1 8 0 v14 h2 v-4 a3.5 3.5 0 0 1 7 0 v4 h2 v-2 a3.5 3.5 0 0 1 7 0 v14 c0 8-5 14-13 14 h-4 c-6 0-10-4-13-11 l-4-9 a3.5 3.5 0 0 1 6-3.5 l2 4 Z' fill='white' stroke='black' stroke-width='2.5'/></svg>") 16 2, pointer !important;
}

/* ----- reading ruler ---------------------------------------------------- */

.ia11y-ruler {
	position: fixed;
	left: 0;
	width: 100%;
	height: 40px;
	z-index: 99997;
	pointer-events: none;
	background: transparent;
	border-top: 2px solid var(--ia11y-accent);
	border-bottom: 2px solid var(--ia11y-accent);
	box-shadow: 0 -100vh 0 rgba(0, 0, 0, .55), 0 100vh 0 rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 480px) {
	.ia11y-panel {
		right: 8px !important;
		left: 8px !important;
		width: auto;
		bottom: 78px;
	}
}

/* Respect the visitor's OS-level motion preference out of the box. */
@media (prefers-reduced-motion: reduce) {
	.ia11y-btn { transition: none; }
}

/* Print: never print the toolbar. */
@media print {
	.ia11y-btn,
	.ia11y-panel,
	.ia11y-ruler,
	.ia11y-skip-link { display: none !important; }
}
