/* רדיו על הגל – accessibility layer: skip link, landmark, toolbar, theme toggle, focus rings, reduced motion, display
   modes, cookie banner. Tokens come from the child theme (base.css); dark mode is the tokens flipping under
   html[data-theme="dark"], so there is no dark layer here. Mobile breakpoint 767px. Loaded last so its mode rules win. */

/* ---------- Skip link + landmark ---------- */
.ah-skip-link:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ah-skip-link:focus {
	position: fixed; top: 8px; inset-inline-start: 8px; z-index: 100000; padding: 12px 20px; border-radius: var(--r-pill, 999px);
	background: var(--ink); color: var(--paper); font-family: var(--font-body); font-weight: 800; font-size: 16px; text-decoration: none;
	outline: 2px solid var(--teal); outline-offset: 2px;
}
#content.ah-main { display: block; outline: 0; scroll-margin-top: calc(var(--header-h, 76px) + 12px); }

/* ---------- Trigger (44px circle like the header's other buttons) ---------- */
.ah-a11y-trigger {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto;
	width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: 0;
	border: 1px solid var(--line); border-radius: var(--r-pill, 999px); background: var(--surface); color: var(--ink);
	font-family: var(--font-body); font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; white-space: nowrap;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ah-a11y-trigger:hover, .ah-a11y-trigger:focus-visible, .ah-a11y-trigger[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ah-a11y-icon { flex: 0 0 auto; width: 22px; height: 22px; }
/* Header: icon only, the label stays for screen readers. */
.ah-a11y-trigger--header .ah-a11y-trigger__label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Inside the overlay menu ([data-ah-a11y-slot]): a full-width row with the visible label. */
.ah-a11y-trigger--panel { width: 100%; height: auto; min-height: 52px; justify-content: flex-start; padding: 14px 16px; border-radius: var(--r-input, 14px); font-size: 18px; }
/* A standalone trigger widget stays compact (matches only a widget whose shortcode output IS the trigger). */
.elementor-location-header .elementor-widget-shortcode:has(> .elementor-shortcode > .ah-a11y-trigger--header) { flex: 0 0 auto; width: auto; max-width: none; }

/* ---------- Theme toggle ([alhagal_theme_toggle]: 44px pill, surface bg, line border; site.css may refine it) ---------- */
.ah-theme-toggle {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto;
	height: 44px; min-width: 44px; padding: 0 14px; margin: 0;
	border: 1px solid var(--line); border-radius: var(--r-pill, 999px); background: var(--surface); color: var(--ink);
	font-family: var(--font-body); font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ah-theme-toggle:hover, .ah-theme-toggle:focus-visible { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ah-theme-toggle__glyph { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; }
.ah-theme-toggle__glyph .ah-ico { width: 18px; height: 18px; }
.ah-theme-toggle .ah-ico--sun { display: none; }
html[data-theme="dark"] .ah-theme-toggle .ah-ico--sun { display: block; }
html[data-theme="dark"] .ah-theme-toggle .ah-ico--moon { display: none; }
.ah-theme-toggle--icon { width: 44px; padding: 0; }
.ah-theme-toggle--icon .ah-theme-toggle__label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Panel (dialog) ---------- */
.ah-a11y-panel {
	position: fixed; z-index: 100001; top: calc(var(--header-h, 76px) + 8px); inset-inline-end: max(16px, calc((100vw - var(--container, 1240px)) / 2));
	width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow-y: auto; box-sizing: border-box;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: var(--r-card, 28px);
	box-shadow: var(--shadow-big, 0 24px 48px -28px rgba(6, 60, 66, .7));
	padding: 20px 20px 16px; font-family: var(--font-body); font-size: 16px; line-height: 1.4; direction: rtl; text-align: start;
}
.ah-a11y-panel[hidden] { display: none; }
.ah-a11y-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ah-a11y-panel__title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; color: var(--ink); }
.ah-a11y-close {
	display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; flex: 0 0 auto;
	border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.ah-a11y-close .ah-ico { width: 20px; height: 20px; }
.ah-a11y-close:hover, .ah-a11y-close:focus-visible { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ah-a11y-group { margin: 0 0 12px; }
.ah-a11y-group__label { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--muted); }
.ah-a11y-size { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ah-a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ah-a11y-panel .ah-a11y-btn {
	display: flex; align-items: center; gap: 8px; min-height: 48px; width: 100%; padding: 8px 12px; box-sizing: border-box; margin: 0;
	border: 1px solid var(--line); border-radius: var(--r-input, 14px); background: var(--paper); color: var(--ink);
	font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1.3; text-align: start; cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.ah-a11y-panel .ah-a11y-btn:hover { border-color: var(--ink); background: var(--sand); color: var(--ink); }
.ah-a11y-panel .ah-a11y-btn[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: var(--on-accent); }
.ah-a11y-btn--size { justify-content: center; flex-direction: column; gap: 0; }
.ah-a11y-size__a { font-family: var(--font-display); font-weight: 700; line-height: 1.1; }
.ah-a11y-size__a--0 { font-size: 18px; } .ah-a11y-size__a--1 { font-size: 23px; } .ah-a11y-size__a--2 { font-size: 28px; }
.ah-a11y-size__pct { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ah-a11y-btn__box { flex: 0 0 auto; width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 5px; position: relative; }
.ah-a11y-btn[aria-pressed="true"] .ah-a11y-btn__box::after {
	content: ""; position: absolute; inset: 2px 4px 5px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.ah-a11y-panel .ah-a11y-btn--reset { justify-content: center; background: transparent; border-style: dashed; }
.ah-a11y-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 12px 0 0; font-size: 15px; }
.ah-a11y-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal-ink); text-decoration: underline; text-underline-offset: 3px; }
.ah-a11y-links a:hover { color: var(--ink); }
.ah-a11y-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; margin: 0; }
@media (max-width: 767px) {
	.ah-a11y-panel { top: auto !important; bottom: 0; inset-inline: 0; left: 0 !important; right: 0 !important; width: auto; max-height: 85vh; border-radius: var(--r-card, 28px) var(--r-card, 28px) 0 0; border-bottom: 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* ---------- Focus rings (2px teal, offset 2px; stronger than Elementor's resets) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [role="button"]:focus-visible, [role="slider"]:focus-visible, [tabindex]:not([tabindex="-1"]):focus-visible {
	outline: 2px solid var(--teal) !important; outline-offset: 2px !important;
}

/* ---------- Reduced motion (OS setting) and "עצירת אנימציות" (toolbar) ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html.a11y-motion { scroll-behavior: auto !important; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after {
	animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

/* ---------- Text size (zoom: Elementor atomic styles are in px) ---------- */
html.a11y-size-1 { zoom: 1.15; }
html.a11y-size-2 { zoom: 1.3; }
/* Turnstile renders a fixed 300px iframe: undo the zoom so it still fits a 390px phone. */
html.a11y-size-1 .cf-turnstile { zoom: .87; }
html.a11y-size-2 .cf-turnstile { zoom: .77; }
/* The toolbar and the cookie banner keep their own (already large) size at every step so they always fit a phone. */
html.a11y-size-1 .ah-a11y-panel, html.a11y-size-1 .ah-cookie { zoom: .87; }
html.a11y-size-2 .ah-a11y-panel, html.a11y-size-2 .ah-cookie { zoom: .77; }
/* zoom on html does not change what media queries see: the header repeats its 1080px rules at 1242px / 1404px for
   html.a11y-size-1 / -2 in site.css. */

/* ---------- Highlight links ---------- */
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 2px !important; outline: 2px dashed currentColor; outline-offset: 2px; }

/* ---------- Readable font ---------- */
html.a11y-font body, html.a11y-font body *:not(svg):not(svg *) {
	font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif !important; letter-spacing: .02em !important; word-spacing: .08em !important;
}

/* ---------- Larger cursor (data URIs cannot read tokens: ink #121616 / teal #00C2CC on a paper outline) ---------- */
html.a11y-cursor, html.a11y-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M4 3l26 13-11 3-5 11z' fill='%23121616' stroke='%23F5F0E6' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto !important;
}
html.a11y-cursor a, html.a11y-cursor a *, html.a11y-cursor button, html.a11y-cursor button *, html.a11y-cursor [role="button"], html.a11y-cursor label, html.a11y-cursor summary {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M4 3l26 13-11 3-5 11z' fill='%2300C2CC' stroke='%23121616' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, pointer !important;
}

/* ---------- High contrast (screen only; print is always dark text on white) ----------
   Everything is drawn from the tokens, so the mode mostly re-points them: pure black ink on pure white paper, teal text
   darkened to AA, lines black. Images untouched. Beats html[data-theme="dark"] by order (this sheet loads last) and by
   the doubled selector. */
@media screen {
	html.a11y-contrast, html.a11y-contrast[data-theme="dark"] {
		--paper: #fff; --surface: #fff; --foam: #fff; --sand: #fff;
		--ink: #000; --muted: #000; --line: #000;
		--teal-ink: #004D53; --deep: #004D53;
		--tile-ink: #000; --footer-text: #fff; --footer-muted: #fff;
		--shadow-cover: none; --shadow-big: none; --shadow-play: none;
		color-scheme: light;
	}
	html.a11y-contrast body { background: #fff; color: #000; }
	html.a11y-contrast body a:not(.ah-btn):not(.ah-play) { text-decoration: underline; }
	html.a11y-contrast body :is(button, .ah-btn, input, select, textarea, .ah-a11y-trigger, .ah-theme-toggle) { border-width: 2px; border-style: solid; border-color: #000; }
	html.a11y-contrast body :is(button, .ah-btn)[aria-pressed="true"]:not(.ah-a11y-btn) { outline: 3px solid #000; outline-offset: -3px; }
	html.a11y-contrast .elementor-location-header { border-bottom: 2px solid #000 !important; }
	html.a11y-contrast img { filter: none !important; }
}

/* ---------- Cookie banner (inc/privacy.php): bottom-start toast ---------- */
.ah-cookie {
	position: fixed; z-index: 100002; bottom: 16px; inset-inline-start: 16px; box-sizing: border-box;
	width: calc(100vw - 32px); max-width: 520px; padding: 18px 20px;
	background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px;
	box-shadow: var(--shadow-big, 0 24px 48px -28px rgba(6, 60, 66, .7));
	font-family: var(--font-body); font-size: 15px; line-height: 1.5; direction: rtl; text-align: start;
}
.ah-cookie[hidden] { display: none; }
.ah-cookie p { margin: 0 0 12px; }
.ah-cookie a { color: var(--teal-ink); text-decoration: underline; text-underline-offset: 3px; }
.ah-cookie a:hover { color: var(--ink); }
.ah-cookie__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ah-cookie__btn {
	display: inline-flex; align-items: center; justify-content: center; flex: 1 1 150px; min-height: 44px; padding: 0 18px; margin: 0;
	border: 1px solid var(--ink); border-radius: var(--r-pill, 999px); background: var(--ink); color: var(--paper);
	font-family: var(--font-body); font-size: 15px; font-weight: 800; line-height: 1; cursor: pointer; white-space: nowrap;
	transition: background-color .15s ease, color .15s ease;
}
.ah-cookie__btn--reject { background: transparent; color: var(--ink); border-color: var(--line); }
.ah-cookie__btn:hover, .ah-cookie__btn:focus-visible { background: var(--teal); color: var(--on-accent); border-color: var(--teal); }
@media (max-width: 767px) {
	.ah-cookie { bottom: 0; inset-inline: 0; width: auto; max-width: none; border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
/* "הגדרות עוגיות" link-button ([alhagal_cookie_settings], footer) */
.ah-link-btn {
	display: inline; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
	text-decoration: underline; text-underline-offset: 3px;
}
.ah-link-btn:hover { color: var(--teal); }
/* Consent notice injected above the submit button of Elementor forms lacking an acceptance field */
.ah-consent-notice { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ah-consent-notice a { color: var(--teal-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Print ---------- */
@media print {
	.ah-skip-link, .ah-a11y-trigger, .ah-a11y-panel, .ah-theme-toggle, .ah-cookie { display: none !important; }
	html { zoom: 1 !important; }
}
