/**
 * Eagle Landing Accessibility - front-end styles.
 * --ela-accent is printed inline from the plugin settings (default #137a3f, 5.4:1 on white).
 */

:root {
	--ela-accent: #137a3f;
}

/* Visually hidden, still read by screen readers. Also repairs the Customizer rule that hid .screen-reader-text with display:none. */
.ela-sr-only,
html body .screen-reader-text:not(:focus) {
	position: absolute !important;
	display: block !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip-path: inset(50%) !important;
	border: 0 !important;
	white-space: nowrap !important;
}

/* Skip link: off-screen until focused. */
.ela-skip-link {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 1000000;
	padding: 12px 20px;
	background: #fff;
	color: #000;
	font: 700 16px/1.2 sans-serif;
	text-decoration: underline;
	border: 3px solid var(--ela-accent);
	border-radius: 4px;
	transform: translateY(-200%);
}

.ela-skip-link:focus {
	transform: none;
}

/* Visible keyboard focus (WCAG 2.4.7 / 2.4.11 / 1.4.11). */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
	outline: 3px solid var(--ela-accent) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px #fff !important;
}

/* Desktop drop-downs open on keyboard focus, and close with Escape (class added by script). */
.et_pb_menu .et-menu.nav li:focus-within > ul.sub-menu,
.et-menu.nav li:focus-within > ul.sub-menu {
	visibility: visible !important;
	opacity: 1 !important;
}

html body .et_pb_menu .et-menu.nav li.ela-closed:not(:hover) > ul.sub-menu {
	visibility: hidden !important;
	opacity: 0 !important;
}

/* Contrast: current menu item and in-content links (brand green #1fbf64 is only 2.4:1 on white). */
html body .et_pb_menu.et_pb_menu.et_pb_menu ul li.current-menu-item > a,
html body .et_pb_menu.et_pb_menu.et_pb_menu ul li.current-menu-ancestor > a,
html body .et_pb_menu.et_pb_menu.et_pb_menu ul li.current-menu-parent > a,
html body .et_pb_menu.et_pb_menu.et_pb_menu ul li.current_page_item > a {
	color: var(--ela-accent) !important;
}

#main-content .et_pb_text:not(.et_pb_bg_layout_dark) .et_pb_text_inner a:not(.et_pb_button) {
	color: var(--ela-accent);
	text-decoration: underline;
}

/* Brand-green backgrounds (flagged by script) get the accessible accent; the buttons' orange hover is darkened to keep 4.5:1 with white text. */
html body #page-container .ela-green-bg,
html body #page-container .et_pb_section .ela-green-bg {
	background-color: var(--ela-accent) !important;
}

html body #page-container .et_pb_button.ela-green-bg:hover,
html body #page-container .et_pb_section .et_pb_button.ela-green-bg:hover {
	background-color: #b34700 !important;
}

/* Light grey icon circles with white icons (flagged by script) get a darker grey for 4.5:1. */
html body #page-container .ela-grey-bg {
	background-color: #5b6270 !important;
}

/* Social icon label: keep it for screen readers instead of display:none. */
.et-social-icons a.icon span,
.et-social-icon a.icon span {
	position: absolute !important;
	display: block !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

/* Pause / play control for the autoplaying background video (WCAG 2.2.2). */
.ela-video-toggle {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	background: #000;
	color: #fff;
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: pointer;
}

.ela-video-toggle svg {
	display: block;
	pointer-events: none;
}

.ela-video-toggle:hover {
	background: #222;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
