/* Site header (parts/site-header.php, assets/js/header.js). Grey bar,
   the logo and menu on the page column (90% of the window, at most
   1170px). From 922px the menu, Donate and social links sit in one row;
   below that the menu opens under the bar from the toggle.

   The header scrolls away with the page; it does not stick (Kevin,
   2026-11-04, undoing that morning's sticky header). --rhsa-sticky-top is
   where anything that sticks or scrolls to an anchor stops: below the
   admin bar when logged in (which scrolls away on phones under 600px). */

:root {
	--rhsa-admin-bar: var(--wp-admin--admin-bar--height, 0px);
	--rhsa-sticky-top: var(--rhsa-admin-bar);
	scroll-padding-top: calc(var(--rhsa-sticky-top) + 16px);
}
@media (max-width: 600px) { :root { --rhsa-admin-bar: 0px; } }

.rhsa-header {
	position: relative;
	z-index: 99;
	background: #eee;
	border-bottom: 1px solid #eaeaea;
	font-family: var(--rhsa-cond);
}
.rhsa-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: min(1170px, 90%);
	min-height: 120px;
	margin: 0 auto;
	padding: 15px 0;
	box-sizing: content-box;
}
.rhsa-header__logo { display: block; line-height: 0; }
.rhsa-header__logo img { width: 200px; height: auto; }

.rhsa-header__menu { display: flex; align-items: center; gap: 10px; }
.rhsa-menu {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 17px;
}
.rhsa-menu li { position: relative; margin: 0; }
.rhsa-menu a {
	display: flex;
	align-items: center;
	color: #3a3a3a;
	text-decoration: none;
}
.rhsa-menu a:hover,
.rhsa-menu li:hover > a,
.rhsa-menu .current-menu-item > a,
.rhsa-menu .current-menu-ancestor > a { color: var(--rhsa-red); }
.rhsa-menu__sub-toggle {
	display: flex;
	align-items: center;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}
.rhsa-menu__sub-toggle svg { width: 10px; height: 10px; fill: currentColor; }

.rhsa-header__donate {
	margin: 0 25px;
	padding: 15px 30px;
	border-radius: 40px;
	background: var(--rhsa-red);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	line-height: 16px;
	text-decoration: none;
}
.rhsa-header__donate:hover,
.rhsa-header__donate:focus-visible { background: var(--rhsa-ink); color: #fff; }
.rhsa-header__donate:focus-visible { outline: 2px solid var(--rhsa-ink); outline-offset: 3px; }

.rhsa-header__social { display: flex; gap: 12px; }
.rhsa-header__social a { display: flex; color: var(--rhsa-ink); }
.rhsa-header__social svg { width: 18px; height: 18px; fill: currentColor; }

.rhsa-header__toggle {
	display: none;
	box-shadow: none;
	padding: 12.75px;
	border: 0;
	border-radius: 2px;
	background: none;
	color: var(--rhsa-red);
	cursor: pointer;
}
.rhsa-header__toggle svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.rhsa-header__toggle .rhsa-header__close,
.rhsa-header.is-open .rhsa-header__toggle .rhsa-header__open { display: none; }
.rhsa-header.is-open .rhsa-header__toggle .rhsa-header__close { display: block; }

/* Wide screens: one row; submenus drop down on hover, focus or their button. */
@media (min-width: 922px) {
	.rhsa-menu > li { display: flex; align-items: center; }
	.rhsa-menu > li > a { min-height: 120px; padding: 0 15px; }
	.rhsa-menu > li.menu-item-has-children > a { padding-right: 0; }
	.rhsa-menu__sub-toggle { align-self: stretch; padding: 0 15px 0 10px; border-radius: 0; box-shadow: none; }
	.rhsa-menu .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 99999;
		width: 240px;
		margin: 0;
		padding: 0;
		list-style: none;
		background: #fff;
		border-top: 2px solid var(--rhsa-red);
		box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.1);
		line-height: 1.45;
		visibility: hidden;
		opacity: 0;
	}
	.rhsa-menu li:hover > .sub-menu,
	.rhsa-menu li:focus-within > .sub-menu,
	.rhsa-menu li.is-open > .sub-menu { visibility: visible; opacity: 1; }
	.rhsa-menu .sub-menu a { display: block; padding: 15px; border-bottom: 1px solid #eaeaea; }
	.rhsa-menu .sub-menu li:last-child a { border-bottom: 0; }
}

/* Phones and tablets: logo and toggle; the menu opens under the bar. */
@media (max-width: 921.98px) {
	.rhsa-header__inner {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-rows: minmax(92.28px, auto);
		width: 90%;
		min-height: 0;
	}
	.rhsa-header__logo img { width: 160px; }
	.rhsa-header__toggle { display: block; }
	.rhsa-header__menu {
		grid-column: 1 / -1;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		margin: 15px -5.5556% -15px;
		background: #fff;
	}
	.rhsa-header.is-js .rhsa-header__menu { display: none; }
	.rhsa-header.is-js.is-open .rhsa-header__menu { display: flex; }
	.rhsa-menu { flex-direction: column; font-family: var(--rhsa-sans); line-height: 51px; }
	.rhsa-menu > li { display: flex; flex-wrap: wrap; align-items: center; }
	.rhsa-menu a { flex: 1; padding: 0 20px; }
	.rhsa-menu .current-menu-item > a,
	.rhsa-menu .current-menu-ancestor > a,
	.rhsa-menu > .current-menu-ancestor { background: #fff4f4; }
	.rhsa-menu__sub-toggle {
		justify-content: center;
		width: 57px;
		height: 51px;
		margin-right: 20px;
		border-radius: 30px;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
		color: var(--rhsa-red);
	}
	.rhsa-menu__sub-toggle svg { width: 16px; height: 16px; }
	.rhsa-menu .sub-menu { display: none; flex: 0 0 100%; margin: 0; padding: 0; list-style: none; background: #fff; }
	.rhsa-menu li.is-open > .sub-menu { display: block; }
	.rhsa-menu .sub-menu a { padding-left: 32px; }
	.rhsa-menu .sub-menu a::before { content: "›"; margin-right: 8px; }
	.rhsa-header__donate { align-self: flex-start; margin: 15px 35px 30px; }
	.rhsa-header__social { display: none; }
}

/* Scroll to Top (footer.php), shown by header.js once the page scrolls. */
.rhsa-to-top {
	position: fixed;
	right: 30px;
	bottom: 30px;
	z-index: 99;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 31.5px;
	height: 31.5px;
	border-radius: 2px;
	background: var(--rhsa-red);
	color: #fff;
}
.rhsa-to-top[hidden] { display: none; }
.rhsa-to-top svg { width: 16px; height: 10px; fill: currentColor; transform: rotate(180deg); }
.rhsa-to-top:focus-visible { outline: 2px solid var(--rhsa-ink); outline-offset: 3px; }

/* The header's own buttons keep their look on hover (style.css gives
   buttons a red pill that turns ink). */
.rhsa-header :is(.rhsa-header__toggle, .rhsa-menu__sub-toggle):is(:hover, :focus) { background: none; color: var(--rhsa-red); }
