/**
 * נגישות ישראל - גיליון סגנונות
 * שני חלקים: (1) ממשק הסרגל   (2) מחלקות שינוי המוחלות על האתר (acc-*)
 */

/* ============================================================
 * 1. קישור "דלג לתוכן"
 * ============================================================ */
.isa11y-skip-link {
	position: absolute;
	right: -9999px;
	top: 0;
	z-index: 2147483647;
	background: #1a4f8b;
	color: #fff;
	padding: 12px 20px;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 0 0 6px 6px;
}
.isa11y-skip-link:focus {
	right: 50%;
	transform: translateX(50%);
	outline: 3px solid #ffbf00;
}

/* ============================================================
 * 2. ממשק סרגל הנגישות (scoped תחת #isa11y)
 * ============================================================ */
#isa11y,
#isa11y * {
	box-sizing: border-box;
	font-family: "Heebo", "Assistant", Arial, sans-serif;
}

.isa11y {
	--isa11y-btn-color: #1a4f8b;
	--isa11y-icon-color: #ffffff;
	position: fixed;
	bottom: 20px;
	z-index: 2147483000;
	direction: rtl;
}
.isa11y--right { right: 20px; }
.isa11y--left  { left: 20px; }

/* כפתור הפתיחה */
.isa11y-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.85);
	background: var(--isa11y-btn-color);
	color: var(--isa11y-icon-color);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	padding: 0;
}
.isa11y--small .isa11y-toggle  { width: 46px; height: 46px; }
.isa11y--large .isa11y-toggle  { width: 66px; height: 66px; }
.isa11y-toggle:hover { transform: scale(1.08); }
.isa11y-toggle:focus-visible {
	outline: 3px solid #ffbf00;
	outline-offset: 3px;
}
.isa11y-icon { display: block; }

/* החלונית */
.isa11y-panel {
	position: fixed;
	bottom: 88px;
	width: 360px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 120px);
	background: #ffffff;
	color: #1a1a1a;
	border-radius: 12px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #d0d7de;
}
.isa11y--right .isa11y-panel { right: 20px; }
.isa11y--left  .isa11y-panel { left: 20px; }
.isa11y-panel[hidden] { display: none; }

.isa11y-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--isa11y-btn-color);
	color: #fff;
	padding: 14px 16px;
}
.isa11y-panel__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #fff;
}
.isa11y-panel__close {
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	display: flex;
}
.isa11y-panel__close:hover { background: rgba(255, 255, 255, 0.2); }
.isa11y-panel__close:focus-visible { outline: 2px solid #ffbf00; }

.isa11y-panel__body {
	padding: 12px 14px;
	overflow-y: auto;
}

.isa11y-group {
	border: 1px solid #e2e6ea;
	border-radius: 10px;
	margin: 0 0 12px;
	padding: 8px 10px 12px;
}
.isa11y-group__title {
	font-size: 13px;
	font-weight: 700;
	color: #555;
	padding: 0 4px;
}

.isa11y-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 8px;
}

.isa11y-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 72px;
	padding: 8px 6px;
	background: #f4f6f8;
	border: 2px solid #e2e6ea;
	border-radius: 8px;
	cursor: pointer;
	text-align: center;
	color: #1a1a1a;
	transition: background 0.12s ease, border-color 0.12s ease;
}
.isa11y-btn:hover { background: #e9eef3; }
.isa11y-btn:focus-visible {
	outline: 3px solid #ffbf00;
	outline-offset: 2px;
}
.isa11y-btn[aria-pressed="true"] {
	background: var(--isa11y-btn-color);
	border-color: var(--isa11y-btn-color);
	color: #fff;
}
.isa11y-btn__ico { font-size: 20px; font-weight: 700; line-height: 1; }
.isa11y-btn__txt { font-size: 12.5px; font-weight: 600; }

.isa11y-panel__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	border-top: 1px solid #e2e6ea;
	background: #fafbfc;
}
.isa11y-reset {
	flex: 1;
	background: #c0392b;
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 10px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
}
.isa11y-reset:hover { background: #a93226; }
.isa11y-reset:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }
.isa11y-statement-link {
	font-size: 13px;
	font-weight: 600;
	color: var(--isa11y-btn-color);
	text-decoration: underline;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.isa11y-panel { width: calc(100vw - 24px); bottom: 80px; }
	.isa11y--right .isa11y-panel,
	.isa11y--left  .isa11y-panel { right: 12px; left: 12px; }
}

/* ============================================================
 * 3. מחלקות שינוי - מוחלות על <html> דרך JS
 * ============================================================ */

/* גודל טקסט - דרך משתנה CSS על האלמנט הראשי */
html.acc-text-scale body :where(p, li, span, a, h1, h2, h3, h4, h5, h6, label, button, input, td, th, dd, dt, blockquote, figcaption) {
	font-size: calc(1em * var(--acc-text-scale, 1)) !important;
}

/* גופן קריא */
html.acc-readable-font,
html.acc-readable-font body,
html.acc-readable-font body * {
	font-family: "Arial", "Tahoma", "Heebo", sans-serif !important;
	letter-spacing: 0.02em;
}

/* מרווח שורות */
html.acc-line-height body :where(p, li, div, span, a, td) {
	line-height: 2 !important;
}

/* מרווח אותיות */
html.acc-letter-spacing body :where(p, li, span, a, h1, h2, h3, h4, h5, h6) {
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}

/* הדגשת כותרות */
html.acc-highlight-titles body :where(h1, h2, h3, h4, h5, h6) {
	outline: 2px dashed #1a4f8b !important;
	outline-offset: 3px;
	background: #fff7d6 !important;
	color: #111 !important;
}

/* ניגודיות גבוהה (שחור/צהוב) */
html.acc-contrast body,
html.acc-contrast body :where(div, section, article, header, footer, main, aside, nav, p, span, li, td, th) {
	background-color: #000 !important;
	color: #ffff00 !important;
}
html.acc-contrast body :where(a, a *) { color: #00ffff !important; }
html.acc-contrast body :where(h1, h2, h3, h4, h5, h6) { color: #fff !important; }
html.acc-contrast body :where(img, video) { filter: grayscale(0); }

/* ניגודיות כהה */
html.acc-dark body,
html.acc-dark body :where(div, section, article, header, footer, main, aside, nav, p, span, li, td, th) {
	background-color: #1a1a1a !important;
	color: #e8e8e8 !important;
}
html.acc-dark body :where(a, a *) { color: #4ea1ff !important; }

/* ניגודיות בהירה */
html.acc-light body,
html.acc-light body :where(div, section, article, header, footer, main, aside, nav, p, span, li, td, th) {
	background-color: #ffffff !important;
	color: #1a1a1a !important;
}
html.acc-light body :where(a, a *) { color: #0a58ca !important; }

/* גווני אפור */
html.acc-grayscale {
	filter: grayscale(100%) !important;
	-webkit-filter: grayscale(100%) !important;
}

/* היפוך צבעים */
html.acc-invert {
	filter: invert(100%) hue-rotate(180deg) !important;
	-webkit-filter: invert(100%) hue-rotate(180deg) !important;
}
html.acc-invert img,
html.acc-invert video,
html.acc-invert iframe {
	filter: invert(100%) hue-rotate(180deg) !important;
}

/* הדגשת קישורים */
html.acc-highlight-links body a {
	text-decoration: underline !important;
	font-weight: 700 !important;
	background: #ffff00 !important;
	color: #000 !important;
	outline: 1px solid #000 !important;
	padding: 0 2px;
}

/* יישור לימין */
html.acc-align-right body :where(p, li, h1, h2, h3, h4, h5, h6, div) {
	text-align: right !important;
}

/* סמן גדול */
html.acc-big-cursor,
html.acc-big-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1' d='M5 3l14 8-6 1 3 6-2 1-3-6-4 4z'/%3E%3C/svg%3E"), auto !important;
}

/* עצירת אנימציות */
html.acc-stop-animations *,
html.acc-stop-animations *::before,
html.acc-stop-animations *::after {
	animation-duration: 0s !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0s !important;
	scroll-behavior: auto !important;
}

/* הדגשת מיקוד מוגברת לניווט מקלדת */
html.acc-keyboard-nav a:focus,
html.acc-keyboard-nav button:focus,
html.acc-keyboard-nav input:focus,
html.acc-keyboard-nav select:focus,
html.acc-keyboard-nav textarea:focus,
html.acc-keyboard-nav [tabindex]:focus {
	outline: 4px solid #ffbf00 !important;
	outline-offset: 2px !important;
	background: rgba(255, 191, 0, 0.18) !important;
}

/* קו עזר לקריאה */
.isa11y-reading-guide {
	position: fixed;
	left: 0;
	right: 0;
	height: 14px;
	background: rgba(255, 191, 0, 0.45);
	border-top: 2px solid #c0392b;
	border-bottom: 2px solid #c0392b;
	pointer-events: none;
	z-index: 2147483646;
}
.isa11y-reading-guide[hidden] { display: none; }

/* מסכת קריאה */
.isa11y-reading-mask {
	position: fixed;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.55);
	pointer-events: none;
	z-index: 2147483645;
}
.isa11y-reading-mask--top { top: 0; }
.isa11y-reading-mask--bottom { bottom: 0; }
.isa11y-reading-mask[hidden] { display: none; }

/* כיבוד העדפת המשתמש במערכת ההפעלה */
@media (prefers-reduced-motion: reduce) {
	.isa11y-toggle { transition: none; }
}
