/* Morin A11y toolbar — vanilla, no framework */

#morin-a11y-root, #morin-a11y-root * {
	box-sizing: border-box;
}

/* trigger button */
.morin-a11y-trigger {
	position: fixed;
	z-index: 2147483600;
	border: 0;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--morin-a11y-trigger-bg, #264933);
	color: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0,0,0,.25);
	width: 48px;
	height: 48px;
	transition: transform .15s ease;
}
.morin-a11y-trigger:hover { transform: scale(1.05); }
.morin-a11y-trigger:focus-visible {
	outline: 3px solid #ffd400;
	outline-offset: 2px;
}
.morin-a11y-trigger.morin-a11y-size-large { width: 64px; height: 64px; }
.morin-a11y-trigger svg { width: 60%; height: 60%; }

/* trigger color presets */
.morin-a11y-color-blue   { --morin-a11y-trigger-bg: #1262b3; }
.morin-a11y-color-orange { --morin-a11y-trigger-bg: #AA8775; }
.morin-a11y-color-green  { --morin-a11y-trigger-bg: #264933; }
.morin-a11y-color-black  { --morin-a11y-trigger-bg: #020101; }
.morin-a11y-color-white  { --morin-a11y-trigger-bg: #fff; color:#264933; box-shadow:0 0 0 1px #AA8775, 0 2px 10px rgba(0,0,0,.25); }

/* trigger position */
.morin-a11y-pos-left   { left: 16px; }
.morin-a11y-pos-right  { right: 16px; }
.morin-a11y-pos-bottom { bottom: 16px; }
.morin-a11y-pos-top    { top: 16px; }

/* tooltip */
.morin-a11y-tooltip {
	position: fixed;
	z-index: 2147483601;
	background: #111;
	color: #fff;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	max-width: 240px;
	line-height: 1.4;
	box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.morin-a11y-tooltip[hidden] { display: none; }

/* panel */
.morin-a11y-panel {
	position: fixed;
	z-index: 2147483602;
	width: 360px;
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - 80px);
	background: #fff;
	color: #111;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0,0,0,.25);
	overflow: auto;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
}
.morin-a11y-panel[hidden] { display: none; }
.morin-a11y-panel[dir="rtl"] { direction: rtl; text-align: right; }

.morin-a11y-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid #e5e5e5;
	position: sticky;
	top: 0;
	background: #fff;
}
.morin-a11y-panel-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}
.morin-a11y-panel-close,
.morin-a11y-panel-reset {
	background: transparent;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 6px 10px;
	cursor: pointer;
	font-size: 13px;
}
.morin-a11y-panel-close:focus-visible,
.morin-a11y-panel-reset:focus-visible,
.morin-a11y-toggle:focus-visible,
.morin-a11y-link:focus-visible {
	outline: 3px solid #ffd400;
	outline-offset: 2px;
}

.morin-a11y-group {
	padding: 12px 16px;
	border-bottom: 1px solid #f0f0f0;
}
.morin-a11y-group:last-child { border-bottom: 0; }
.morin-a11y-group-title {
	margin: 0 0 8px 0;
	font-size: 13px;
	font-weight: 700;
	color: #555;
}
.morin-a11y-toggles {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
}
.morin-a11y-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 10px 6px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fafafa;
	cursor: pointer;
	min-height: 64px;
	font-size: 12px;
	line-height: 1.2;
	color: #111;
	text-align: center;
}
.morin-a11y-toggle[aria-pressed="true"] {
	background: #264933;
	color: #fff;
	border-color: #264933;
}
.morin-a11y-toggle svg { width: 20px; height: 20px; }
.morin-a11y-toggle[aria-pressed="true"] svg { color: #fff; }

.morin-a11y-quick-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid #e5e5e5;
}
.morin-a11y-quick-links.pos-right { justify-content: flex-end; }
.morin-a11y-quick-links.pos-left  { justify-content: flex-start; }
.morin-a11y-link {
	display: inline-block;
	padding: 8px 12px;
	border-radius: 6px;
	background: #EDD7C8;
	color: #264933;
	text-decoration: none;
	font-size: 13px;
}
.morin-a11y-link:hover { background: #DCB097; }

/* reading guide */
.morin-a11y-reading-guide {
	position: fixed;
	left: 0;
	width: 100%;
	height: 32px;
	background: rgba(255, 212, 0, .35);
	border-top: 2px solid #ffd400;
	border-bottom: 2px solid #ffd400;
	pointer-events: none;
	z-index: 2147483599;
	transform: translateY(-50%);
}
/* Defense-in-depth: hide stale guide element if marker class missing */
html:not(.morin-a11y-reading-guide-on) .morin-a11y-reading-guide { display: none !important; }

/* toggle effects applied on <html>/<body> */
html.morin-a11y-contrast,
html.morin-a11y-contrast body { background: #000 !important; color: #fff !important; }
/* Text elements: force white on transparent. Excludes Elementor layout wrappers
   to avoid clobbering scoped section/column backgrounds. */
html.morin-a11y-contrast :is(p,h1,h2,h3,h4,h5,h6,li,span,label,th,td,figcaption,blockquote,article) {
	color: #fff !important; background-color: transparent !important;
}
html.morin-a11y-contrast section:not(.elementor-section):not(.elementor-element),
html.morin-a11y-contrast div:not(.elementor-widget-container):not(.elementor-column):not(.elementor-section):not(.elementor-element):not(.elementor-widget-wrap):not(.elementor-row):not(.elementor-container):not(.e-con):not(.e-con-inner) {
	color: #fff !important; background-color: transparent !important;
}
html.morin-a11y-contrast :is(a, a *) { color: #ffd400 !important; }

html.morin-a11y-invert { filter: invert(1) hue-rotate(180deg); }
html.morin-a11y-invert img,
html.morin-a11y-invert video,
html.morin-a11y-invert iframe { filter: invert(1) hue-rotate(180deg); }

html.morin-a11y-grayscale { filter: grayscale(100%); }
html.morin-a11y-grayscale.morin-a11y-invert { filter: grayscale(100%) invert(1) hue-rotate(180deg); }

html.morin-a11y-light, html.morin-a11y-light body { background: #fff !important; color: #111 !important; }
html.morin-a11y-dark,  html.morin-a11y-dark  body { background: #111 !important; color: #f5f5f5 !important; }
/* Dark text override: foreground only, never touch backgrounds (preserves Elementor card colors). */
html.morin-a11y-dark :is(p,h1,h2,h3,h4,h5,h6,li,span,label,th,td,figcaption,blockquote) {
	color: #f5f5f5 !important;
}
html.morin-a11y-dark div:not(.elementor-widget-container):not(.elementor-column):not(.elementor-section):not(.elementor-element):not(.elementor-widget-wrap):not(.elementor-row):not(.elementor-container):not(.e-con):not(.e-con-inner) {
	color: #f5f5f5 !important;
}
html.morin-a11y-dark :is(a, a *) { color: #6cb4ff !important; }

html.morin-a11y-text-bigger,
html.morin-a11y-text-bigger body  { font-size: 120% !important; }
html.morin-a11y-text-smaller,
html.morin-a11y-text-smaller body { font-size: 85% !important; }

html.morin-a11y-readable-font,
html.morin-a11y-readable-font body,
html.morin-a11y-readable-font :is(p,h1,h2,h3,h4,h5,h6,li,span,div,label,th,td,figcaption,blockquote,a,button,input,textarea,select) {
	font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

html.morin-a11y-letter-space :is(p,h1,h2,h3,h4,h5,h6,li,span,div,label,th,td,figcaption,blockquote,a) {
	letter-spacing: .12em !important;
}
html.morin-a11y-line-space :is(p,h1,h2,h3,h4,h5,h6,li,span,div,label,th,td,figcaption,blockquote) {
	line-height: 1.8 !important;
}

html.morin-a11y-highlight-links a,
html.morin-a11y-highlight-links a * {
	background: #ffd400 !important;
	color: #111 !important;
	text-decoration: underline !important;
	box-shadow: 0 0 0 2px #111 inset;
}

html.morin-a11y-highlight-titles :is(h1,h2,h3,h4,h5,h6) {
	background: #ffd400 !important;
	color: #111 !important;
	padding: 2px 4px !important;
	box-shadow: 0 0 0 2px #111 inset;
}

html.morin-a11y-underline-links a {
	text-decoration: underline !important;
}

html.morin-a11y-pause-anim *,
html.morin-a11y-pause-anim *::before,
html.morin-a11y-pause-anim *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

html.morin-a11y-hide-images img,
html.morin-a11y-hide-images picture,
html.morin-a11y-hide-images video,
html.morin-a11y-hide-images svg:not(.morin-a11y-svg) {
	visibility: hidden !important;
}

/* Cursor SVGs are percent-encoded ('<','>','#','"' → %3C,%3E,%23,%22) so Firefox renders them.
   Firefox's data-URI parser rejects unencoded angle brackets even when single-quoted. */
html.morin-a11y-cursor-white,
html.morin-a11y-cursor-white *,
html.morin-a11y-cursor-white *::before,
html.morin-a11y-cursor-white *::after {
	cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpolygon%20points%3D%224%2C2%204%2C22%209%2C17%2013%2C23%2016%2C21%2012%2C15%2019%2C15%22%20fill%3D%22white%22%20stroke%3D%22black%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E") 4 2, auto !important;
}

html.morin-a11y-cursor-black,
html.morin-a11y-cursor-black *,
html.morin-a11y-cursor-black *::before,
html.morin-a11y-cursor-black *::after {
	cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpolygon%20points%3D%224%2C2%204%2C22%209%2C17%2013%2C23%2016%2C21%2012%2C15%2019%2C15%22%20fill%3D%22black%22%20stroke%3D%22white%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E") 4 2, auto !important;
}

/* link focus ring (admin opt-in) */
html.morin-a11y-link-focus a:focus,
html.morin-a11y-link-focus a:focus-visible,
html.morin-a11y-link-focus button:focus,
html.morin-a11y-link-focus button:focus-visible {
	outline: 3px solid #ffd400 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #111 inset !important;
}

@media (max-width: 480px) {
	.morin-a11y-panel { width: calc(100vw - 24px); }
	.morin-a11y-toggles { grid-template-columns: repeat(2, 1fr); }
}
