/*
 * Header. Measurements match the Squarespace header at 1440px wide: 55×100 logo, menu links 69px apart,
 * social icons and donate button aligned to the bottom of the logo. Below 782px it becomes a centered
 * logo with a "+" menu button that opens a full-screen navy menu.
 */
.sr-header {
	position: relative;
}

.sr-header__bar {
	margin-bottom: 0;
}

.sr-header__logo,
.sr-header__logo a,
.sr-header__logo img {
	display: block;
	margin-bottom: 0;
}

.sr-header__social .wp-block-social-links {
	margin-bottom: 12px;
	font-size: 25px;
	line-height: 1;
}

.sr-header__donate .wp-block-button__link {
	padding: 15.7px 26.2px;
	line-height: 1.1;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

/*
 * "Support Our Work" (header and open mobile menu): fades slightly on hover, like Squarespace's buttons
 * (opacity 0.8 over 0.1s). Keyboard focus gets a white ring that shows on the crimson and navy.
 */
.sr-header .wp-block-button__link {
	transition: opacity 0.1s linear;
}

.sr-header .wp-block-button__link:hover,
.sr-header .wp-block-button__link:focus-visible {
	opacity: 0.8;
}

.sr-header .wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--base);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.sr-header .wp-block-button__link {
		transition: none;
	}
}

nav.sr-header__nav {
	margin-top: 16px;
	line-height: 1.7;
}

.sr-header__nav .wp-block-navigation-item__content {
	padding-bottom: 2px;
}

/* Current page: thin underline, like Squarespace. */
.sr-header__nav .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 7px;
}

/* Logo, social links and donate button inside the menu only show in the open mobile menu. */
.sr-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) .sr-nav-overlay-only,
.sr-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation-item:has(> .sr-nav-overlay-only) {
	display: none;
}

/* "+" menu button and "×" close button: thin white lines instead of WordPress's icons. */
.sr-header__nav .wp-block-navigation__responsive-container-open,
.sr-header__nav .wp-block-navigation__responsive-container-close {
	width: 35px;
	height: 35px;
}

.sr-header__nav .wp-block-navigation__responsive-container-open {
	position: relative;
}

.sr-header__nav .wp-block-navigation__responsive-container-open svg,
.sr-header__nav .wp-block-navigation__responsive-container-close svg {
	display: none;
}

.sr-header__nav .wp-block-navigation__responsive-container-open::before,
.sr-header__nav .wp-block-navigation__responsive-container-open::after,
.sr-header__nav .wp-block-navigation__responsive-container-close::before,
.sr-header__nav .wp-block-navigation__responsive-container-close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 1px;
	background: currentColor;
	transform: translate(-50%, -50%);
}

.sr-header__nav .wp-block-navigation__responsive-container-open::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.sr-header__nav .wp-block-navigation__responsive-container-close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.sr-header__nav .wp-block-navigation__responsive-container-close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

/* Open mobile menu: logo at the top, links centered, social links and donate button at the bottom. */
.sr-header__nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 23px 6vw 23px;
}

.sr-header__nav .is-menu-open .wp-block-navigation__responsive-close,
.sr-header__nav .is-menu-open .wp-block-navigation__responsive-dialog,
.sr-header__nav .is-menu-open .wp-block-navigation__responsive-container-content {
	height: 100%;
}

.sr-header__nav .is-menu-open .wp-block-navigation__responsive-container-close {
	top: 13px;
	right: 5px;
	z-index: 2;
}

.sr-header__nav .is-menu-open .wp-block-navigation__responsive-container-content {
	gap: 0 !important;
	padding-top: 0 !important;
}

.sr-header__nav .is-menu-open .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: none;
}

.sr-header__nav .is-menu-open .wp-block-navigation__container {
	flex: 1;
	gap: 0.3em !important;
	align-items: center;
	width: 100%;
	font-size: 2.07rem;
	line-height: 1.4;
}

.sr-header__nav .is-menu-open .wp-block-navigation-item:has(> .sr-nav-overlay-logo) {
	margin-bottom: auto;
}

.sr-header__nav .is-menu-open .wp-block-navigation-item:has(> .sr-nav-overlay-social) {
	margin-top: auto;
	margin-bottom: 3.4rem;
}

.sr-header__nav .is-menu-open .sr-nav-overlay-social {
	font-size: 25px;
}

.sr-header__nav .is-menu-open .sr-nav-overlay-donate .wp-block-button__link {
	padding: 21px 35px;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.2rem;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: 0.04em;
}

@media (max-width: 781px) {
	.sr-header {
		padding: 23px 6vw 24px !important;
	}

	.sr-header__social,
	.sr-header__actions {
		display: none !important;
	}

	.sr-header__logo img {
		width: 33px !important;
	}

	/* The menu button sits on the logo's row, at the right edge. */
	nav.sr-header__nav {
		position: absolute;
		top: 36px;
		right: calc(6vw + 6px);
		margin: 0;
	}

	/* WordPress switches to the mobile menu at 600px; Squarespace did at ~780px. Match Squarespace. */
	.sr-header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.sr-header__nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}
