.dictech-header {
	--dictech-header-height: 4.75rem;
	position: sticky;
	top: 0;
	z-index: var(--dictech-z-sticky);
	border-bottom: 1px solid rgb(23 33 27 / 8%);
	background: rgb(255 255 255 / 96%);
	box-shadow: 0 0.25rem 1.5rem rgb(23 33 27 / 5%);
	backdrop-filter: blur(0.75rem);
}

.admin-bar .dictech-header {
	top: 32px;
}

.dictech-header__bar {
	display: grid;
	min-height: var(--dictech-header-height);
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: clamp(1rem, 2.5vw, 2.25rem);
	align-items: center;
}

.dictech-header__brand {
	display: inline-flex;
	min-width: 7rem;
	align-items: center;
	color: var(--dictech-color-primary);
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-decoration: none;
}

.dictech-header__brand:hover {
	color: var(--dictech-color-primary-dark);
}

.dictech-header__logo {
	width: auto;
	max-width: 10rem;
	height: auto;
	max-height: 3.25rem;
	object-fit: contain;
}

.dictech-header__logo--mobile {
	display: none;
}

.dictech-header__desktop-nav {
	min-width: 0;
}

.dictech-header__menu,
.dictech-header__menu ul,
.dictech-header__mobile-menu,
.dictech-header__mobile-menu ul {
	padding: 0;
	margin: 0;
	list-style: none;
}

.dictech-header__menu {
	display: flex;
	gap: clamp(0.85rem, 1.65vw, 1.75rem);
	align-items: stretch;
	justify-content: center;
}

.dictech-header__menu > li {
	position: relative;
	display: flex;
	align-items: stretch;
}

.dictech-header__menu a {
	position: relative;
	display: flex;
	min-height: var(--dictech-header-height);
	align-items: center;
	color: var(--dictech-color-ink);
	font-size: 0.94rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.dictech-header__menu > li > a::after {
	position: absolute;
	right: 0;
	bottom: 0.7rem;
	left: 0;
	height: 2px;
	background: var(--dictech-color-accent);
	content: "";
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 160ms ease;
}

.dictech-header__menu > li > a:hover::after,
.dictech-header__menu > .current-menu-item > a::after,
.dictech-header__menu > .current-menu-ancestor > a::after {
	transform: scaleX(1);
}

.dictech-header__menu .sub-menu {
	position: absolute;
	top: calc(100% - 0.4rem);
	left: -1rem;
	z-index: var(--dictech-z-dropdown);
	display: none;
	width: max-content;
	min-width: 14rem;
	max-width: 20rem;
	padding: 0.55rem;
	border: 1px solid var(--dictech-color-border);
	border-radius: var(--dictech-radius-sm);
	background: var(--dictech-color-surface);
	box-shadow: var(--dictech-shadow-md);
}

.dictech-header__menu .sub-menu .sub-menu {
	top: -0.55rem;
	left: calc(100% + 0.55rem);
}

.dictech-header__menu li:hover > .sub-menu,
.dictech-header__menu li:focus-within > .sub-menu {
	display: block;
}

.dictech-header__menu .sub-menu a {
	min-height: auto;
	padding: 0.65rem 0.8rem;
	border-radius: 0.25rem;
	white-space: normal;
}

.dictech-header__menu .sub-menu a:hover,
.dictech-header__menu .sub-menu .current-menu-item > a {
	background: var(--dictech-color-surface-soft);
	color: var(--dictech-color-primary);
}

.dictech-header__actions {
	display: flex;
	gap: 0.7rem;
	align-items: center;
	justify-content: flex-end;
}

.dictech-header__icon-button,
.dictech-header__menu-toggle,
.dictech-header__mobile-close {
	display: inline-grid;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--dictech-color-primary-dark);
	cursor: pointer;
	place-items: center;
}

.dictech-header__icon-button:hover,
.dictech-header__menu-toggle:hover,
.dictech-header__mobile-close:hover {
	background: var(--dictech-color-surface-soft);
}

.dictech-header__cta,
.dictech-header__mobile-cta {
	display: inline-flex;
	min-height: 2.8rem;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.7rem 1.2rem;
	border: 1px solid var(--dictech-color-accent);
	border-radius: var(--dictech-radius-sm);
	background: var(--dictech-color-accent);
	box-shadow: 0 0.35rem 1rem rgb(245 131 31 / 20%);
	color: var(--dictech-color-surface);
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.dictech-header__cta:hover,
.dictech-header__mobile-cta:hover {
	border-color: #d96808;
	background: #d96808;
	color: var(--dictech-color-surface);
}

.dictech-header__menu-toggle {
	display: none;
	border-radius: var(--dictech-radius-sm);
}

.dictech-header__menu-toggle > span[aria-hidden="true"] {
	display: block;
	width: 1.45rem;
	height: 2px;
	margin-block: 0.18rem;
	background: currentColor;
	transition: transform 160ms ease, opacity 160ms ease;
}

.dictech-header.is-open .dictech-header__menu-toggle > span[aria-hidden="true"]:nth-of-type(1) {
	transform: translateY(0.36rem) rotate(45deg);
}

.dictech-header.is-open .dictech-header__menu-toggle > span[aria-hidden="true"]:nth-of-type(2) {
	opacity: 0;
}

.dictech-header.is-open .dictech-header__menu-toggle > span[aria-hidden="true"]:nth-of-type(3) {
	transform: translateY(-0.36rem) rotate(-45deg);
}

.dictech-header__search-panel {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: var(--dictech-z-dropdown);
	display: none;
	padding-block: 0.9rem;
	border-top: 1px solid var(--dictech-color-border);
	background: var(--dictech-color-surface);
	box-shadow: var(--dictech-shadow-md);
}

.dictech-header.is-search-open .dictech-header__search-panel {
	display: block;
}

.dictech-header__search-form {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 0.75rem;
	align-items: center;
	padding: 0.45rem 0.45rem 0.45rem 0.85rem;
	border: 1px solid var(--dictech-color-border);
	border-radius: var(--dictech-radius-sm);
	background: var(--dictech-color-surface);
	color: var(--dictech-color-muted);
}

.dictech-header__search-form:focus-within {
	border-color: var(--dictech-color-primary);
	box-shadow: 0 0 0 3px rgb(0 125 63 / 12%);
}

.dictech-header__search-form input {
	min-width: 0;
	height: 2.5rem;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--dictech-color-ink);
}

.dictech-header__search-form button {
	min-height: 2.5rem;
	padding: 0.55rem 1rem;
	border: 1px solid var(--dictech-color-primary);
	border-radius: 0.3rem;
	background: var(--dictech-color-primary);
	color: var(--dictech-color-surface);
	font-weight: 700;
	cursor: pointer;
}

.dictech-header__backdrop,
.dictech-header__mobile-panel {
	display: none;
}

.dictech-header__search-panel[hidden],
.dictech-header__mobile-panel[hidden] {
	display: none;
}

body.dictech-navigation-open {
	overflow: hidden;
}

body.dictech-navigation-open .wp-elce {
	pointer-events: none;
	visibility: hidden;
}

@media (max-width: 63.99rem) {
	.dictech-header {
		--dictech-header-height: 4rem;
		/* Keep fixed drawer layers relative to the viewport on mobile. */
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		background: var(--dictech-color-surface);
	}

	.dictech-header__bar {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.dictech-header__desktop-nav,
	.dictech-header__icon-button,
	.dictech-header__cta {
		display: none;
	}

	.dictech-header__menu-toggle {
		display: inline-grid;
	}

	.dictech-header__logo {
		max-width: 8.5rem;
		max-height: 2.75rem;
	}

	.dictech-header__logo--desktop {
		display: none;
	}

	.dictech-header__logo--mobile {
		display: block;
	}

	.dictech-header__mobile-panel {
		display: grid;
		gap: 1.25rem;
		padding: 1rem var(--dictech-gutter) 1.5rem;
		border-top: 1px solid var(--dictech-color-border);
		background: var(--dictech-color-surface);
	}

	.dictech-header.is-navigation-ready .dictech-header__mobile-panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: var(--dictech-z-modal);
		width: min(88vw, 25rem);
		overflow-y: auto;
		border-top: 0;
		box-shadow: var(--dictech-shadow-md);
		transform: translateX(102%);
		transition: transform 200ms ease;
	}

	.dictech-header.is-navigation-ready.is-open .dictech-header__mobile-panel {
		display: grid;
		transform: translateX(0);
	}

	.dictech-header__backdrop {
		position: fixed;
		inset: 0;
		z-index: var(--dictech-z-overlay);
		width: 100%;
		height: 100%;
		padding: 0;
		border: 0;
		background: rgb(23 33 27 / 52%);
		cursor: pointer;
	}

	.dictech-header.is-navigation-ready.is-open .dictech-header__backdrop {
		display: block;
	}

	.dictech-header__mobile-heading {
		display: flex;
		min-height: 2.75rem;
		align-items: center;
		justify-content: space-between;
		color: var(--dictech-color-primary-dark);
		font-size: 1.2rem;
	}

	.dictech-header__mobile-menu > li {
		border-bottom: 1px solid var(--dictech-color-border);
	}

	.dictech-header__mobile-menu a {
		display: block;
		padding: 0.8rem 0.25rem;
		color: var(--dictech-color-ink);
		font-weight: 650;
		text-decoration: none;
	}

	.dictech-header__mobile-menu .current-menu-item > a,
	.dictech-header__mobile-menu .current-menu-ancestor > a {
		color: var(--dictech-color-primary);
	}

	.dictech-header__mobile-menu .sub-menu {
		padding: 0 0 0.65rem 1rem;
	}

	.dictech-header__mobile-menu .sub-menu a {
		padding-block: 0.55rem;
		color: var(--dictech-color-muted);
		font-size: 0.94rem;
		font-weight: 500;
	}

	.dictech-header__mobile-cta {
		width: 100%;
	}
}

@media (max-width: 782px) {
	.admin-bar .dictech-header {
		top: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dictech-header__menu > li > a::after,
	.dictech-header__menu-toggle > span[aria-hidden="true"],
	.dictech-header.is-navigation-ready .dictech-header__mobile-panel {
		transition: none;
	}
}
