/* =============================================================================
   WCAG 2.2 Accessibility — Signal Path Creative Child Theme v2.2.0
   Loaded via wp_enqueue_scripts (skipped entirely when Divi builder is active).
   =============================================================================

   BUILDER SAFETY:
   Divi's frontend builder wraps all editable page content in .et-fb-post-content
   when ?et_fb=1 is present. The builder's own UI lives outside that wrapper.
   Any rule that uses a broad selector (button, *, [role="button"]) is scoped
   with :has() so it only matches in one of two contexts:
     A) Regular frontend (no builder): body does not contain .et-fb-post-content
     B) Inside the builder content area: .et-fb-post-content *
   This prevents the builder UI chrome from being affected even if the PHP-level
   enqueue skip fails (e.g. caching, unusual Divi init order).

   :has() is supported in all browsers Divi 5 targets (Chrome 105+, Safari 15.4+,
   Firefox 121+). The touch-target and focus rules degrade gracefully without it.
   ============================================================================= */


/* ── 1. Skip-to-main-content link ─────────────────────────────────────────────
   WCAG 2.4.1 Bypass Blocks — Level A
   Class-scoped — no broad selectors, safe in all contexts.
   --------------------------------------------------------------------------- */
.ds-skip-link {
	position: absolute;
	left:     -9999px;
	top:       auto;
	width:     1px;
	height:    1px;
	overflow:  hidden;
	z-index:   999999;
}
.ds-skip-link:focus-visible {
	position:        fixed;
	top:             0;
	left:            0;
	width:           auto;
	height:          auto;
	padding:         0.875rem 1.5rem;
	background:      #000000;
	color:           #ffffff;
	font-size:       1rem;
	font-weight:     700;
	text-decoration: none;
	outline:         3px solid #ffcc00;
	outline-offset:  2px;
	z-index:         999999;
}


/* ── 2. Focus indicators ───────────────────────────────────────────────────────
   WCAG 2.4.7  Focus Visible        — Level AA
   WCAG 2.4.11 Focus Appearance [NEW 2.2] — Level AA
   Uses low-specificity selectors without !important where possible.
   The [class*="et-fb"] exclusion ensures Divi builder toolbar elements
   (which all carry et-fb-* class names) are never affected, even if this
   stylesheet is incorrectly loaded in the builder context.
   --------------------------------------------------------------------------- */
:root {
	--ds-focus-color:  #005fcc;
	--ds-focus-width:  3px;
	--ds-focus-offset: 3px;
}

*:focus-visible:not([class*="et-fb"]) {
	outline:        var(--ds-focus-width) solid var(--ds-focus-color) !important;
	outline-offset: var(--ds-focus-offset) !important;
	border-radius:  2px;
}

*:focus:not(:focus-visible) {
	outline: none !important;
}


/* ── 3. Reduced motion ─────────────────────────────────────────────────────────
   WCAG 2.3.3 Animation from Interactions — Level AAA
   The et-fb-* exclusion ensures Divi builder UI transitions are not suppressed,
   even if this stylesheet is incorrectly loaded in the builder context.
   Note: prefers-reduced-motion only fires for users who opt in via OS settings,
   so this rule has zero effect for users who haven't set that preference.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*:not([class*="et-fb"]),
	*:not([class*="et-fb"])::before,
	*:not([class*="et-fb"])::after {
		animation-duration:        0.01ms !important;
		animation-iteration-count: 1      !important;
		transition-duration:       0.01ms !important;
		scroll-behavior:           auto   !important;
	}
}


/* ── 4. Minimum touch target size ──────────────────────────────────────────────
   WCAG 2.5.8 Target Size Minimum [NEW 2.2] — Level AA
   Uses ONLY class-based and input-type selectors — never the bare `button`
   element selector. The Divi 5 builder renders its own toolbar using real
   <button> elements; targeting `button {}` globally (even scoped with :has())
   expands those toolbar buttons to 44px and distorts the builder UI.
   Divi frontend buttons always carry .et_pb_button (or variant) class names.
   input[type="submit/button/reset"] are safe: the builder never uses those.
   --------------------------------------------------------------------------- */
.et_pb_button,
.et_pb_promo_button,
.et_pb_more_button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
	min-height: 44px;
	min-width:  44px;
}


/* ── 5. Screen-reader utility classes ──────────────────────────────────────────
   Class-scoped — no broad selectors, safe in all contexts.
   --------------------------------------------------------------------------- */
.sr-only {
	position:    absolute;
	width:       1px;
	height:      1px;
	padding:     0;
	margin:      -1px;
	overflow:    hidden;
	clip:        rect(0, 0, 0, 0);
	white-space: nowrap;
	border:      0;
}
.sr-only-focusable:focus,
.sr-only-focusable:active {
	position:    static;
	width:       auto;
	height:      auto;
	margin:      0;
	overflow:    visible;
	clip:        auto;
	white-space: normal;
}
