/*!
 * BINO – אפשרויות תצוגה 0.1.4 (גרסת בדיקה)
 * Local stylesheet. No external fonts or assets.
 * Scope (0.1.1): display modes apply only when <html> has "bino-do-ready" (set by the
 * script after the controls exist) and only inside .bino-do-scope (the site content
 * roots marked by the script) or .bino-do-ui (the controls). The WordPress admin bar
 * is never marked, and the focus ring excludes it.
 * Mode switching (0.1.2): section 7 turns transitions off only while a mode changes.
 * Colours: navy #0E1A2B, white #FFFFFF, champagne #C8AF7A (hover only).
 */

/* ---------- 1. Baseline: visible keyboard focus on light and dark backgrounds ----------
   Two-tone indicator: a 3px navy outline with a white halo around it, so at least
   one band contrasts with any page colour (navy on light, white on dark). */
:is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible:not(#wpadminbar *) {
	outline: 3px solid #0E1A2B !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 8px #FFFFFF !important;
}

/* ---------- 2. Toggle button, placed in the existing top row ---------- */
.bino-do-host {
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	gap: 8px;
}

.bino-do {
	margin-inline-start: auto;
	flex: 0 0 auto;
}

#bino-do-toggle.bino-do__toggle {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	border: 2px solid #0E1A2B;
	border-radius: 0;
	background: #0E1A2B;
	color: #FFFFFF;
	font-family: "Heebo", Arial, sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
}

#bino-do-toggle.bino-do__toggle:hover,
#bino-do-toggle.bino-do__toggle[aria-expanded="true"] {
	background: #C8AF7A;
	color: #0E1A2B;
}

/* ---------- 3. Non-modal panel, in the page flow under the top row ---------- */
.bino-do-panelwrap {
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 4px 24px 12px;
	background: #FEFEFE;
}

.bino-do-panelwrap[hidden] {
	display: none !important;
}

#bino-do-panel .bino-do__panel {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 360px;
	margin-inline-start: auto;
	padding: 16px;
	border: 1px solid #0E1A2B;
	background: #FFFFFF;
	color: #0E1A2B;
	font-family: "Heebo", Arial, sans-serif;
	text-align: start;
}

#bino-do-panel .bino-do__opt,
#bino-do-panel .bino-do__reset {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid #0E1A2B;
	border-radius: 0;
	background: #FFFFFF;
	color: #0E1A2B;
	font-family: "Heebo", Arial, sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	text-align: start;
	text-transform: none;
	cursor: pointer;
}

#bino-do-panel .bino-do__reset {
	font-weight: 500;
}

#bino-do-panel .bino-do__opt:hover,
#bino-do-panel .bino-do__reset:hover {
	background: #F1F4F8;
}

#bino-do-panel .bino-do__opt[aria-pressed="true"] {
	background: #0E1A2B;
	color: #FFFFFF;
}

#bino-do-panel .bino-do__opt[aria-pressed="true"]:hover {
	background: #1B3150;
}

/* State is shown by shape as well as colour: empty box = off, ticked box = on. */
#bino-do-panel .bino-do__mark {
	position: relative;
	flex: 0 0 auto;
	box-sizing: border-box;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
}

#bino-do-panel .bino-do__opt[aria-pressed="true"] .bino-do__mark::after {
	content: "";
	position: absolute;
	top: 1px;
	left: 4px;
	width: 5px;
	height: 9px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

#bino-do-panel .bino-do__statement {
	display: inline-block;
	padding: 8px 0;
	color: #0E1A2B;
	font-family: "Heebo", Arial, sans-serif;
	font-size: 16px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

#bino-do-panel .bino-do__note {
	margin: 0;
	color: #2B3645;
	font-family: "Heebo", Arial, sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
}

@media (max-width: 767px) {
	.bino-do-panelwrap {
		padding: 4px 16px 12px;
	}

	#bino-do-panel .bino-do__panel {
		max-width: none;
	}
}

/* ---------- 4. Option: increased text spacing (WCAG 1.4.12 values) ---------- */
html.bino-do-ready.bino-do-spacing :is(.bino-do-scope, .bino-do-ui) * {
	line-height: 1.5 !important;
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}

html.bino-do-ready.bino-do-spacing :is(.bino-do-scope, .bino-do-ui) p {
	margin-bottom: 2em !important;
}

/* ---------- 5. Option: link highlighting ---------- */
html.bino-do-ready.bino-do-links :is(.bino-do-scope, .bino-do-ui) a,
html.bino-do-ready.bino-do-links :is(.bino-do-scope, .bino-do-ui) a * {
	text-decoration-line: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
}

/* Image links (the logo) get a dashed frame; not !important, so the focus ring still wins. */
html.bino-do-ready.bino-do-links :is(.bino-do-scope, .bino-do-ui) a:has(img) {
	outline: 2px dashed currentColor;
	outline-offset: 3px;
}

/* ---------- 6. Option: high contrast (black on white) ---------- */
html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui),
html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) * {
	background-color: #FFFFFF !important;
	background-image: none !important;
	color: #000000 !important;
	border-color: #000000 !important;
	text-shadow: none !important;
}

html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) *::before,
html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) *::after {
	background-color: transparent !important;
	background-image: none !important;
}

html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) svg,
html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) svg * {
	fill: currentColor !important;
}

html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) a,
html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) a * {
	color: #0033A0 !important;
	text-decoration-line: underline !important;
}

html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) :is(.elementor-button, .wp-block-button__link),
html.bino-do-ready.bino-do-contrast .bino-do__toggle,
html.bino-do-ready.bino-do-contrast .bino-do__opt,
html.bino-do-ready.bino-do-contrast .bino-do__reset {
	border: 2px solid #000000 !important;
}

html.bino-do-ready.bino-do-contrast :is(.bino-do-scope, .bino-do-ui) :is(a, button):focus-visible {
	outline-color: #000000 !important;
}

/* 0.1.4: shapes drawn with ::before in the article block templates stay visible in high contrast:
   the current-page dot in the menus and the contact icons (otherwise the generic ::before rule above
   would make them transparent). */
html.bino-do-ready.bino-do-contrast .bino-do-scope a[aria-current="page"]::before,
html.bino-do-ready.bino-do-contrast .bino-do-scope .bino-contact .wp-block-button__link::before,
html.bino-do-ready.bino-do-contrast .bino-do-scope .bino-contact__list li::before {
	background-color: #000000 !important;
}

/* ---------- 7. Mode switching (0.1.2): no in-between colours ----------
   "bino-do-switching" is on <html> only while the script changes display-mode classes
   (a frame or two). Elementor gives some text, links and buttons colour/background
   transitions; without this rule they would pass through low-contrast mixtures for
   about 0.3s when high contrast is turned on or off. Hover transitions are unaffected
   because the class is removed straight after the switch. */
html.bino-do-switching :is(.bino-do-scope, .bino-do-ui),
html.bino-do-switching :is(.bino-do-scope, .bino-do-ui) *,
html.bino-do-switching :is(.bino-do-scope, .bino-do-ui) *::before,
html.bino-do-switching :is(.bino-do-scope, .bino-do-ui) *::after {
	transition: none !important;
}
