/**
 * Butterfields – site header
 *
 * Built to the approved header design: 1500px content width on desktop, white
 * upper bar, #B1BA22 navigation bar, Manrope throughout with Cormorant
 * Garamond for the strapline.
 */

:root {
	/* Brand palette */
	--bf-primary: #b1ba22;
	--bf-primary-translucent: rgba(177, 186, 34, 0.9); /* --bf-primary at 90%, for the blurred stuck bar – keep the two in step */
	--bf-primary-tint: #bec546; /* Active / hover state in the green bar */
	--bf-olive: #6f7745; /* Headline + phone number text */
	--bf-olive-dark: #5e6712; /* Immediate Concerns button text */
	--bf-grey: #7f818c; /* Secondary text + Facebook icon */
	--bf-white: #fff;

	/* Typography */
	--bf-font-primary: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--bf-font-accent: "Cormorant Garamond", "Times New Roman", Times, serif;

	/* Layout */
	--bf-container: 1500px;
	--bf-gutter: 20px;
}

/* -------------------------------------------------------------------------
 * Shell
 * ---------------------------------------------------------------------- */

/*
 * Sticky header.
 *
 * The whole header is the sticky element, offset upwards by exactly the
 * white upper bar's height (--bf-top-h, measured by header.js). The header
 * therefore travels with the page until the white bar has slid off the top
 * of the viewport, at which point it pins with the green bar sitting at
 * y = 0 — the menu stays reachable without the header eating the viewport.
 *
 * Two details are load-bearing:
 *
 * 1. Sticky must be on `.bf-header`, not on `.bf-header__bar`. A sticky box
 *    can only travel within its own parent's box, and `.bf-header` ends
 *    immediately below the green bar — so sticking the bar itself gives it
 *    a range of practically zero and it just scrolls away.
 *
 * 2. The white bar's height is never animated. An earlier version pinned the
 *    header at top: 0 and collapsed that bar's height to zero once scrolled
 *    — but its height was also what the scroll threshold driving the
 *    collapse was computed from. The collapse shifted layout, the browser
 *    answered the shift by nudging scrollTop (scroll anchoring), and that
 *    nudge fed straight back into the threshold, bouncing the header open
 *    and shut. Sliding the bar out of view under a negative offset gives
 *    the same look with its height left alone, so there is no such loop.
 *
 *    The green bar below it does still compact on `is-stuck`, which is a
 *    real (if smaller) shift — header.js keeps that safe with a wide gap
 *    between its compact and expand thresholds rather than by deriving
 *    either of them from a height the compaction changes.
 *
 * The 0px fallback matters: if the script has not run there is no measured
 * height, and the header simply sticks in full rather than mispositioning.
 */
.bf-header {
	position: sticky;
	top: calc(-1 * var(--bf-top-h, 0px));
	z-index: 100;
	/* Deliberately no background here. Both bars paint their own, and a
	 * background on this wrapper would sit between the page content and the
	 * translucent stuck bar — showing white through it instead of the
	 * content, and leaving its backdrop blur nothing to blur. */
	/* Keeps the header's own subtree from being picked as the scroll-anchor
	 * node — it is the one box on the page that changes size on scroll, so
	 * anchoring to it would be self-defeating. */
	overflow-anchor: none;
}

.bf-header *,
.bf-header *::before,
.bf-header *::after {
	box-sizing: border-box;
}

.bf-container {
	width: 100%;
	max-width: var(--bf-container);
	margin-inline: auto;
	padding-inline: var(--bf-gutter);
}

.bf-header .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.bf-header a {
	text-decoration: none;
}

.bf-header img {
	max-width: 100%;
	height: auto;
	display: block;
}

.bf-header :focus-visible {
	outline: 2px solid var(--bf-olive-dark);
	outline-offset: 2px;
}

.bf-header__bar :focus-visible {
	outline-color: var(--bf-white);
}

/* -------------------------------------------------------------------------
 * Upper bar – logo, strapline, phone, social
 * ---------------------------------------------------------------------- */

.bf-header__top {
	background-color: var(--bf-white);
}

.bf-header__top-inner {
	display: flex;
	align-items: center;
	min-height: 157px;
}

.bf-header__brand {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(170px, 16vw, 240px); /* Keeps the mark centred over the button below */
}

.bf-header__brand img,
.bf-header__brand .custom-logo {
	width: auto;
	max-height: 63px;
}

.bf-header__strapline {
	flex: 0 1 auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 0 clamp(20px, 2.7vw, 40px);
	padding-left: clamp(28px, 4.3vw, 64px);
	border-left: 1px solid rgba(111, 119, 69, 0.55);
}

.bf-header__strapline-primary {
	font-family: var(--bf-font-accent);
	font-weight: 500;
	font-size: clamp(22px, 1.87vw, 28px);
	line-height: 1.15;
	color: var(--bf-olive);
	font-variant-numeric: oldstyle-nums;
	font-feature-settings: "onum" 1;
}

.bf-header__strapline-secondary {
	font-family: var(--bf-font-primary);
	font-weight: 500;
	font-size: clamp(13px, 1.07vw, 16px);
	line-height: 1.2;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--bf-grey);
}

.bf-header__contact {
	display: flex;
	align-items: center;
	gap: clamp(24px, 3.5vw, 52px);
	margin-left: auto;
	padding-left: 24px;
}

.bf-header__phone {
	display: flex;
	align-items: center;
	gap: 12px;
	color: inherit;
}

.bf-header__phone-icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--bf-primary);
	border-radius: 50%;
	color: var(--bf-primary);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bf-header__phone-icon svg {
	width: 20px;
	height: 20px;
}

.bf-header__phone:hover .bf-header__phone-icon,
.bf-header__phone:focus-visible .bf-header__phone-icon {
	background-color: var(--bf-primary);
	color: var(--bf-white);
}

.bf-header__phone-text {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.bf-header__phone-number {
	font-family: var(--bf-font-primary);
	font-weight: 700;
	font-size: clamp(26px, 2.27vw, 34px);
	line-height: 1.1;
	letter-spacing: 0.01em;
	color: var(--bf-olive);
}

.bf-header__phone-hours {
	margin-top: 5px;
	font-family: var(--bf-font-primary);
	font-weight: 500;
	font-size: clamp(15px, 1.27vw, 19px);
	line-height: 1.2;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--bf-grey);
}

.bf-header__social {
	display: flex;
	align-items: center;
	gap: clamp(24px, 3.5vw, 52px);
}

.bf-header__social-link {
	display: block;
	color: var(--bf-grey);
}

.bf-header__facebook svg {
	width: clamp(46px, 4vw, 60px);
	height: auto;
	transition: color 0.2s ease;
}

a.bf-header__facebook:hover,
a.bf-header__facebook:focus-visible {
	color: var(--bf-primary);
}

.bf-header__google-img {
	width: clamp(126px, 11.07vw, 166px);
	height: auto;
}

/* -------------------------------------------------------------------------
 * Green bar – Immediate Concerns button + primary navigation
 * ---------------------------------------------------------------------- */

/* `relative` anchors the mobile nav panel and the desktop dropdowns, which
 * position themselves against this bar. */
.bf-header__bar {
	position: relative;
	background-color: var(--bf-primary);
	/* Fades in with the compaction when the bar pins – see `is-stuck`. */
	transition: background-color 0.28s ease;
}

.bf-header__bar-inner {
	display: flex;
	align-items: center;
	gap: clamp(20px, 2.93vw, 44px);
	min-height: 118px;
}

.bf-header__cta {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: clamp(170px, 16vw, 240px);
	min-height: 86px;
	padding: 12px 20px;
	background-color: var(--bf-white);
	color: var(--bf-olive-dark);
	font-family: var(--bf-font-primary);
	font-weight: 700;
	font-size: clamp(12.5px, 1.07vw, 16px);
	line-height: 1.25;
	letter-spacing: 0.05em;
	text-align: center;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* `:active` is listed because the parent's reset.css repaints every link with
 * `a:active,a:hover{color:#336}` (0,1,1), which outranks `.bf-header__cta`. */
.bf-header__cta:hover,
.bf-header__cta:active,
.bf-header__cta:focus-visible {
	background-color: var(--bf-olive-dark);
	color: var(--bf-white);
}

/* Navigation ------------------------------------------------------------ */

.bf-nav {
	flex: 1 1 auto;
	min-width: 0;
}

.bf-nav__list,
.bf-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bf-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.bf-nav__list > li {
	position: relative;
	display: flex;
	align-items: center;
	transition: background-color 0.2s ease;
}

.bf-nav__list > li > a {
	display: block;
	padding: 25px clamp(7px, 0.73vw, 11px);
	color: var(--bf-white);
	font-family: var(--bf-font-primary);
	font-weight: 700;
	font-size: clamp(12.5px, 1.07vw, 16px);
	line-height: 1.4;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
}

.bf-nav__list > li.menu-item-has-children > a {
	padding-right: 4px;
}

.bf-nav__list > li:hover,
.bf-nav__list > li:focus-within,
.bf-nav__list > li.is-open,
.bf-nav__list > li.current-menu-item,
.bf-nav__list > li.current-menu-ancestor,
.bf-nav__list > li.current_page_item,
.bf-nav__list > li.current_page_ancestor {
	background-color: var(--bf-primary-tint);
}

/* Submenu toggle / caret */

.bf-nav__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	padding: 25px clamp(7px, 0.73vw, 11px) 25px 4px;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--bf-white);
	/* Muted via opacity rather than a translucent colour: the parent's reset
	 * forces `color:#fff` on button:hover/:focus, and opacity is a property it
	 * never touches, so the caret cannot be knocked out of step by it. */
	opacity: 0.75;
	cursor: pointer;
	line-height: 0;
}

.bf-nav__toggle svg {
	width: 14px;
	height: auto;
	transition: transform 0.2s ease;
}

.bf-nav__list > li.is-open > .bf-nav__toggle svg {
	transform: rotate(180deg);
}

/*
 * Parent-theme guard.
 *
 * Hello Elementor's reset.css fills EVERY <button> with #c36 (magenta) on
 * :hover and :focus:
 *     button:focus, button:hover { background-color:#c36; color:#fff }
 * That selector is (0,1,1), which outranks a single-class rule like
 * `.bf-nav__toggle` (0,1,0) — so clicking a dropdown caret (or the mobile Menu
 * button) flashed the parent's magenta over the brand green. These overrides
 * sit at (0,2,1) and take it back. Only the properties the parent forces in its
 * state selectors are listed, so the ordinary padding/colour rules — including
 * the mobile ones — keep working. Removing the state selectors brings the bug
 * straight back.
 */
.bf-header .bf-nav__toggle:hover,
.bf-header .bf-nav__toggle:focus,
.bf-header .bf-nav__toggle:active,
.bf-header .bf-nav__toggle:focus-visible,
.bf-header .bf-header__menu-toggle:hover,
.bf-header .bf-header__menu-toggle:focus,
.bf-header .bf-header__menu-toggle:active,
.bf-header .bf-header__menu-toggle:focus-visible {
	background-color: transparent;
	background-image: none;
	border-color: transparent;
	box-shadow: none;
	text-decoration: none;
}

/* Brand-coloured feedback in place of the parent's white-on-magenta. */
.bf-header .bf-nav__list > li > .bf-nav__toggle:hover,
.bf-header .bf-nav__list > li > .bf-nav__toggle:focus,
.bf-header .bf-nav__list > li > .bf-nav__toggle:active,
.bf-header .bf-nav__list > li.is-open > .bf-nav__toggle,
.bf-header .bf-header__menu-toggle:hover,
.bf-header .bf-header__menu-toggle:focus,
.bf-header .bf-header__menu-toggle:active {
	color: var(--bf-white);
	opacity: 1;
}

/* Dropdowns */

.bf-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	min-width: 260px;
	padding: 8px 0;
	background-color: var(--bf-white);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.bf-nav .sub-menu .sub-menu {
	top: 0;
	left: 100%;
}

.bf-nav li:hover > .sub-menu,
.bf-nav li:focus-within > .sub-menu,
.bf-nav li.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.bf-nav .sub-menu li {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bf-nav .sub-menu a {
	flex: 1 1 auto;
	display: block;
	padding: 11px 22px;
	color: var(--bf-olive);
	font-family: var(--bf-font-primary);
	font-weight: 600;
	font-size: 15px;
	line-height: 1.35;
	letter-spacing: 0.03em;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bf-nav .sub-menu li:hover > a,
.bf-nav .sub-menu a:focus-visible {
	background-color: #f4f5e8;
	color: var(--bf-olive-dark);
}

.bf-nav .sub-menu .bf-nav__toggle {
	padding: 11px 18px;
	color: var(--bf-olive);
	opacity: 1;
}

.bf-nav .sub-menu .bf-nav__toggle svg {
	transform: rotate(-90deg);
}

/* Mobile menu button – hidden until the bar runs out of room */

.bf-header__menu-toggle {
	display: none;
	align-items: center;
	gap: 10px;
	width: auto;
	padding: 14px 18px 14px 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--bf-white);
	font-family: var(--bf-font-primary);
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.bf-header__menu-toggle-icon {
	display: block;
	width: 26px;
	height: 26px;
}

.bf-header__menu-toggle-icon svg {
	width: 26px;
	height: 26px;
}

.bf-header__menu-toggle-icon svg:last-child,
.bf-header__menu-toggle[aria-expanded="true"] .bf-header__menu-toggle-icon svg:first-child {
	display: none;
}

.bf-header__menu-toggle[aria-expanded="true"] .bf-header__menu-toggle-icon svg:last-child {
	display: block;
}

/* -------------------------------------------------------------------------
 * Stuck-state compaction
 *
 * `is-stuck` is purely cosmetic — see the note on `.bf-header` for how the
 * header actually sticks. header.js adds it once the white upper bar has
 * scrolled out of view; it tightens the green bar and frosts it, so the
 * pinned strip reads as a compact navigation bar over the page.
 * ---------------------------------------------------------------------- */

.bf-header__bar-inner,
.bf-header__cta,
.bf-nav__list > li > a,
.bf-nav__list > li > .bf-nav__toggle {
	transition: min-height 0.28s ease, padding 0.28s ease, background-color 0.2s ease, color 0.2s ease;
}

.bf-header.is-stuck .bf-header__bar-inner {
	min-height: 72px;
}

.bf-header.is-stuck .bf-header__cta {
	min-height: 56px;
}

/* Scoped to direct children so dropdown items keep their own padding. */
.bf-header.is-stuck .bf-nav__list > li > a,
.bf-header.is-stuck .bf-nav__list > li > .bf-nav__toggle {
	padding-top: 14px;
	padding-bottom: 14px;
}

/*
 * Frosted glass on the pinned bar.
 *
 * A translucent background colour rather than `opacity`, which would fade the
 * navigation text and the Immediate Concerns button along with it.
 *
 * Gated behind @supports so browsers without backdrop-filter keep the solid
 * green bar: without the blur, 90% green over busy page content costs more in
 * legibility than the effect is worth.
 */
@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
	.bf-header.is-stuck .bf-header__bar {
		background-color: var(--bf-primary-translucent);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
	}
}

/* Clear the admin bar when logged in, keeping the upward slide. Below 600px
 * WordPress un-fixes the admin bar, so the extra offset goes back to zero. */
.admin-bar .bf-header {
	top: calc(32px - var(--bf-top-h, 0px));
}

@media (max-width: 782px) {
	.admin-bar .bf-header {
		top: calc(46px - var(--bf-top-h, 0px));
	}
}

@media (max-width: 600px) {
	.admin-bar .bf-header {
		top: calc(-1 * var(--bf-top-h, 0px));
	}
}

/* -------------------------------------------------------------------------
 * Tablet and mobile
 * ---------------------------------------------------------------------- */

@media (max-width: 1199px) {
	.bf-header__top-inner {
		flex-wrap: wrap;
		align-items: center;
		min-height: 0;
		padding-block: 22px;
		row-gap: 14px;
	}

	.bf-header__brand {
		width: auto;
		justify-content: flex-start;
	}

	.bf-header__strapline {
		order: 3;
		flex-basis: 100%;
		align-items: center;
		margin-left: 0;
		padding-left: 0;
		border-left: 0;
		text-align: center;
	}

	.bf-header__contact {
		gap: 28px;
	}

	.bf-header__social {
		gap: 20px;
	}

	/* Navigation collapses behind the Menu button */

	.bf-header__bar-inner {
		justify-content: space-between;
		min-height: 0;
		padding-block: 14px;
		gap: 16px;
	}

	.bf-header__menu-toggle {
		display: inline-flex;
		order: 1;
	}

	.bf-header__cta {
		order: 2;
		min-width: 0;
		min-height: 56px;
		padding: 10px 22px;
		font-size: 13px;
	}

	.bf-nav {
		order: 3;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 20;
		display: none;
		background-color: var(--bf-primary);
		box-shadow: 0 18px 30px rgba(0, 0, 0, 0.16);
		max-height: calc(100vh - 100%);
		overflow-y: auto;
	}

	.bf-header.is-nav-open .bf-nav {
		display: block;
	}

	.bf-nav__list {
		flex-direction: column;
		align-items: stretch;
		flex-wrap: nowrap;
		padding-inline: var(--bf-gutter);
	}

	.bf-nav__list > li {
		flex-wrap: wrap;
		border-top: 1px solid rgba(255, 255, 255, 0.22);
	}

	.bf-nav__list > li:first-child {
		border-top: 0;
	}

	.bf-nav__list > li > a,
	.bf-nav .sub-menu a {
		flex: 1 1 auto;
		padding: 16px 4px;
		font-size: 15px;
	}

	.bf-nav__toggle,
	.bf-nav .sub-menu .bf-nav__toggle {
		padding: 16px 4px 16px 16px;
		color: var(--bf-white);
		opacity: 0.85;
	}

	.bf-nav__toggle svg,
	.bf-nav .sub-menu .bf-nav__toggle svg {
		width: 16px;
		transform: none;
	}

	/* Submenus stack inline instead of floating */

	.bf-nav .sub-menu,
	.bf-nav .sub-menu .sub-menu {
		position: static;
		display: none;
		flex-basis: 100%;
		min-width: 0;
		padding: 0 0 8px 16px;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.bf-nav li.is-open > .sub-menu {
		display: block;
	}

	.bf-nav li:hover > .sub-menu,
	.bf-nav li:focus-within > .sub-menu {
		display: none;
	}

	.bf-nav li.is-open:hover > .sub-menu,
	.bf-nav li.is-open:focus-within > .sub-menu {
		display: block;
	}

	.bf-nav .sub-menu a {
		color: var(--bf-white);
		font-weight: 500;
		padding-block: 12px;
	}

	.bf-nav .sub-menu li:hover > a,
	.bf-nav .sub-menu a:focus-visible {
		background: none;
		color: var(--bf-white);
		text-decoration: underline;
	}

	.bf-nav__list > li:hover,
	.bf-nav__list > li:focus-within {
		background-color: transparent;
	}

	.bf-nav__list > li.current-menu-item,
	.bf-nav__list > li.current-menu-ancestor,
	.bf-nav__list > li.current_page_item,
	.bf-nav__list > li.current_page_ancestor {
		background-color: transparent;
	}

	.bf-nav__list > li.current-menu-item > a,
	.bf-nav__list > li.current_page_item > a {
		text-decoration: underline;
		text-underline-offset: 5px;
	}
}

@media (max-width: 767px) {
	.bf-header__top-inner {
		padding-block: 18px;
	}

	.bf-header__contact {
		gap: 18px;
		padding-left: 12px;
	}

	.bf-header__phone-icon {
		width: 36px;
		height: 36px;
	}

	.bf-header__phone-icon svg {
		width: 17px;
		height: 17px;
	}

	.bf-header__google {
		display: none;
	}
}

@media (max-width: 575px) {
	.bf-header__brand img,
	.bf-header__brand .custom-logo {
		max-height: 48px;
	}

	.bf-header__social {
		display: none;
	}

	.bf-header__phone-number {
		font-size: 22px;
	}

	.bf-header__phone-hours {
		font-size: 13px;
	}

	.bf-header__strapline-primary {
		font-size: 20px;
	}

	.bf-header__strapline-secondary {
		font-size: 12px;
	}

	.bf-header__bar-inner {
		flex-wrap: wrap;
	}

	.bf-header__menu-toggle {
		order: 1;
		flex: 0 0 auto;
	}

	.bf-header__cta {
		order: 2;
		flex: 0 0 auto;
		min-height: 48px;
		padding: 10px 16px;
		font-size: 12px;
	}
}

@media (max-width: 380px) {
	.bf-header__cta {
		order: 3;
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bf-header *,
	.bf-header *::before,
	.bf-header *::after {
		transition-duration: 0.01ms !important;
	}
}
