/**
 * Sticky site header: identity, primary menu, material schedule.
 */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

.gather-site-header {
	position: sticky;
	top: 0;
	z-index: 200;
	background-color: var(--gather-chalk);
	border-bottom: 1px solid var(--gather-border-subtle);
}

/**
 * Toolbar is fixed; sticky header must sit below it. WP sets --wp-admin--admin-bar--height
 * (32px when viewport > 782px, 46px at max-width 782px for the compact/touch bar).
 *
 * Narrow phones keep top: 0 below 600px; tablets and desktop get the fluid offset from html.
 */
@media screen and (min-width: 600px) {
	body.admin-bar .gather-site-header {
		top: var(--wp-admin--admin-bar--height, 32px);
	}
}

.gather-site-header__inner {
	width: 100%;
	margin: 0 auto;
	padding: 1.15rem var(--gather-page-gutter-x);
	display: grid;
	/* minmax(0, 1fr) lets side columns shrink so the center track gets a real width budget (avoids paint overlap). */
	grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
	align-items: center;
	gap: 1rem 1.25rem;
}

.gather-site-header__brand {
	justify-self: start;
	min-width: 0;
	line-height: 0;
}

.gather-site-header__brand .custom-logo-link {
	display: inline-block;
	line-height: 0;
	text-decoration: none;
}

.gather-site-header__brand .custom-logo {
	display: block;
	height: auto;
	max-height: 2.25rem;
	width: auto;
}

.gather-site-header__wordmark {
	font-family: var(--gather-font-headline);
	font-size: clamp(1.15rem, 2.5vw, 1.35rem);
	font-weight: 500;
	letter-spacing: 0.38em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--gather-charcoal);
	display: inline-block;
	padding: 0.15em 0;
}

.gather-site-header__wordmark:hover,
.gather-site-header__wordmark:focus-visible {
	color: var(--gather-charcoal);
	text-decoration: none;
}

.gather-primary-nav {
	justify-self: center;
	text-align: center;
	min-width: 0;
	max-width: 100%;
	width: 100%;
}

.gather-primary-nav__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.85rem clamp(1.25rem, 3vw, 2.75rem);
	/* Default flex min-width:auto would refuse to shrink below one row of links and overflow into the actions column. */
	min-width: 0;
	max-width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--gather-font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.35;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.gather-primary-nav__list > li > a {
	color: var(--gather-charcoal);
	text-decoration: none;
}

.gather-primary-nav__list > li > a:hover,
.gather-primary-nav__list > li > a:focus-visible {
	color: var(--gather-charcoal);
	text-decoration: none;
	opacity: 0.85;
}

.gather-primary-nav__list > .current-menu-item > a,
.gather-primary-nav__list > .current-menu-ancestor > a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.28em;
}

.gather-site-header__actions {
	justify-self: end;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.65rem 1rem;
}

.gather-material-schedule__trigger {
	font-family: inherit;
	cursor: pointer;
	text-align: inherit;
	box-shadow: none;
	border: none;
	background: none;
	padding: 0;
	line-height: inherit;
}

.gather-material-schedule__link {
	font-size: 0.8125rem;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-decoration: none;
	color: var(--gather-terra);
	white-space: nowrap;
}

.gather-material-schedule__trigger:hover.gather-material-schedule__link,
.gather-material-schedule__trigger:focus-visible.gather-material-schedule__link,
.gather-material-schedule__link:hover,
.gather-material-schedule__link:focus-visible {
	color: var(--gather-terra);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.gather-material-schedule__count-wrap {
	margin-left: 0.28em;
}

.gather-boards-header__trigger {
	font-family: inherit;
	cursor: pointer;
	text-align: inherit;
	box-shadow: none;
	border: none;
	background: none;
	padding: 0;
	line-height: inherit;
}

.gather-boards-header__link {
	font-size: 0.8125rem;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-decoration: none;
	color: var(--gather-terra);
	white-space: nowrap;
}

.gather-boards-header__trigger:hover.gather-boards-header__link,
.gather-boards-header__trigger:focus-visible.gather-boards-header__link,
.gather-boards-header__link:hover,
.gather-boards-header__link:focus-visible {
	color: var(--gather-terra);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.gather-boards-header__count-wrap {
	margin-left: 0.28em;
}

/* Stacked header (brand + actions row, nav full width) before the mid-width band where the 3-col grid could collide. */
@media (max-width: 960px) {
	.gather-site-header__inner {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: center;
		row-gap: 0.75rem;
	}

	.gather-primary-nav {
		order: 3;
		flex: 1 1 100%;
		width: 100%;
		max-width: none;
		text-align: left;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.gather-primary-nav__list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		padding-bottom: 0.25rem;
		width: max-content;
		min-width: 100%;
		max-width: none;
		white-space: nowrap;
	}
}
