/**
 * Accessibility styles.
 *
 * Enqueued last so the focus indicator wins over the per-component :focus rules
 * spread through redesign.css and specific-project-styles.css.
 *
 * These were previously injected by the ada-baseline mu-plugin. They live in the
 * theme now because they are theme styling, not a patch.
 */

/**
 * WCAG 2.2 AA, 2.4.7 Focus Visible.
 *
 * specific-project-styles.css used to carry *:focus{outline:0 !important}, which
 * left every form control with no focus indicator at all — only links and buttons
 * were given one back, by redesign.css. That blanket rule is gone; this restores a
 * ring for keyboard users while keeping the original intent that a mouse click
 * should not draw one.
 *
 * The white-then-black double ring is drawn with box-shadow so it stays visible
 * against both the light and purple backgrounds used across the site, and so it
 * survives the per-component outline rules that are still in place.
 */
@supports selector(:focus-visible) {
	*:focus:not(:focus-visible) {
		outline: none;
	}
}

*:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px #fff, 0 0 0 6px #000;
}

/**
 * The mobile degree-level jump menu. Its prompt was a styled <p>; it is a real
 * <label for> now, so it has to reproduce that paragraph box exactly \u2014 a <label>
 * inherits the 62.5%% root size, not the 18px that article p sets.
 */
.select-degree label {
	display: block;
	font-size: 18px;
	line-height: 25px;
	color: #303030;
	font-weight: bold;
	margin: 0;
	padding: 0 !important;
}

/* WCAG 2.2 AAA, 2.3.3 Animation from Interactions. */
@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;
	}
}

/* Windows high contrast: defer to system colors. */
@media (forced-colors: active) {
	*:focus-visible {
		outline: 3px solid CanvasText;
		outline-offset: 2px;
	}
}
