/* ============================================================
   SAVAGEARS accessibility layer (loads on EVERY front-end page).
   Toolbar (תפריט נגישות) + skip link + global focus + user toggles.
   Brand colours fall back to literals so it also works on Flatsome pages
   where our design tokens aren't defined.
   ============================================================ */

/* ---- Skip to content ----
   ⚠️ Literals, not tokens. This one element was written with a fallback on the
   background but a bare var() on the text, and when the palette was remapped in
   2026-08 (--sg-accent became ink) it rendered ink on ink: a skip link that is
   invisible the moment a keyboard user reveals it. The whole point of this
   control is that it works when everything else has gone wrong, so it must not
   depend on a design token that a redesign is free to redefine. */
.sg-skip-link {
	position: fixed; top: -100px; inset-inline-start: 12px; z-index: 100000;
	background: #15151a !important; color: #ffffff !important; font-family: inherit;
	font-weight: 700; font-size: 15px; padding: 12px 18px; border-radius: 4px;
	text-decoration: none; transition: top .15s ease;
}
.sg-skip-link:focus { top: 12px; outline: 3px solid #ab1919; outline-offset: 2px; }

/* ---- Global visible keyboard focus (all pages, all elements) ---- */
:focus-visible {
	outline: 3px solid var(--sg-accent-ink, #7a5713) !important;
	outline-offset: 2px !important;
	border-radius: 3px;
}

/* ============================================================
   Toolbar widget
   ============================================================ */
#sg-a11y { position: fixed; z-index: 99990; bottom: 18px; inset-inline-start: 18px; font-family: "Heebo", Arial, sans-serif; line-height: 1.4; }

.sg-a11y-fab {
	width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(28,23,12,.2);
	background: var(--sg-accent, #e6b24c); color: var(--sg-on-accent); cursor: pointer;
	display: flex; align-items: center; justify-content: center; padding: 0;
	box-shadow: 0 10px 26px -8px rgba(56,46,22,.45); transition: transform .18s ease, box-shadow .18s ease;
}
.sg-a11y-fab:hover { transform: scale(1.06); }
.sg-a11y-fab:active { transform: scale(.96); }

/* DELIBERATELY DARK — not a leftover from the dark palette.
   The panel floats over whatever is behind it (including photographs), so it
   carries its own high-contrast ground instead of inheriting the page tokens.
   The contrast audit skips #sg-a11y for the same reason. */
.sg-a11y-panel {
	position: absolute; bottom: 62px; inset-inline-start: 0; width: 268px; max-width: calc(100vw - 36px);
	background: #14141a; color: #f5f4f0; border: 1px solid rgba(255,255,255,.16);
	border-radius: 16px; padding: 16px; box-shadow: 0 24px 60px -18px rgba(0,0,0,.85);
}
.sg-a11y-panel[hidden] { display: none; }

.sg-a11y-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.sg-a11y-title { font-weight: 800; font-size: 17px; }
.sg-a11y-close { background: none; border: none; color: #f5f4f0; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }

.sg-a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sg-a11y-btn {
	appearance: none; background: rgba(255,255,255,.05); color: #f5f4f0;
	border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 12px 8px;
	font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: center;
	min-height: 48px; transition: background .15s ease, border-color .15s ease;
}
.sg-a11y-btn:hover { background: rgba(230,178,76,.14); }
.sg-a11y-btn[aria-pressed="true"] { background: var(--sg-accent, #e6b24c); color: var(--sg-on-accent); border-color: var(--sg-accent, #e6b24c); }

.sg-a11y-reset {
	appearance: none; width: 100%; margin-top: 10px; background: none; color: var(--sg-accent, #e6b24c);
	border: 1px solid rgba(230,178,76,.4); border-radius: 10px; padding: 11px; font: inherit;
	font-size: 13.5px; font-weight: 700; cursor: pointer; min-height: 44px;
}
.sg-a11y-reset:hover { background: rgba(230,178,76,.1); }
.sg-a11y-statement { display: block; text-align: center; margin-top: 12px; color: #b9b8b3; font-size: 13px; text-decoration: underline; }

/* keep the toolbar usable even in the user's own modes */
#sg-a11y, #sg-a11y * { animation: none !important; }

/* ============================================================
   User accessibility modes (classes toggled on <html>)
   ============================================================ */

/* Text size — enlarge readable body copy (not the fixed nav/layout structure) */
html.sg-a11y-text-1 p, html.sg-a11y-text-1 li, html.sg-a11y-text-1 td, html.sg-a11y-text-1 dd,
html.sg-a11y-text-1 .sg-page-content, html.sg-a11y-text-1 figcaption, html.sg-a11y-text-1 label { font-size: 1.14em !important; line-height: 1.7 !important; }
html.sg-a11y-text-2 p, html.sg-a11y-text-2 li, html.sg-a11y-text-2 td, html.sg-a11y-text-2 dd,
html.sg-a11y-text-2 .sg-page-content, html.sg-a11y-text-2 figcaption, html.sg-a11y-text-2 label { font-size: 1.28em !important; line-height: 1.75 !important; }
html.sg-a11y-text-3 p, html.sg-a11y-text-3 li, html.sg-a11y-text-3 td, html.sg-a11y-text-3 dd,
html.sg-a11y-text-3 .sg-page-content, html.sg-a11y-text-3 figcaption, html.sg-a11y-text-3 label { font-size: 1.42em !important; line-height: 1.8 !important; }

/* High contrast — force black/white/yellow (widget itself excluded) */
html.sg-a11y-contrast body :not(#sg-a11y):not(#sg-a11y *) {
	background-color: #000 !important; color: #fff !important; border-color: #fff !important;
	text-shadow: none !important; box-shadow: none !important;
}
html.sg-a11y-contrast body { background: #000 !important; }
html.sg-a11y-contrast a:not(.sg-a11y-btn):not(.sg-a11y-reset):not(.sg-a11y-statement) { color: #ffff00 !important; text-decoration: underline !important; }
html.sg-a11y-contrast button:not([data-a11y]):not(.sg-a11y-close):not(.sg-a11y-fab) { outline: 1px solid #fff !important; }

/* Grayscale */
html.sg-a11y-grayscale body { filter: grayscale(100%); }

/* Highlight links */
html.sg-a11y-links a:not(.sg-a11y-btn):not(.sg-a11y-reset):not(.sg-a11y-statement) {
	text-decoration: underline !important; text-underline-offset: 2px;
	outline: 1px dashed currentColor; outline-offset: 2px;
}

/* Readable font + comfortable spacing */
html.sg-a11y-readable body :not(#sg-a11y):not(#sg-a11y *) {
	font-family: Arial, "Helvetica Neue", "Segoe UI", sans-serif !important;
	letter-spacing: normal !important; word-spacing: .05em !important;
}
html.sg-a11y-readable p, html.sg-a11y-readable li { line-height: 1.8 !important; }

/* Stop animations / motion (also honours the OS setting below) */
html.sg-a11y-nomotion *:not(#sg-a11y):not(#sg-a11y *),
html.sg-a11y-nomotion *::before, html.sg-a11y-nomotion *::after {
	animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

/* Respect the OS "reduce motion" preference site-wide */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- mobile ---- */
@media (max-width: 600px) {
	#sg-a11y { bottom: 14px; inset-inline-start: 14px; }
	.sg-a11y-fab { width: 48px; height: 48px; }
}
