/* ==========================================================================
   Alors נגישות – toolbar
   Every widget rule is scoped under #alors-a11y so theme and Elementor
   button styles don't leak in. Sizes are in px so the widget stays stable
   when the visitor enlarges the site text.
   ========================================================================== */

#alors-a11y {
	--aa-color: #1b3a5c;
	--aa-offset: 24px;
	--aa-ink: #1a1f24;
	--aa-muted: #5b6570;
	--aa-line: #d3d8de;
	--aa-surface: #ffffff;
	--aa-soft: #f2f4f6;
	position: fixed;
	z-index: 2147483000;
	font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: var(--aa-ink);
	direction: rtl;
	text-align: right;
}

#alors-a11y,
#alors-a11y *,
#alors-a11y *::before,
#alors-a11y *::after {
	box-sizing: border-box;
}

/* Positions ----------------------------------------------------------- */
#alors-a11y.aa-pos-bottom-left  { left: 16px;  bottom: var(--aa-offset); }
#alors-a11y.aa-pos-bottom-right { right: 16px; bottom: var(--aa-offset); }
#alors-a11y.aa-pos-middle-left  { left: 0;  top: 50%; transform: translateY(-50%); }
#alors-a11y.aa-pos-middle-right { right: 0; top: 50%; transform: translateY(-50%); }

/* Screen-reader-only text --------------------------------------------- */
#alors-a11y .aa-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Button reset -------------------------------------------------------- */
#alors-a11y button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	min-height: 44px;
}

#alors-a11y button:focus { outline: none; }

#alors-a11y button:focus-visible,
#alors-a11y a:focus-visible {
	outline: 3px solid #111 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #fff !important;
}

/* Trigger button ------------------------------------------------------ */
#alors-a11y .aa-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--aa-color);
	color: #fff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}

#alors-a11y.aa-pos-middle-left .aa-toggle  { border-radius: 0 12px 12px 0; border-left: 0; }
#alors-a11y.aa-pos-middle-right .aa-toggle { border-radius: 12px 0 0 12px; border-right: 0; }

#alors-a11y .aa-toggle:hover { filter: brightness(1.15); }

#alors-a11y .aa-toggle svg {
	width: 32px;
	height: 32px;
	fill: currentColor;
}

/* Panel --------------------------------------------------------------- */
#alors-a11y .aa-panel {
	position: fixed;
	width: 340px;
	max-width: calc(100vw - 24px);
	/* Room left on screen: 12px gap at the top, plus the button area
	   below the panel. dvh follows the mobile address bar; vh is the fallback. */
	--aa-panel-reserved: calc(var(--aa-offset) + 66px + 12px);
	max-height: calc(100vh - var(--aa-panel-reserved));
	max-height: calc(100dvh - var(--aa-panel-reserved));
	display: flex;
	flex-direction: column;
	background: var(--aa-surface);
	border: 1px solid var(--aa-line);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
	overflow: hidden;
}

#alors-a11y .aa-panel[hidden] { display: none; }

#alors-a11y.aa-pos-bottom-left  .aa-panel { left: 16px;  bottom: calc(var(--aa-offset) + 66px); }
#alors-a11y.aa-pos-bottom-right .aa-panel { right: 16px; bottom: calc(var(--aa-offset) + 66px); }
#alors-a11y.aa-pos-middle-left  .aa-panel { left: 64px;  top: 50%; transform: translateY(-50%); --aa-panel-reserved: 24px; }
#alors-a11y.aa-pos-middle-right .aa-panel { right: 64px; top: 50%; transform: translateY(-50%); --aa-panel-reserved: 24px; }

#alors-a11y .aa-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 16px 8px 8px;
	background: var(--aa-color);
	color: #fff;
}

#alors-a11y .aa-title {
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	letter-spacing: normal;
	text-transform: none;
}

#alors-a11y .aa-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
}

#alors-a11y .aa-close:hover { background: rgba(255, 255, 255, .15); }
#alors-a11y .aa-close svg { width: 22px; height: 22px; fill: currentColor; }

#alors-a11y .aa-body {
	padding: 14px;
	overflow-y: auto;
}

/* Font size row */
#alors-a11y .aa-font {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 6px 6px 12px;
	margin-bottom: 12px;
	background: var(--aa-soft);
	border-radius: 10px;
}

#alors-a11y .aa-font-label { font-weight: 600; }

#alors-a11y .aa-font-controls {
	display: flex;
	align-items: center;
	gap: 4px;
}

#alors-a11y .aa-step {
	width: 44px;
	padding: 0;
	border: 1px solid var(--aa-line);
	border-radius: 8px;
	background: #fff;
	color: var(--aa-ink);
	font-weight: 700;
}

#alors-a11y .aa-step:hover { border-color: var(--aa-color); }

#alors-a11y .aa-step[aria-disabled="true"] {
	opacity: .45;
	cursor: not-allowed;
}

#alors-a11y .aa-font-value {
	min-width: 52px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	direction: ltr;
}

/* Options grid */
#alors-a11y .aa-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

#alors-a11y .aa-option {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--aa-line);
	border-radius: 10px;
	background: #fff;
	color: var(--aa-ink);
	text-align: right;
	font-size: 14px;
}

#alors-a11y .aa-option:hover { border-color: var(--aa-color); }

#alors-a11y .aa-option-mark {
	flex: 0 0 auto;
	position: relative;
	width: 18px;
	height: 18px;
	border: 2px solid var(--aa-muted);
	border-radius: 50%;
}

#alors-a11y .aa-option[aria-pressed="true"] {
	background: var(--aa-color);
	border-color: var(--aa-color);
	color: #fff;
}

#alors-a11y .aa-option[aria-pressed="true"] .aa-option-mark {
	border-color: #fff;
	background: #fff;
}

#alors-a11y .aa-option[aria-pressed="true"] .aa-option-mark::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 5px;
	width: 4px;
	height: 8px;
	border: solid var(--aa-color);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Footer */
#alors-a11y .aa-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 14px 10px;
	border-top: 1px solid var(--aa-line);
}

#alors-a11y .aa-reset {
	padding: 0 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--aa-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

#alors-a11y .aa-reset:hover { background: var(--aa-soft); }

#alors-a11y .aa-statement {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 4px;
	color: var(--aa-color);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Mobile -------------------------------------------------------------- */
@media (max-width: 480px) {
	#alors-a11y.aa-hide-mobile { display: none; }

	/* Bottom positions: full width, still above the button. */
	#alors-a11y.aa-pos-bottom-left .aa-panel,
	#alors-a11y.aa-pos-bottom-right .aa-panel {
		left: 12px;
		right: 12px;
		width: auto;
		max-width: none;
	}

	/* Middle positions: full width, anchored to the bottom of the screen. */
	#alors-a11y.aa-pos-middle-left .aa-panel,
	#alors-a11y.aa-pos-middle-right .aa-panel {
		left: 12px;
		right: 12px;
		top: auto;
		bottom: 12px;
		width: auto;
		max-width: none;
		transform: none;
		--aa-panel-reserved: 24px;
	}

	#alors-a11y .aa-toggle { width: 50px; height: 50px; }
}

/* Low screens (phone in landscape): tighter spacing, touch targets stay 44px. */
@media (max-height: 450px) {
	#alors-a11y .aa-head { padding-block: 2px; }
	#alors-a11y .aa-body { padding-block: 8px; }
	#alors-a11y .aa-font { margin-bottom: 8px; padding-block: 2px; }
	#alors-a11y .aa-grid { gap: 6px; }
	#alors-a11y .aa-panel button { min-height: 44px; padding-block: 6px; }
	#alors-a11y .aa-foot { padding-block: 2px 4px; }
}

/* ==========================================================================
   Visitor adjustments (classes on <html>)
   The toolbar itself is excluded so it stays usable in every mode.
   ========================================================================== */

/* Dark contrast */
html.aa-contrast-dark body,
html.aa-contrast-dark body *:not(#alors-a11y):not(#alors-a11y *) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.aa-contrast-dark body a:not(#alors-a11y):not(#alors-a11y *),
html.aa-contrast-dark body a:not(#alors-a11y):not(#alors-a11y *) * {
	color: #ffe14d !important;
}
html.aa-contrast-dark body svg:not(#alors-a11y svg) { fill: currentColor; }

/* Light contrast */
html.aa-contrast-light body,
html.aa-contrast-light body *:not(#alors-a11y):not(#alors-a11y *) {
	background-color: #fff !important;
	background-image: none !important;
	color: #000 !important;
	border-color: #000 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.aa-contrast-light body a:not(#alors-a11y):not(#alors-a11y *),
html.aa-contrast-light body a:not(#alors-a11y):not(#alors-a11y *) * {
	color: #0a3d91 !important;
}

/* Grayscale – on <html> so fixed headers keep working */
html.aa-grayscale { filter: grayscale(1); }

/* Highlight links */
html.aa-links body a:not(#alors-a11y *) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
	outline: 2px dashed currentColor !important;
	outline-offset: 2px !important;
}

/* Highlight headings */
html.aa-headings body :is(h1, h2, h3, h4, h5, h6):not(#alors-a11y *) {
	outline: 2px solid currentColor !important;
	outline-offset: 4px !important;
}

/* Readable font – icon fonts are left alone so icons don't break */
html.aa-readable-font body *:not(#alors-a11y):not(#alors-a11y *):not(i):not(svg):not(svg *):not([class*="icon"]):not([class*="fa-"]):not([class^="fa"]):not(.dashicons) {
	font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

/* Text spacing – WCAG 1.4.12 values */
html.aa-spacing body *:not(#alors-a11y):not(#alors-a11y *) {
	line-height: 1.6 !important;
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}
html.aa-spacing body p:not(#alors-a11y *) {
	margin-bottom: 2em !important;
}

/* Stop animations */
html.aa-stop-motion *,
html.aa-stop-motion *::before,
html.aa-stop-motion *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* Big cursor */
html.aa-big-cursor,
html.aa-big-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M4 2l30 26H19l9 14-6 2-9-14-9 9z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important;
}
html.aa-big-cursor a,
html.aa-big-cursor a *,
html.aa-big-cursor button,
html.aa-big-cursor button *,
html.aa-big-cursor [role="button"] {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M4 2l30 26H19l9 14-6 2-9-14-9 9z' fill='%23fff' stroke='%23000' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, pointer !important;
}

/* Strong focus for every focus, not only keyboard */
html.aa-focus *:focus {
	outline: 3px solid #ffbf00 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px #000 !important;
}

@media (prefers-reduced-motion: reduce) {
	#alors-a11y * { transition: none !important; }
}
