/*
 * ProSafe accessibility menu: the panel, the skip link, and what each toggle
 * does to the page. See assets/js/prosafe-a11y.js.
 *
 * The filters (grayscale) go on #wrapper, never on <html> or <body>: a filter
 * on an ancestor turns position:fixed into position:absolute, which would
 * break the fixed header, the WhatsApp button and this panel.
 */

/*
 * Visible keyboard focus, always (WCAG 2.4.7 via ת"י 5568). rtl.css removes
 * the outline from links and form fields (a:focus, input:focus{outline:none}),
 * so keyboard users could not see where they were except through main.min.js,
 * which injects a faint 1px light-blue `.tab_navigation a:focus` outline. The
 * `:root body` prefix outranks that rule. :focus-visible leaves mouse clicks
 * looking exactly as before.
 */
:root body a:focus-visible,
:root body button:focus-visible,
:root body input:focus-visible,
:root body select:focus-visible,
:root body textarea:focus-visible,
:root body [tabindex]:focus-visible {
	outline: 3px solid #f39c12 !important;
	outline-offset: 2px;
}

/* Skip link: off screen until it receives keyboard focus. */
.ps-skip-link {
	position: absolute;
	top: -100px;
	right: 16px;
	z-index: 100001;
	padding: 10px 16px;
	background: #10212e;
	color: #fff;
	font-size: 16px;
	text-decoration: underline;
}
.ps-skip-link:focus {
	top: 8px;
}
#ps-main:focus {
	outline: none;
}

/*
 * The header trigger, in the exact place the old one had: rtl.css positions
 * #a11y-menu-btn (far right edge of the header on desktop, beside the menu
 * button below 1000px). Those rules are repeated here for our own id rather
 * than reusing the old one, because iMark's main.min.js binds a click handler
 * to #a11y-menu-btn that looks for the removed iAccessibility menu.
 */
#ps-a11y-btn {
	position: absolute;
	right: 0;
	bottom: 1.41em;
	/* The old 1.76em (25px at 1280) was too small to spot; the owner asked
	   for it larger. Below 1000px it matches the menu button, unchanged. */
	width: 2.3em;
	height: 2.3em;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
#ps-a11y-btn svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
#ps-a11y-btn:hover .acc-bg,
#ps-a11y-btn:focus-visible .acc-bg {
	fill: #f7a92e !important;
}
.is-sticky-header #ps-a11y-btn {
	top: 0;
	bottom: 0;
	margin: auto 0;
}
@media (max-width: 1000px) {
	#ps-a11y-btn {
		top: 0;
		bottom: 0;
		margin: auto 0;
		width: 2.47em;
		height: 2.47em;
	}
}

/* Panel */
#ps-a11y-panel {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 100000;
	width: min(320px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 16px;
	background: #fff;
	color: #10212e;
	border: 2px solid #10212e;
	border-radius: 8px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
	font-family: Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	direction: rtl;
	text-align: right;
}
#ps-a11y-panel[hidden] {
	display: none;
}
#ps-a11y-panel button {
	font: inherit;
	cursor: pointer;
}
#ps-a11y-panel button:focus-visible,
#ps-a11y-panel a:focus-visible {
	outline: 3px solid #f39c12;
	outline-offset: 2px;
}
.ps-a11y-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.ps-a11y-head h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: inherit;
}
.ps-a11y-close {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #eef1f4;
	color: #10212e;
	font-size: 24px;
	line-height: 1;
}
.ps-a11y-size {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 12px;
}
.ps-a11y-size button {
	flex: 1;
	min-height: 44px;
	border: 2px solid #10212e;
	border-radius: 6px;
	background: #fff;
	color: #10212e;
	font-weight: 700;
}
.ps-a11y-size button:disabled {
	opacity: .4;
	cursor: default;
}
.ps-a11y-size span {
	min-width: 56px;
	text-align: center;
	font-weight: 700;
}
.ps-a11y-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.ps-a11y-list button {
	min-height: 52px;
	padding: 8px;
	border: 2px solid #c9d1d9;
	border-radius: 6px;
	background: #fff;
	color: #10212e;
}
.ps-a11y-list button[aria-pressed="true"] {
	border-color: #10212e;
	background: #10212e;
	color: #fff;
}
.ps-a11y-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #e3e7eb;
}
.ps-a11y-reset {
	padding: 8px 12px;
	border: 0;
	border-radius: 6px;
	background: #eef1f4;
	color: #10212e;
}
.ps-a11y-foot a {
	color: #10212e;
	text-decoration: underline;
}

/* Toggles. Each one leaves the panel itself alone (:not(#ps-a11y-panel *)). */

html.ps-a11y-gray #wrapper {
	filter: grayscale(1);
}

html.ps-a11y-contrast body,
html.ps-a11y-contrast #wrapper *:not(img):not(video):not(svg):not(svg *) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.ps-a11y-contrast #wrapper a,
html.ps-a11y-contrast #wrapper a * {
	color: #ff0 !important;
}
/* The logo is a dark-on-transparent image; give it its own light plate. */
html.ps-a11y-contrast #wrapper .top-logo img {
	background-color: #fff !important;
	border-radius: 4px;
}

html.ps-a11y-font #wrapper,
html.ps-a11y-font #wrapper *:not(svg):not(svg *) {
	font-family: Arial, Helvetica, sans-serif !important;
	letter-spacing: .01em !important;
}

html.ps-a11y-links #wrapper a {
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

html.ps-a11y-focus *:focus {
	outline: 3px solid #f39c12 !important;
	outline-offset: 2px !important;
}

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

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