/**
 * Work With Dr. Tiff Accessibility
 *
 * Focus indicators (WCAG 2.4.7, 2.4.11, 1.4.11), reduced motion (2.3.3) and utilities.
 * Color contrast fixes live in assets/js/contrast.js because Beaver Builder sets
 * colors per module and the failing colors are also used legitimately elsewhere.
 */

/* Visible focus ring: dark outline plus white halo, readable on light and dark backgrounds. */
body :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
body .uabb-creative-menu-mobile-toggle:focus-visible,
body .fl-button:focus-visible,
body .uabb-button:focus-visible,
body .uabb-btn:focus-visible,
body .woocommerce a.button:focus-visible,
body .woocommerce button.button:focus-visible {
	outline: 3px solid #0a2343 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #fff !important;
}

/* A submenu dismissed with Escape or Enter stays closed while focus rests on its parent link. */
body .uabb-creative-menu li.wwdt-a11y-closed > ul.sub-menu {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
}

/*
 * 1:1 Nutrition Coaching hero: white text over a photo measured 2.92:1 in the lightest area
 * (3:1 needed for large text). Same teal, 85% instead of 70% opacity.
 */
body .fl-node-0kc18ul9dmia > .fl-row-content-wrap::after {
	background-color: rgba(37, 119, 140, 0.85) !important;
}

/*
 * Row/column overlays that were too light for the text over them. assets/js/contrast.js sets the
 * custom property to the same color with just enough extra opacity to pass.
 */
body .wwdt-a11y-overlay-after::after {
	background-color: var(--wwdt-a11y-overlay-after) !important;
}

body .wwdt-a11y-overlay-before::before {
	background-color: var(--wwdt-a11y-overlay-before) !important;
}

/* Placeholder text at the theme's 40% opacity is too faint to read (WCAG 1.4.3). */
body :is(input, textarea)::placeholder {
	color: #6d6e71;
	opacity: 1;
}

/* The skip link moves focus to the whole content region; an outline around the page body would only be noise. */
body #fl-main-content:focus {
	outline: none !important;
	box-shadow: none !important;
}

/* Programmatic focus targets (e.g. checkout error summary) should not show a ring on mouse use. */
[tabindex="-1"]:focus:not(:focus-visible) {
	outline: none;
}

/* Keep focused elements clear of a fixed header and the cookie bar (WCAG 2.4.11). */
html {
	scroll-padding-top: 7.5rem;
	scroll-padding-bottom: 6rem;
}

/* Text that is only for assistive technology. */
:where(.sr-only, .screen-reader-text) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Honor the operating system "reduce motion" setting. */
@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;
	}
}
