/* BP Header widget styles
 *
 * Scoped to .bp-header. Uses logical properties for LTR/RTL.
 * Tokens from tokens.css drive colors. Mirrors the approved
 * Barbary Plante mockup:
 *   - utility bar: compact 32px deep-green strip
 *   - main bar:    1200px inner, ~76px tall
 *   - logo:        ~120px visual width
 *   - CTA:         pill, deep green, white text
 *   - mobile:      compact, no duplicate FR | AR
 */

.bp-header {
	--bp-header-bg:         var(--bp-bg);
	--bp-header-utility-bg: var(--bp-primary);
	--bp-header-utility-fg: var(--bp-fg-on-green);
	--bp-header-border:     var(--bp-border-soft);
	--bp-header-inner-max:  1200px;
	--bp-header-pad-block:  14px;
	--bp-header-pad-inline: 24px;
	--bp-header-fg:         var(--bp-fg);
	--bp-header-cta-bg:     var(--bp-primary);
	--bp-header-cta-fg:     var(--bp-fg-on-green);
	--bp-header-cta-hover:  var(--bp-accent);
	--bp-header-accent:     var(--bp-accent);

	background: var(--bp-header-bg);
	color: var(--bp-header-fg);
	position: relative;
	z-index: 40;
	border-block-end: 1px solid var(--bp-header-border);
}

.bp-header.is-sticky {
	position: sticky;
	top: 0;
}

/* ---------------- Inner container ---------------- */
.bp-header__inner {
	max-inline-size: var(--bp-header-inner-max);
	margin-inline: auto;
	padding-inline: var(--bp-header-pad-inline);
	display: flex;
	align-items: center;
	gap: 16px;
	min-block-size: 56px;
}

/* ---------------- Utility bar ---------------- */
.bp-header__utility {
	background: var(--bp-header-utility-bg);
	color: var(--bp-header-utility-fg);
	font-family: var(--bp-font-body);
	font-size: 12px;
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.bp-header__utility .bp-header__inner {
	min-block-size: 32px;
	gap: 14px;
	padding-block: 6px;
}

.bp-header__utility-start,
.bp-header__utility-end {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 16px;
}

.bp-header__utility-start { margin-inline-end: auto; }
.bp-header__utility-end   { margin-inline-start: auto; }

.bp-header__util-link {
	color: inherit;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 0;
	min-block-size: 28px;
	transition: color 150ms ease;
}

.bp-header__util-link:hover,
.bp-header__util-link:focus-visible {
	color: var(--bp-cream);
}

.bp-header__util-text {
	color: var(--bp-cream);
}

.bp-header__util-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--bp-cream);
}

.bp-header__util-text--pending {
	color: var(--bp-cream);
	opacity: 0.75;
	font-style: italic;
}

/* ---------------- Main desktop bar ---------------- */
.bp-header__main { background: var(--bp-header-bg); }

.bp-header__main .bp-header__inner {
	min-block-size: 76px;
	padding-block: var(--bp-header-pad-block);
	gap: 24px;
}

.bp-header__main.is-hidden { display: none; }

.bp-header__logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
	flex: 0 0 auto;
}

.bp-header__logo img {
	display: block;
	max-inline-size: 120px;
	block-size: auto;
	object-fit: contain;
}

.bp-header__logo-text {
	font-family: var(--bp-font-display);
	font-size: 22px;
	font-weight: 400;
	color: var(--bp-primary);
	letter-spacing: 0.01em;
}

/* ---------------- Primary menu (desktop) ---------------- */
.bp-header__nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
}

.bp-header__menu,
.bp-header__drawer-nav .bp-header__menu,
.bp-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
	justify-content: center;
}

.bp-header__menu > li {
	position: relative;
}

.bp-header__menu > li > a,
.bp-header__drawer-nav .bp-header__menu > li > a,
.bp-footer__menu > li > a {
	display: inline-flex;
	align-items: center;
	padding: 10px 4px;
	text-decoration: none;
	color: var(--bp-fg);
	font-family: var(--bp-font-body);
	font-weight: 500;
	font-size: 15px;
	letter-spacing: 0.005em;
	position: relative;
	transition: color 150ms ease;
}

.bp-header__menu > li > a::after,
.bp-header__drawer-nav .bp-header__menu > li > a::after {
	content: "";
	position: absolute;
	inset-inline-start: 4px;
	inset-inline-end: 4px;
	inset-block-end: 4px;
	block-size: 2px;
	background: var(--bp-header-accent);
	opacity: 0;
	transform: scaleX(0.6);
	transform-origin: center;
	transition: opacity 150ms ease, transform 150ms ease;
}

.bp-header__menu > li > a:hover,
.bp-header__menu > li > a:focus-visible,
.bp-header__menu > li.current-menu-item > a,
.bp-header__menu > li.current_page_item > a,
.bp-header__drawer-nav .bp-header__menu > li > a:hover,
.bp-header__drawer-nav .bp-header__menu > li > a:focus-visible,
.bp-footer__menu > li > a:hover,
.bp-footer__menu > li > a:focus-visible {
	color: var(--bp-accent);
}

.bp-header__menu > li > a:hover::after,
.bp-header__menu > li > a:focus-visible::after,
.bp-header__menu > li.current-menu-item > a::after,
.bp-header__menu > li.current_page_item > a::after {
	opacity: 1;
	transform: scaleX(1);
}

.bp-header__menu .sub-menu,
.bp-header__drawer-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 8px 0;
	min-inline-size: 200px;
	background: var(--bp-bg);
	border: 1px solid var(--bp-border-soft);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba( 31, 42, 31, 0.08 );
	position: absolute;
	inset-block-start: 100%;
	inset-inline-start: 0;
	z-index: 50;
}

.bp-header__menu .sub-menu li a,
.bp-header__drawer-nav .sub-menu li a {
	display: block;
	padding: 8px 14px;
	color: var(--bp-fg);
	font-size: 14px;
}

/* ---------------- Actions column (CTA + burger) ---------------- */
.bp-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-inline-start: auto;
	flex: 0 0 auto;
}

/* CTA button. */
.bp-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--bp-header-cta-bg);
	color: var(--bp-header-cta-fg);
	padding: 11px 22px;
	border-radius: 999px;
	font-family: var(--bp-font-body);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.01em;
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease;
	min-block-size: 44px;
	white-space: nowrap;
	border: 0;
}

.bp-header__cta:hover,
.bp-header__cta:focus-visible {
	background: var(--bp-header-cta-hover);
	color: var(--bp-fg);
}

/* Burger. */
.bp-header__burger {
	display: none;
	background: transparent;
	border: 0;
	padding: 10px;
	cursor: pointer;
	flex-direction: column;
	gap: 4px;
	min-block-size: 44px;
	min-inline-size: 44px;
	align-items: center;
	justify-content: center;
}

.bp-header__burger-line {
	display: block;
	inline-size: 22px;
	block-size: 2px;
	background: var(--bp-fg);
	border-radius: 2px;
	transition: transform 200ms ease, opacity 200ms ease;
}

.bp-header__burger[aria-expanded="true"] .bp-header__burger-line:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}
.bp-header__burger[aria-expanded="true"] .bp-header__burger-line:nth-child(2) {
	opacity: 0;
}
.bp-header__burger[aria-expanded="true"] .bp-header__burger-line:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* ---------------- Mobile drawer ---------------- */
.bp-header__drawer {
	background: var(--bp-bg);
	border-block-start: 1px solid var(--bp-header-border);
	padding: 16px 20px 24px;
}

.bp-header__drawer[hidden] { display: none; }

.bp-header__drawer-nav {
	display: block;
}

.bp-header__drawer-nav .bp-header__menu {
	flex-direction: column;
	gap: 0;
	align-items: stretch;
}

.bp-header__drawer-nav .bp-header__menu > li > a {
	padding: 14px 4px;
	font-size: 16px;
	border-block-end: 1px solid var(--bp-header-border);
}

.bp-header__cta--drawer {
	margin-block-start: 16px;
	inline-size: 100%;
}

.bp-header__drawer-link {
	display: block;
	margin-block-start: 12px;
	color: var(--bp-fg);
	text-decoration: none;
	font-weight: 500;
	padding: 12px 0;
	border-block-end: 1px solid var(--bp-header-border);
}

.bp-header__drawer-lang {
	margin-block-start: 16px;
	color: var(--bp-fg);
}

/* ---------------- Responsive ---------------- */
@media ( max-width: 1024px ) {
	.bp-header__nav,
	.bp-header__lang--desktop {
		display: none;
	}
	.bp-header__burger { display: inline-flex; }
	.bp-header__actions { gap: 8px; }
	.bp-header__main .bp-header__inner { gap: 12px; }
}

@media ( max-width: 768px ) {
	.bp-header__utility { display: none; }
	.bp-header__main .bp-header__inner {
		min-block-size: 64px;
		gap: 8px;
		padding-inline: 16px;
	}
	.bp-header__logo img { max-inline-size: 110px; }
	/* On phone-width, the header bar only carries logo + burger.
	   CTA moves to the mobile drawer to avoid overflow. */
	.bp-header__main .bp-header__cta { display: none; }
	.bp-header__actions { gap: 0; margin-inline-start: auto; }
	.bp-header__burger { display: inline-flex; }
}

@media ( max-width: 480px ) {
	.bp-header__main .bp-header__inner { padding-inline: 14px; }
	.bp-header__logo img { max-inline-size: 100px; }
}

@media ( max-width: 380px ) {
	.bp-header__logo img { max-inline-size: 92px; }
	.bp-header__main .bp-header__inner { padding-inline: 12px; gap: 6px; }
}

/* Reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.bp-header *,
	.bp-header *::before,
	.bp-header *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}
