/**
 * Header v2 chrome — single stack for home + all reference routes.
 * Loaded after route CSS; replaces rules that lived in rebuild.css (dequeued on reference pages).
 */

/* SVG chart defs injected at wp_body_open — must not reserve vertical space above the header */
body > svg.home-sprite-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	pointer-events: none;
}

.bradford-header-v2 {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--paper, #fff);
	border-bottom: 1px solid var(--border, #e7e6e2);
	overflow: visible;
	margin: 0;
	padding: 0;
	gap: 0;
	/* Match homepage-reference .nav-inner — fixed bar height, content vertically centered */
	--bs-header-bar-height: 72px;
}

/* Kill template-part / site-blocks padding above the blue bar */
header.wp-block-template-part:has(.bradford-header-v2),
.wp-block-template-part:has(.bradford-header-v2),
.wp-site-blocks > header.wp-block-template-part:has(.bradford-header-v2):first-child {
	display: block;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent;
	border: none;
}

/* Sticky header clears the fixed admin bar when logged in */
body.admin-bar .bradford-header-v2 {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .bradford-header-v2 {
		top: var(--wp-admin--admin-bar--height, 46px);
	}
}

.bradford-header-v2.is-layout-flow {
	gap: 0;
}

:root :where(.bradford-header-v2.is-layout-flow) > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

header.wp-block-template-part:has(.bradford-header-v2) > .bradford-header-v2 {
	margin: 0;
}

.bradford-header-v2 > .bradford-header-v2__topbar {
	margin-block-start: 0;
}

.bradford-header-v2__shell.is-layout-flow {
	gap: 0;
}

/* No block-layout gap above/below chrome or between header and main content */
.bradford-header-v2 + main,
header.bradford-header-v2 + main {
	margin-block-start: 0 !important;
}

.bradford-header-v2 .bs-container.bradford-header-v2__shell,
.bradford-header-v2__shell {
	position: relative;
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 32px;
	padding-right: 32px;
	box-sizing: border-box;
	background: var(--paper, #fff);
	border-bottom: none;
}

.bradford-header-v2__topbar,
.bradford-header-v2__topbar.is-layout-flow {
	width: 100%;
	margin: 0;
	padding: 0;
	background: var(--paper, #fff);
}

.bradford-header-v2__topbar-inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding: 5px 32px;
	box-sizing: border-box;
}

.bradford-header-v2__topbar-inner.is-layout-flex {
	justify-content: flex-end !important;
	align-items: center !important;
}

.bradford-header-v2__phone-mobile {
	display: none;
}

.bradford-header-v2__inner {
	max-width: none;
	margin: 0;
	padding: 0;
	height: var(--bs-header-bar-height, 72px);
	min-height: 0;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	box-sizing: border-box;
}

/* WP layout flex can default to flex-start — lock toolbar vertical centering sitewide */
.bradford-header-v2__inner.is-layout-flex {
	align-items: center !important;
}

.bradford-header-v2__inner > .bradford-header-v2__logo,
.bradford-header-v2__inner > .bradford-header-v2__nav-wrap,
.bradford-header-v2__inner > .bradford-header-v2__actions,
.bradford-header-v2__inner > .bradford-header-v2__menu-toggle {
	align-self: center;
}

.bradford-header-v2__logo,
.bradford-header-v2__logo figure {
	margin: 0;
	line-height: 0;
}

.bradford-header-v2__logo a {
	display: flex;
	align-items: center;
	line-height: 0;
}

.bradford-header-v2__actions {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-end;
	gap: 0;
}

.bradford-header-v2__actions.is-layout-flex {
	align-items: center !important;
	flex-direction: row !important;
}

.bradford-header-v2__actions .wp-block-buttons {
	margin: 0;
	display: flex;
	align-items: center;
}

.bradford-header-v2__logo img {
	display: block;
	width: auto;
	height: 45px;
	object-fit: contain;
}

/* Phone — top bar only */
.bradford-header-v2__topbar .bradford-header-v2__phone,
.bradford-header-v2__topbar p.bradford-header-v2__phone,
.bradford-header-v2__topbar a.bradford-header-v2__phone {
	margin: 0;
	font-weight: 500;
	font-size: 0.8125rem;
	line-height: 1.2;
	color: var(--ink, #16181d);
	text-decoration: none;
	white-space: nowrap;
	letter-spacing: 0.01em;
}

.bradford-header-v2__topbar p.bradford-header-v2__phone a,
.bradford-header-v2__topbar a.bradford-header-v2__phone {
	color: inherit;
	text-decoration: none;
	font-weight: inherit;
}

.bradford-header-v2__topbar p.bradford-header-v2__phone a:hover,
.bradford-header-v2__topbar a.bradford-header-v2__phone:hover {
	color: var(--muted, #5a6070);
}

/* Book CTA — style the link, reset the Buttons wrapper */
.bradford-header-v2 .wp-block-button.bs-btn,
.bradford-header-v2 a.bs-btn {
	background: transparent;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 0;
	box-shadow: none;
}

.bradford-header-v2 .wp-block-button.bs-btn .wp-block-button__link,
.bradford-header-v2 a.bs-btn,
.bradford-header-v2 .wp-block-button.bs-btn .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--accent, #1e5fbf);
	color: #fff;
	border-radius: 8px;
	padding: 11px 22px !important;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.25;
	border: none;
	text-decoration: none;
	font-family: 'Inter', system-ui, sans-serif;
	white-space: nowrap;
	box-sizing: border-box;
	vertical-align: middle;
}

.bradford-header-v2 .wp-block-button.bs-btn .wp-block-button__link:hover,
.bradford-header-v2 a.bs-btn:hover {
	background: #005a9e;
	color: #fff;
}

.bradford-header-v2 .wp-block-button.bs-btn:hover {
	transform: none;
	box-shadow: none;
}

/* Primary nav — dotted underline on top-level simple links only (not mega triggers) */
.bradford-header-v2__nav-wrap {
	display: flex;
	align-items: center;
}

.bradford-header-v2__nav-item:not(.bradford-header-v2__nav-item--mega) > a {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.25;
	color: var(--ink, #16181d);
	text-decoration: none;
	border-bottom: 2px dotted transparent;
	display: inline-flex;
	align-items: center;
	padding: 0;
	box-sizing: border-box;
}

.bradford-header-v2__nav-item:not(.bradford-header-v2__nav-item--mega) > a:hover {
	border-bottom-color: var(--accent, #1e5fbf);
	color: var(--ink, #16181d);
}

.bradford-header-v2__nav-top,
.bradford-header-v2__nav-item--mega .bradford-header-v2__nav-top,
.bradford-header-v2__nav a.bradford-header-v2__nav-top {
	border-bottom: 2px dotted transparent;
	padding: 0 !important;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	line-height: 1.25;
	font-size: 0.9375rem;
	box-sizing: border-box;
}

@media (min-width: 960px) {
	/* Logo | nav (true center) | CTA — same balance as reference .nav-inner */
	.bradford-header-v2__inner.is-layout-flex,
	.bradford-header-v2__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		align-items: center;
		column-gap: 1.5rem;
		padding: 0;
		height: var(--bs-header-bar-height, 72px);
		min-height: 0;
	}

	.bradford-header-v2__logo {
		grid-column: 1;
		justify-self: start;
		align-self: center;
		display: flex;
		align-items: center;
	}

	.bradford-header-v2__menu-toggle {
		display: none;
	}

	.bradford-header-v2__nav-wrap {
		grid-column: 2;
		justify-self: center;
		align-self: center;
		flex: none;
		width: auto;
		display: flex;
		align-items: center;
		justify-content: center;
		height: auto;
	}

	.bradford-header-v2__actions {
		grid-column: 3;
		justify-self: end;
		align-self: center;
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 0;
		height: auto;
	}

	.bradford-header-v2__nav {
		display: flex;
		list-style: none;
		margin: 0;
		padding: 0;
		gap: 1.75rem;
		align-items: center;
	}

	.bradford-header-v2__nav-item,
	.bradford-header-v2__nav-item-head {
		display: flex;
		align-items: center;
	}

	.bradford-header-v2__actions .wp-block-buttons,
	.bradford-header-v2__actions .wp-block-button.bs-btn {
		margin: 0;
		display: flex;
		align-items: center;
	}
}

@media (max-width: 959px) {
	.bradford-header-v2 {
		--bs-header-bar-height: 64px;
	}

	.bradford-header-v2__shell {
		padding-left: 20px;
		padding-right: 20px;
	}

	.bradford-header-v2__inner {
		display: flex !important;
		flex-wrap: wrap;
		gap: 0.75rem;
		height: var(--bs-header-bar-height, 64px);
		min-height: 0;
	}

	.bradford-header-v2__logo {
		flex: 1 1 auto;
		min-width: 0;
	}

	.bradford-header-v2__logo img {
		height: 36px;
		max-width: min(190px, 48vw);
	}

	.bradford-header-v2__topbar-inner,
	.bradford-header-v2__topbar-inner.is-layout-flex {
		justify-content: center !important;
		padding: 6px 20px;
	}

	.bradford-header-v2__inner > .bradford-header-v2__actions {
		display: none;
	}
}
