/*
 * AOS accessibility fixes — child theme (AUTO-SAFE layer)
 * Each block is scoped to a body class added only while that fix is enabled
 * (see includes/a11y/a11y-theme.php). Root-cause IDs match
 * accessibility-audit/analysis/root-causes.json.
 */

/* Shared utility: visually hidden but available to assistive technology.
 * Off-screen technique (not clip/clip-path): verified to be exposed by both
 * axe-core and IBM Equal Access, which treats clip:rect(0,0,0,0) as hidden. */
.aos-visually-hidden {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------------------------------------------------------------
 * A11Y-002 — Skip link (WCAG 2.4.1). Hidden until focused, then shown
 * above the fixed Divi header.
 * ------------------------------------------------------------- */
.aos-skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: 2147483647;
}
.aos-skip-link:focus,
.aos-skip-link:focus-visible {
	position: fixed;
	left: 12px;
	top: 12px;
	width: auto;
	height: auto;
	overflow: visible;
	padding: 12px 18px;
	background: #1a1a1a;
	color: #ffffff !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: underline;
	border-radius: 4px;
	outline: 3px solid #ffffff;
	outline-offset: 0;
	box-shadow: 0 0 0 6px #1a1a1a;
}
/* Programmatic focus target after using the skip link — no permanent ring. */
#main-content:focus,
#et-main-area:focus {
	outline: none;
}

/* ---------------------------------------------------------------
 * A11Y-003 — Visible keyboard focus (WCAG 2.4.7).
 * Divi's reset declares `:focus { outline: 0 }` (style-static.min.css),
 * which removes every focus indicator site-wide. Restore a two-tone ring
 * that is visible on light and dark backgrounds, for keyboard focus only
 * (:focus-visible), so mouse users see no change.
 * ------------------------------------------------------------- */
body.aos-a11y-003 a:focus-visible,
body.aos-a11y-003 button:focus-visible,
body.aos-a11y-003 input:focus-visible,
body.aos-a11y-003 select:focus-visible,
body.aos-a11y-003 textarea:focus-visible,
body.aos-a11y-003 summary:focus-visible,
body.aos-a11y-003 [tabindex]:not([tabindex="-1"]):focus-visible,
body.aos-a11y-003 [role="button"]:focus-visible,
body.aos-a11y-003 [role="tab"]:focus-visible,
body.aos-a11y-003 [contenteditable="true"]:focus-visible {
	outline: 3px solid #1a1a1a !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #ffffff !important;
	border-radius: 2px;
}
/* Inputs inside Gravity Forms / WooCommerce keep their own border; ring sits outside it. */
body.aos-a11y-003 .gform_wrapper input:focus-visible,
body.aos-a11y-003 .gform_wrapper select:focus-visible,
body.aos-a11y-003 .gform_wrapper textarea:focus-visible {
	outline-offset: 1px !important;
}

/* ---------------------------------------------------------------
 * A11Y-004 — Divi hides the WordPress search-widget label with
 * `.widget_search .screen-reader-text { display: none }`, which also removes
 * it from the accessibility tree, leaving input#s unlabelled (WCAG 4.1.2).
 * Keep it visually hidden but exposed.
 * ------------------------------------------------------------- */
body.aos-a11y-004 .widget_search .screen-reader-text,
body.aos-a11y-004 .et_pb_widget .wp-block-search__label.screen-reader-text {
	display: block !important;
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------------------------------------------------------------
 * A11Y-039 — Divi's front-end script sets style="display:none" on the
 * WordPress comment-form labels (it relies on the fields' placeholders),
 * which leaves #comment/#author/#email/#url without names (WCAG 1.3.1,
 * 3.3.2, 4.1.2). Keep the labels visually hidden but exposed.
 * ------------------------------------------------------------- */
body.aos-a11y-039 #commentform label[for] {
	display: block !important;
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	white-space: nowrap !important;
	border: 0 !important;
}
body.aos-a11y-039 #commentform p[class^="comment-form-"] {
	position: relative;
}

/* ---------------------------------------------------------------
 * A11Y-005 — labels added to header search inputs are visually hidden.
 * ------------------------------------------------------------- */
body.aos-a11y-005 .et-search-form .aos-search-label {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------------------------------------------------------------
 * A11Y-007 — the Divi hamburger is now a focusable button; make sure the
 * pointer cursor and focus ring render on the icon itself.
 * ------------------------------------------------------------- */
body.aos-a11y-007 .mobile_menu_bar[role="button"] {
	cursor: pointer;
}
