/* ---------- language strip ---------- */
.langbar {
	position: relative;
	z-index: 30;
	min-height: 30px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	/* the whole header block is navy on inner pages, like the old template */
	background: var(--navy);
}

.header-float .langbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	background: transparent;
}

/* WordPress 的工具栏是 position:fixed，核心只给 html 加了 margin-top，
   而我们这两块（语言条 + 浮动页头）是 absolute、相对视口定位，不会跟着下移，
   于是登录状态下语言条被工具栏盖住（国旗看不见）。补一个偏移。 */
body.admin-bar.header-float .langbar,
body.admin-bar .site-header--float {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar.header-float .langbar,
	body.admin-bar .site-header--float {
		top: 46px;
	}
}

.langbar__inner {
	width: 100%;
	padding: 0 var(--gutter);
	box-sizing: border-box;
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
}

.langbar__list {
	display: flex;
	align-items: flex-end;
}

.langbar__list a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 1.5rem;
	padding: 13px 5px;
	line-height: 1.5;
	font-size: 0.9rem;
	color: var(--ink);
}

.langbar__list li {
	margin: 0;
}

.langbar__list .trp-ls-language-name {
	display: none;
}

.langbar__list img {
	width: 24px;
	height: auto;
	transition: transform 0.3s ease;
}

.langbar__list a:hover img {
	transform: scale(1.2);
}

/* ---------- header bar ---------- */
.site-header {
	position: relative;
	z-index: 40;
}

.site-header--float {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
}

.site-header__bar {
	height: 90px;
	display: flex;
	align-items: center;
	background: var(--navy);
	transition: height 0.4s ease, background 0.4s ease;
}

.site-header--float .site-header__bar {
	background: transparent;
	margin-top: 30px;
}

.site-header:not(.site-header--float) .site-header__bar {
	margin-top: -20px;
}

/* LP family (live uses Elementor header 6977): a plain navy bar with the quote
   button and no site navigation, sitting in the flow instead of floating over
   the hero. 78px is the live height; the -20px pull above does not apply here. */
/* the -20px pull above is (0,3,0), so this needs the extra class to win */
.site-header.site-header--solid .site-header__bar {
	height: 78px;
	margin-top: 0;
}

.site-header--solid .mainnav,
.site-header--solid .iconbtn--search {
	display: none;
}

/* same content column as the page body (see main > .sec in landing.css) */
.site-header--solid .site-header__inner {
	padding: 0 var(--gutter);
}

.site-header--solid .site-header__cta {
	display: inline-flex;
	align-items: center;
	margin-left: auto;
	padding: 0.7rem 1.7rem;
	border-radius: 999px;
	background: var(--white);
	color: var(--navy);
	font-family: var(--font-head);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.25s;
}

.site-header--solid .site-header__cta:hover {
	background: #e9e9ec;
}

.site-header.is-stuck {
	/* keep the space the bar used to occupy so the page does not jump */
	height: 90px;
}

/* the fixed bar on inner pages sat 20px higher thanks to a negative margin */
.site-header:not(.site-header--float).is-stuck {
	height: 70px;
}

.site-header.is-stuck .site-header__bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	margin-top: 0;
	background: var(--navy);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	z-index: 60;
}

.site-header.is-stuck .site-header__logo img {
	transform: scale(0.8);
}

.site-header__inner {
	width: 100%;
	padding: 0 var(--gutter);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.site-header__logo {
	display: block;
	width: 20%;
}

.site-header__logo img {
	width: 90%;
	max-width: 217px;
	height: auto;
	transition: transform 0.4s ease;
	transform-origin: left center;
}

.site-header__tools {
	width: 80%;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.mainnav__list {
	display: flex;
	align-items: center;
}

.mainnav__list a {
	position: relative;
	display: block;
	padding: 13px 1rem;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--white);
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

.mainnav__list a:hover {
	opacity: 0.85;
}

/* current item keeps the white label and gets the orange bar, like the old site */
.mainnav__list .current-menu-item > a {
	color: var(--white);
}

.mainnav__list .current-menu-item > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--orange);
}

.iconbtn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 33px;
	height: 33px;
	margin-left: 0;
	color: var(--white);
}

.iconbtn--burger {
	display: none;
	width: 40px;
	height: 40px;
}

/* ---------- search panel ---------- */
.site-search {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 70;
	background: var(--white);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	padding: 1.5rem 0;
}

.site-search__inner {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 var(--gutter);
	display: flex;
	gap: 0.6rem;
	box-sizing: border-box;
}

.site-search__inner input {
	flex: 1;
}

/* ---------- mobile drawer ---------- */
.drawer {
	position: fixed;
	inset: 0;
	z-index: 90;
	display: flex;
	justify-content: flex-end;
}

.drawer[hidden] {
	display: none;
}

.drawer__panel {
	position: relative;
	/* above the backdrop: they are siblings and the backdrop spans the whole
	   drawer, so without this it swallows every tap on the links */
	z-index: 1;
	width: min(360px, 84vw);
	height: 100%;
	background: var(--navy);
	color: var(--white);
	padding: 4rem 1.5rem 1.5rem;
	box-sizing: border-box;
	overflow-y: auto;
}

.drawer__close {
	position: absolute;
	top: 0.9rem;
	right: 1rem;
	font-size: 2rem;
	line-height: 1;
	color: var(--white);
}

.drawer__list a {
	display: block;
	padding: 0.9rem 0;
	font-size: 1.2rem;
	color: var(--white);
	border-bottom: 2px solid var(--orange);
}

.drawer__search {
	display: flex;
	margin-top: 1.5rem;
	gap: 0.4rem;
}

.drawer__search input {
	flex: 1;
}

.drawer__backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: rgba(0, 0, 0, 0.55);
	border: 0;
}

body.drawer-open {
	overflow: hidden;
}

/* ---------- drawer: sub-lists + language strip ---------- */
.drawer__list .menu-item-has-children {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	border-bottom: 2px solid var(--orange);
}

.drawer__list .menu-item-has-children > a {
	flex: 1;
	border-bottom: 0;
}

/* the caret is its own button so the category link itself still navigates */
.drawer__sub-toggle {
	flex: none;
	width: 2.6rem;
	height: 2.6rem;
	position: relative;
	color: var(--white);
}

.drawer__sub-toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	margin: -6px 0 0 -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.25s ease;
}

.menu-item-has-children.is-open > .drawer__sub-toggle::after {
	transform: rotate(-135deg);
}

.drawer__list .sub-menu {
	display: none;
	flex: 0 0 100%;
	padding: 0 0 0.8rem 0.6rem;
}

.menu-item-has-children.is-open > .sub-menu {
	display: block;
}

.drawer__list .sub-menu a {
	padding: 0.6rem 0;
	font-size: 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.drawer__langs {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.drawer__langs .langbar__list {
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 0.2rem;
}

.drawer__langs .langbar__list a {
	padding: 5px 4px;
}

.drawer__langs .langbar__list img {
	width: 20px;
}

.drawer__langs .langbar__list a:hover img {
	transform: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
	.langbar__list a {
		padding: 13px 2px;
	}


	/* keep the floating bar transparent over the hero on tablets/phones too; the
	   .is-stuck rule below paints it navy once the page scrolls */
	.site-header--float .site-header__bar {
		margin-top: 0;
	}

	.site-header__logo {
		width: 50%;
	}

	.site-header__logo img {
		width: 100%;
		max-width: 241px;
	}

	.site-header__tools {
		width: 50%;
	}

	.mainnav {
		display: none;
	}

	/* tablet and below: the search lives in the drawer, like the old site */
	.iconbtn--search {
		display: none;
	}

	.iconbtn--burger {
		display: flex;
	}
}

@media (max-width: 767px) {
	/* language strip is desktop-only on the old site */
	.langbar {
		display: none;
	}

	.site-header--float .site-header__bar,
	.site-header:not(.site-header--float) .site-header__bar {
		height: 60px;
		margin-top: 0;
	}

	.site-header.is-stuck,
	.site-header:not(.site-header--float).is-stuck {
		height: 60px;
	}

	/* 50% of the bar made the mark 53px tall inside a 60px bar, so it touched the
	   top and bottom edges; cap the height instead and let the width follow */
	.site-header__logo {
		width: auto;
	}

	.site-header__logo img {
		width: auto;
		max-width: 100%;
		max-height: 34px;
	}

	.site-header__tools {
		width: auto;
	}
}

/* ---------- wide screens ---------- */
/* header content sits in the same 1920px box as the page bands: capped width,
   centred, with a fixed 8%-of-the-box gutter so the logo lines up with them */
@media (min-width: 1921px) {
	.site-header__inner,
	/* the LP header sets its own shorthand (0 var(--gutter)) and outranks the
	   rule below, so it needs naming too or its CTA drifts right with the logo */
	.site-header--solid .site-header__inner,
	.langbar__inner {
		max-width: 1920px;
		margin-left: auto;
		margin-right: auto;
		padding-left: 153.6px;
		padding-right: 153.6px;
	}
}

/* ---------- wide screens ---------- */
/* the 1rem per side on each link made the menu row look cramped past 1440:
   let the spacing grow with the viewport (39 / 52 / 69px between items) */
@media (min-width: 1440px) {
	.mainnav__list a {
		padding-left: clamp(1rem, 1.35vw, 36px);
		padding-right: clamp(1rem, 1.35vw, 36px);
	}
}
