/**
 * Accessibility mitigations (HALO-0248225).
 *
 * Loaded after screen.css. screen.css is a compiled, minified build whose
 * Sass source is not in this repo, so these fixes live here as overrides.
 */

/* Skip link: off screen until focused, then visible (WCAG 2.4.1, 2.1.1). */
.skip-link.screen-reader-text:focus {
	opacity: 1;
	left: 10px;
	top: 10px;
	z-index: 100000;
	display: block;
	padding: 12px 20px;
	background-color: #fff;
	color: #144983;
	font-size: 16px;
	font-weight: 700;
	text-decoration: underline;
	outline: 3px solid #2997cf;
	outline-offset: 2px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/*
 * screen.css positions every span inside the search button
 * (`form button span{position:relative}`), which would pull this hidden
 * label back into the layout and push the icon out of place.
 */
div.menu .region-inner form button .screen-reader-text {
	position: absolute;
	top: auto;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

#main-content:focus {
	outline: 0;
}

/* Desktop dropdowns: open for keyboard focus, not only hover (WCAG 2.1.1). */
div.menu .region-inner .menu-menu-1-container > ul > li:focus-within > ul,
div.menu .region-inner .menu-menu-1-container > ul > li.focus > ul,
div.menu .region-inner .menu-menu-1-container > ul > li > ul li:focus-within > ul,
div.menu .region-inner .menu-menu-1-container > ul > li > ul li.focus > ul {
	display: block;
}

/* Let Escape close a dropdown even while focus is still inside it. */
div.menu .region-inner .menu-menu-1-container > ul > li.submenu-closed > ul,
div.menu .region-inner .menu-menu-1-container > ul > li > ul li.submenu-closed > ul {
	display: none;
}

/* Visible focus indicators on the navigation and search. */
div.menu .region-inner a:focus-visible,
div.menu .region-inner button:focus-visible,
div.menu .region-inner input:focus-visible,
.mobile-menu-panel a:focus-visible,
.slider-controls button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px #144983;
}

div.menu .region-inner .menu-menu-1-container > ul > li > ul li a:focus-visible {
	outline: 2px solid #06c;
	outline-offset: -2px;
	box-shadow: none;
	background-color: #f1f1f1;
}

/* Search field opens on focus, matching the existing hover behavior. */
div.menu .region-inner form.header-search:focus-within {
	width: 100%;
	padding-left: 10px;
}

/*
 * Mobile/tablet menu panel: it sits off screen when closed, but its links were
 * still in the tab order. Hide it from keyboard and screen readers until opened.
 */
@media (max-width: 1024px) {
	/* Show immediately on open (so focus can move in), hide after the slide-out. */
	.mobile-menu-panel {
		visibility: hidden;
		transition: right 0.25s ease, visibility 0s linear 0.25s;
	}

	.mobile-menu-panel.active {
		visibility: visible;
		transition: right 0.25s ease, visibility 0s;
	}
}

/* Homepage hero: "Our Vision" text sat directly on a busy photo (WCAG 1.4.3). */
@media (min-width: 768px) {
	.home-hero .home-hero-inner .caption .small-title,
	.home-hero .home-hero-inner .caption .large-title {
		background-color: rgba(255, 255, 255, 0.9);
		color: #0f3a69;
	}

	.home-hero .home-hero-inner .caption .small-title {
		display: inline-block;
		padding: 2px 16px;
		font-weight: 500;
	}

	.home-hero .home-hero-inner .caption .large-title {
		padding: 12px 24px;
	}
}

/* Bio cards (Advisory Board, People): job titles were #919191 on #f1f1f1, 2.8:1 (WCAG 1.4.3). */
.creds .cred-item {
	color: #575757;
}
