/* =====================================================================
 * Mark Vence - site-wide focus ring (child 1.2.0, 2026-10-17)
 * WCAG 2.0 AA / IS 5568: 2.4.7 focus visible, 1.4.11 ring contrast >= 3:1.
 * Design rule: 11_design-settings.md §14 - one ring, 2px Ink Navy offset 2 on
 * light surfaces, 2px Parchment offset 2 on Navy; keyboard only.
 *
 * Works together with functions.php "A11y 4": Hello's reset.css now sits in
 * @layer hello-reset, so every unlayered rule below (and every component's own
 * CSS) beats it whatever its specificity - its #c36 button fill and black ring
 * no longer win. Component rules that deliberately style their own focus
 * state keep winning over these defaults by specificity.
 *
 * Colour fallbacks = the kit values (post 6), used only if the kit variables
 * are ever missing (e.g. Elementor off) - an undefined var() would otherwise
 * void the whole outline shorthand and remove the ring.
 * ===================================================================== */

/* Pointer focus: no ring. .mv-focus-pointer = focus returned by the popup
   adapter after a mouse/touch close. Specificity 0 on purpose - any rule that
   draws a ring wins over it. */
:where(:focus:not(:focus-visible), .mv-focus-pointer:focus) {
	outline: none;
}

/* Keyboard focus: brand ring. Specificity (0,2,0) - NOT inside :where(), so it
   beats `.mv-qvt-chip { all: unset }` (0,1,0) (FOCUS plan review §3 #1). */
:focus-visible:not(.mv-focus-pointer) {
	outline: 2px solid var(--e-global-color-primary, #16233D);
	outline-offset: 2px;
}

/* Footer = Ink Navy surface -> Parchment ring (Navy on Navy would be 1:1).
   Its nav menu's white dropdown keeps the Navy ring (Parchment on white =
   1.17:1). (0,4,0). */
.elementor-location-footer :focus-visible:not(.mv-focus-pointer):not(.elementor-nav-menu--dropdown *) {
	outline-color: var(--e-global-color-secondary, #F3ECE0);
}

/* PENDING - Lior's decision (plan review §3 #5), NOT active.
   Hello reset's white 4px halo (box-shadow:0 0 0 4px #fff on :focus-visible).
   Uncomment to remove it. It is written INTO the same layer, so it removes
   only the reset's halo and never a component's own focus box-shadow
   (any unlayered box-shadow still wins). :is() carries the specificity of the
   reset's strongest selector (0,3,0) and comes later in the layer -> wins.
@layer hello-reset {
	:is([tabindex]:not([tabindex="-1"]), a, button, input, select, textarea):focus-visible {
		box-shadow: none;
	}
}
*/

/* Focus not hidden under the fixed header (child 1.2.1, STATE F107).
   WCAG 2.2 SC 2.4.11 Focus Not Obscured (Minimum) - outside the ת״י 5568 /
   WCAG 2.0 AA baseline; applied as best practice in support of 2.4.7 Focus
   Visible (a focus ring under the header is not visible).
   Header 26 is position:fixed and its HTML widget 6cbbbac writes the header's
   full offsetHeight to --mv-header-h on <html> (70px @390, 90px @1440,
   measured 2026-10-18). The var does NOT shrink when the header slides away
   (transform only), so the padding always reserves the full header: when
   Shift+Tab / anchor jumps scroll UP the header slides back in over the top
   band, and a focused element is never placed under it. Scrolling DOWN hides
   the header, so the cost there is only a header-sized gap above the target.
   Fallback 90px = the largest measured header, used if the script never ran.
   scroll-padding applies to browser-driven scroll-into-view (focus moves,
   #fragment navigation, scrollIntoView()). */
html {
	scroll-padding-top: var(--mv-header-h, 90px);
}
