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

.staa11y-root {
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.staa11y-root.is-left { left: 20px; }
.staa11y-root.is-right { right: 20px; }

.staa11y-fab {
	width: 64px;
	height: 64px;
	border-radius: 999px;
	border: none;
	background: var(--staa11y-color, #2F8F4E);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
	/* Removes the ~300ms tap delay browsers otherwise wait for on touch
	   devices (to see if it's part of a double-tap-to-zoom gesture) -
	   without this a tap can feel unresponsive/laggy even though it does
	   register. */
	touch-action: manipulation;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.staa11y-fab:hover {
	transform: scale(1.07);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.staa11y-fab:active {
	transform: scale(0.96);
}

.staa11y-panel {
	position: absolute;
	bottom: 68px;
	width: 340px;
	max-width: calc(100vw - 24px);
	max-height: min(640px, calc(100vh - 100px));
	background: #f4f5f7;
	border-radius: 16px;
	box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px) scale(0.98);
	transition: opacity 0.16s ease, transform 0.16s ease;
}
.staa11y-root.is-left .staa11y-panel { left: 0; transform-origin: bottom left; }
.staa11y-root.is-right .staa11y-panel { right: 0; transform-origin: bottom right; }
.staa11y-root.is-open .staa11y-panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.staa11y-header {
	background: var(--staa11y-color, #2F8F4E);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 16px;
	flex-shrink: 0;
}

.staa11y-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.staa11y-section-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
	margin: 0 0 8px;
}

.staa11y-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px 14px;
	cursor: pointer;
	user-select: none;
}

.staa11y-row-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.staa11y-row-card .staa11y-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 600;
	color: #1f2430;
}

.staa11y-switch {
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: #d1d5db;
	position: relative;
	flex-shrink: 0;
	transition: background 0.15s ease;
}
.staa11y-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease;
}
.staa11y-card.is-on .staa11y-switch { background: var(--staa11y-color, #2F8F4E); }
.staa11y-card.is-on .staa11y-switch::after { transform: translateX(18px); }

.staa11y-slider-value {
	font-weight: 700;
	color: var(--staa11y-color, #2F8F4E);
}
.staa11y-slider {
	width: 100%;
	margin-top: 10px;
	accent-color: var(--staa11y-color, #2F8F4E);
}

.staa11y-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.staa11y-grid-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.staa11y-grid-card .staa11y-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #1f2430;
}
.staa11y-dots {
	display: flex;
	gap: 4px;
	margin-left: auto;
}
.staa11y-dots span {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: #d1d5db;
}
.staa11y-grid-card.is-active-1 .staa11y-dots span:nth-child(1),
.staa11y-grid-card.is-active-2 .staa11y-dots span:nth-child(1),
.staa11y-grid-card.is-active-2 .staa11y-dots span:nth-child(2) {
	background: var(--staa11y-color, #2F8F4E);
}
.staa11y-grid-card.is-active-1,
.staa11y-grid-card.is-active-2 {
	border-color: var(--staa11y-color, #2F8F4E);
}

.staa11y-icon-badge {
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: #f1f2f4;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #374151;
	flex-shrink: 0;
}
.staa11y-grid-card.is-active-1 .staa11y-icon-badge,
.staa11y-grid-card.is-active-2 .staa11y-icon-badge {
	background: var(--staa11y-color, #2F8F4E);
	color: #fff;
}

.staa11y-footer {
	flex-shrink: 0;
	padding: 14px 16px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.staa11y-reset {
	width: 100%;
	background: var(--staa11y-color, #2F8F4E);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.staa11y-lang {
	position: relative;
}
.staa11y-lang-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	background: #fff;
	font-size: 13px;
	font-weight: 700;
	color: #1f2430;
	cursor: pointer;
}
.staa11y-lang-dropdown {
	position: absolute;
	bottom: 100%;
	left: 0;
	right: 0;
	margin-bottom: 8px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
	max-height: 220px;
	overflow-y: auto;
	display: none;
	z-index: 2;
}
.staa11y-lang-dropdown.is-open { display: block; }
.staa11y-lang-option {
	display: block;
	width: 100%;
	text-align: left;
	padding: 10px 14px;
	font-size: 13px;
	border: none;
	background: none;
	cursor: pointer;
	color: #1f2430;
}
.staa11y-lang-option:hover { background: #f4f5f7; }

.staa11y-tts-hint {
	position: fixed;
	bottom: 90px;
	left: 50%;
	transform: translateX(-50%);
	background: #1f2430;
	color: #fff;
	padding: 10px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	z-index: 999998;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.staa11y-hidden { display: none !important; }

@media (max-width: 420px) {
	.staa11y-panel { width: calc(100vw - 24px); }
}

/* On a short viewport (an older/smaller phone in portrait, e.g. iPhone
   SE), the closed button sits low enough to land on top of whatever page
   content happens to be there too - shrinking it and pulling it a little
   closer to the corner buys back some of that collision room without
   changing anything on a normal-height screen. */
@media (max-height: 700px) {
	.staa11y-root {
		bottom: 10px;
	}
	.staa11y-fab {
		width: 48px;
		height: 48px;
	}
}

/* ------------------------------------------------------------------ *
 * Site-wide effects. These intentionally use broad selectors since this
 * plugin has to work the same regardless of which theme is active - it
 * can't rely on a theme's own CSS custom properties the way a single
 * theme's bespoke high-contrast mode could. `:not(.staa11y-root):not(
 * .staa11y-root *)` on the text-affecting rules keeps the widget's own UI
 * legible while these are on; the color-filter effects (contrast/
 * saturation/invert, applied as a single composed `filter` on <html> by
 * a11y-widget.js) apply to literally everything on screen including the
 * widget itself, same trade-off real accessibility overlay tools make.
 * ------------------------------------------------------------------ */

html.sta11y-lh-1 body *:not(.staa11y-root):not(.staa11y-root *) { line-height: 1.7 !important; }
html.sta11y-lh-2 body *:not(.staa11y-root):not(.staa11y-root *) { line-height: 2.1 !important; }

html.sta11y-ls-1 body *:not(.staa11y-root):not(.staa11y-root *) { letter-spacing: 0.05em !important; }
html.sta11y-ls-2 body *:not(.staa11y-root):not(.staa11y-root *) { letter-spacing: 0.12em !important; }

html.sta11y-fw-1 body *:not(.staa11y-root):not(.staa11y-root *) { font-weight: 600 !important; }
html.sta11y-fw-2 body *:not(.staa11y-root):not(.staa11y-root *) { font-weight: 800 !important; }

html.sta11y-dyslexia body *:not(.staa11y-root):not(.staa11y-root *) {
	font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif !important;
}

html.sta11y-high-contrast body *:not(.staa11y-root):not(.staa11y-root *) {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #555 !important;
}
html.sta11y-high-contrast body a:not(.staa11y-root *) {
	color: #ffe000 !important;
}
html.sta11y-high-contrast body img:not(.staa11y-root *),
html.sta11y-high-contrast body svg:not(.staa11y-root *),
html.sta11y-high-contrast body video:not(.staa11y-root *) {
	filter: grayscale(50%) contrast(1.1);
}

html.sta11y-tts-active body *:not(.staa11y-root):not(.staa11y-root *):hover {
	outline: 2px dashed var(--staa11y-color, #2F8F4E);
	outline-offset: 2px;
	cursor: pointer;
}

/* Google Translate widget cleanup - it otherwise pushes the whole page
   down with a banner iframe and underlines every translated text node. */
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* Hidden on mobile at the site's request: the FAB was crowding the same
   bottom corner as the chat widget and the "back to top" button on small
   screens. Below lg there is no on-screen way to open this panel at all -
   a mobile visitor can no longer switch on larger text, high contrast,
   etc. from their phone. */
@media (max-width: 1023px) {
	.staa11y-root { display: none; }
}
