/* Bristol custom header.
 *
 * Keep all header overrides in this module. The legacy theme header rules are
 * intentionally left alone so this feature can be updated or removed cleanly.
 */

.site-header {
	background: var(--white);
	box-shadow: 0 1px 0 var(--black-10);
	position: relative;
	z-index: 200;
}

.site-header > .wrap {
	background: transparent;
	display: block;
	margin: 0 auto;
	max-width: none;
	padding: 0;
	width: 100%;
}

.afb-header {
	background: var(--white);
	font-family: var(--body-font);
	position: relative;
}

.afb-header__top {
	align-items: center;
	box-sizing: border-box;
	display: grid;
	gap: clamp(30px, 5vw, 80px);
	grid-template-columns: minmax(170px, 240px) minmax(320px, 1fr) minmax(220px, 300px);
	margin: 0 auto;
	max-width: var(--site-inner-max-width);
	min-height: 210px;
	/* padding: 15px 5vw 10px; */
	width: var(--site-inner-width);
}

.afb-header__brand .title-area {
	align-items: center;
	display: flex;
	justify-content: flex-start;
	max-width: none;
	padding: 0;
	text-align: left;
	width: 100%;
}

.wp-custom-logo .site-container .afb-header__brand .title-area {
	max-width: none;
}

.wp-custom-logo .site-container .afb-header__brand .custom-logo-link {
	aspect-ratio: auto;
	display: block;
}

.afb-header__brand .custom-logo {
	display: block;
	height: auto;
	margin: 0;
	max-height: 150px;
	max-width: 190px;
	width: auto;
}

.afb-header__search {
	width: 100%;
}

.afb-header__search-form {
	margin: 0;
	position: relative;
}

.afb-header__search-field {
	background: var(--white);
	border: 2px solid var(--primary-theme-color);
	border-radius: 100vw;
	color: var(--primary-theme-color);
	font-family: var(--body-font);
	font-size: 16px;
	height: 48px;
	padding: 8px 58px 8px 20px;
	width: 100%;
}

.afb-header__search-field:focus {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary-theme-color) 35%, transparent);
	outline: 0;
}

.afb-header__search-submit {
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--primary-theme-color);
	cursor: pointer;
	display: flex;
	font-size: 24px;
	height: 44px;
	justify-content: center;
	padding: 0;
	position: absolute;
	right: 3px;
	top: 2px;
	width: 48px;
}

.afb-header__search-submit:focus,
.afb-header__search-submit:hover {
	background: transparent;
	color: var(--secondary-theme-color);
}

.afb-header__utilities {
	align-items: center;
	display: flex;
	gap: 18px;
	justify-content: flex-end;
}

.afb-header__utility-link {
	align-items: center;
	background: var(--primary-theme-color);
	border-radius: 50%;
	color: var(--white);
	display: inline-flex;
	flex: 0 0 46px;
	font-size: 24px;
	height: 46px;
	justify-content: center;
	text-decoration: none;
	transition: background-color 160ms ease-in-out, color 160ms ease-in-out;
	width: 46px;
}

.afb-header__utility-link:focus,
.afb-header__utility-link:hover {
	background: var(--secondary-theme-color);
	color: var(--white);
	text-decoration: none;
}

.afb-header__desktop-nav {
	border-top: 0;
	box-sizing: border-box;
	margin: 0 auto;
	max-width: var(--site-inner-width);
	padding: 0 5vw;
	width: 100%;
}

.afb-header__menu {
	align-items: stretch;
	display: flex;
	justify-content: center;
	list-style: none;
	margin: 0;
	min-width: 0;
	padding: 0;
	position: relative;
	width: 100%;
}

.afb-header__menu-item {
	align-items: center;
	display: flex;
	flex: 0 1 auto;
	list-style: none;
	margin: 0;
	min-width: 0;
	padding: 0;
	position: relative;
}

.afb-header__menu-item + .afb-header__menu-item::before {
	background: color-mix(in srgb, var(--primary-theme-color) 70%, transparent);
	content: "";
	height: 26px;
	width: 1px;
}

.afb-header__menu-link {
	align-items: center;
	color: var(--primary-theme-color);
	display: flex;
	font-family: var(--body-font);
	font-size: 15px;
	font-weight: 400;
	height: 72px;
	padding: 0 clamp(10px, 1.2vw, 22px);
	text-decoration: none;
	white-space: nowrap;
}

.afb-header__menu-item.current-menu-item > .afb-header__menu-link,
.afb-header__menu-item.current-menu-ancestor > .afb-header__menu-link,
.afb-header__menu-link:focus,
.afb-header__menu-link:hover {
	color: var(--secondary-theme-color);
	text-decoration: none;
}

.afb-header__submenu {
	background: var(--white);
	border-top: 2px solid var(--secondary-theme-color);
	box-shadow: 0 12px 30px var(--black-20);
	display: none;
	left: 0;
	list-style: none;
	margin: 0;
	min-width: 230px;
	padding: 10px 0;
	position: absolute;
	top: 100%;
	z-index: 210;
}

.afb-header__menu-item:focus-within > .afb-header__submenu,
.afb-header__menu-item:hover > .afb-header__submenu {
	display: block;
}

.afb-header__submenu li {
	list-style: none;
}

.afb-header__submenu a {
	color: var(--primary-theme-color);
	display: block;
	font-size: 15px;
	padding: 9px 18px;
	text-decoration: none;
	white-space: nowrap;
}

.afb-header__submenu a:focus,
.afb-header__submenu a:hover {
	color: var(--secondary-theme-color);
}

.afb-header__menu-item--mega {
	position: static;
}

.afb-mega-menu {
	background: color-mix(in srgb, var(--primary-theme-color) 94%, transparent);
	box-shadow: 0 18px 36px var(--black-25);
	display: none;
	left: 0;
	position: absolute;
	top: 100%;
	width: 100%;
	z-index: 220;
}

.afb-header__menu-item--mega.afb-mega-open > .afb-mega-menu {
	display: block;
}

.afb-mega-menu__inner {
	display: grid;
	grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
	margin: 0 auto;
	max-height: 500px;
	max-width: none;
	min-height: 380px;
	width: 100%;
}

.afb-mega-menu__links {
	align-items: flex-start;
	display: flex;
	max-height: 500px;
	overflow-y: auto;
	padding: 35px clamp(30px, 5vw, 70px);
}

.afb-mega-menu__links ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.afb-mega-menu__links li {
	list-style: none;
	margin: 0;
}

.afb-mega-menu__links a {
	color: var(--white);
	display: block;
	font-family: var(--body-font);
	font-size: clamp(17px, 1.35vw, 21px);
	line-height: 1.3;
	padding: 5px 0;
	text-decoration: none;
}

.afb-mega-menu__links a:focus,
.afb-mega-menu__links a:hover {
	color: var(--secondary-theme-color);
	text-decoration: none;
}

.afb-mega-menu__image-link {
	display: block;
	height: clamp(380px, 42vw, 500px);
	max-height: 500px;
	overflow: hidden;
}

.afb-mega-menu__image-link img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.afb-header__menu-toggle,
.afb-header__mobile-nav {
	display: none;
}

@media (max-width: 1280px) {
	.afb-header__top {
		gap: 30px;
		grid-template-columns: 180px minmax(280px, 1fr) minmax(200px, auto);
	}

	.afb-header__utilities {
		gap: 10px;
	}

	.afb-header__utility-link {
		flex-basis: 40px;
		font-size: 20px;
		height: 40px;
		width: 40px;
	}

	.afb-header__menu-link {
		padding-left: 9px;
		padding-right: 9px;
	}
}

@media (max-width: 1150px) {
	.site-header {
		position: relative;
		top: auto;
	}

	.site-header > .wrap {
		max-width: none;
		width: 100%;
	}

	.afb-header__top {
		gap: 15px;
		grid-template-columns: minmax(100px, 1fr) auto;
		min-height: 0;
		padding: 12px 20px;
	}

	.afb-header__brand {
		justify-self: start;
	}

	.afb-header__brand .custom-logo {
		max-height: 108px;
  		max-width: 173px;
	}

	.afb-header__search,
	.afb-header__utilities,
	.afb-header__desktop-nav {
		display: none;
	}

	.afb-header__menu-toggle {
		align-items: center;
		background: transparent;
		border: 0;
		color: var(--primary-theme-color);
		cursor: pointer;
		display: flex;
		font-size: 30px;
		height: 44px;
		justify-content: center;
		padding: 0;
		width: 44px;
	}

.afb-header .afb-header__menu-toggle .afb-header__menu-close-icon {
	display: none;
}

.afb-header.afb-menu-open .afb-header__menu-toggle .afb-header__menu-open-icon {
	display: none;
}

.afb-header.afb-menu-open .afb-header__menu-toggle .afb-header__menu-close-icon {
	display: inline-block;
}

	.afb-header__mobile-nav {
		background: var(--white);
		border-top: 1px solid var(--black-10);
		box-shadow: 0 12px 20px var(--black-15);
		display: none;
		left: 0;
		position: absolute;
		top: 100%;
		width: 100%;
		z-index: 230;
	}

	.afb-header.afb-menu-open .afb-header__mobile-nav {
		display: block;
	}

	.afb-header__mobile-menu,
	.afb-header__mobile-menu .sub-menu {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.afb-header__mobile-menu {
		max-height: calc(100vh - 97px);
		overflow-y: auto;
		padding: 10px 0;
	}

	.afb-header__mobile-menu .menu-item {
		list-style: none;
		position: relative;
	}

	.afb-header__mobile-menu a {
		color: var(--primary-theme-color);
		display: block;
		font-family: var(--body-font);
		font-size: 17px;
		padding: 11px 56px 11px 22px;
		text-decoration: none;
	}

	.afb-header__mobile-menu a:focus,
	.afb-header__mobile-menu a:hover {
		color: var(--secondary-theme-color);
	}

	.afb-header__submenu-toggle {
		align-items: center;
		background: transparent;
		border: 0;
		color: var(--primary-theme-color);
		cursor: pointer;
		display: flex;
		height: 44px;
		justify-content: center;
		padding: 0;
		position: absolute;
		right: 10px;
		top: 2px;
		width: 44px;
	}

	.afb-header__submenu-toggle i {
		transition: transform 160ms ease-in-out;
	}

	.afb-header__mobile-menu .sub-menu {
		background: color-mix(in srgb, var(--light-gray) 35%, var(--white));
		display: none;
		padding: 5px 0 7px 18px;
	}

	.afb-header__mobile-menu .afb-submenu-open > .sub-menu {
		display: block;
	}

	.afb-header__mobile-menu .afb-submenu-open > .afb-header__submenu-toggle i {
		transform: rotate(180deg);
	}

	.afb-header__mobile-menu .sub-menu a {
		font-size: 15px;
		padding-bottom: 9px;
		padding-top: 9px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.afb-header__utility-link,
	.afb-header__submenu-toggle i {
		transition: none;
	}
}
