/* ==========================================================================
   Header / Desktop + Header / Mobile, nav dropdowns, language switcher, drawer
   ========================================================================== */

body {
	padding-top: var(--header-h);
}

body.has-header-transparent {
	padding-top: 0;
}

.axn-header {
	position: fixed;
	inset: 0 0 auto;
	z-index: 100;
	color: var(--text-primary);
}

.admin-bar .axn-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.axn-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-24);
	height: var(--header-h);
	padding: 0 max(var(--page-margin), (100% - var(--container-max)) / 2);
	background: var(--surface-page);
	border-bottom: 1px solid var(--border-subtle);
	transition: height var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* Transparent: over the navy / dark-media hero, Dark theme mode. */
.axn-header.is-transparent .axn-header__bar {
	background: transparent;
	border-bottom-color: transparent;
}

/* Scrolled always falls back to the Light treatment. */
.axn-header.is-scrolled .axn-header__bar {
	height: var(--header-h-scrolled);
	background: var(--c-white);
	border-bottom-color: var(--c-neutral-200);
	box-shadow: var(--shadow-header);
}

.axn-header.is-scrolled {
	--surface-page: var(--c-white);
	--text-primary: var(--c-navy);
	--text-secondary: var(--c-neutral-700);
	--text-link: var(--c-dark-blue);
	--border-subtle: var(--c-neutral-200);
	--border-default: var(--c-neutral-300);
	--border-focus: var(--c-navy);
	--action-cta-edge: var(--c-cta-blue-edge);
	--surface-raised: var(--c-neutral-075);
}

/* Logo: Original on light, White on transparent. 236×22, true ratio 10.74:1. */
.axn-header__logo {
	display: block;
	flex: none;
	line-height: 0;
}

.axn-header__logo .axn-logo {
	width: 236px;
	height: auto;
}

.axn-header__logo-dark,
.axn-header.is-transparent:not(.is-scrolled) .axn-header__logo-light {
	display: none;
}

.axn-header.is-transparent:not(.is-scrolled) .axn-header__logo-dark {
	display: block;
}

/* ---------- Primary nav ---------- */
.axn-nav__list {
	display: flex;
	align-items: center;
	gap: var(--space-32);
	margin: 0;
	padding: 0;
	list-style: none;
}

.axn-nav__item {
	position: relative;
}

.axn-nav__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-4);
	padding: 0;
	border: 0;
	background: none;
	color: var(--text-primary);
	font-size: var(--type-nav-size);
	line-height: var(--type-nav-line);
	font-weight: 500;
	letter-spacing: -0.0025em;
	text-decoration: none;
	cursor: pointer;
}

/* The hover/current rule sits 6px below the label. Current never relies on colour alone:
   it also sets weight 600. */
.axn-nav__label {
	position: relative;
}

.axn-nav__label::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -8px;
	height: 2px;
	background: transparent;
	transition: background-color var(--dur-fast) var(--ease);
}

.axn-nav__link:hover .axn-nav__label::after,
.axn-nav__trigger[aria-expanded="true"] .axn-nav__label::after {
	background: var(--c-logo-blue);
}

.axn-nav__link.is-current {
	font-weight: 600;
}

.axn-nav__link.is-current .axn-nav__label::after {
	background: var(--text-primary);
}

.is-dark .axn-nav__link.is-current .axn-nav__label::after {
	background: var(--c-light-blue);
}

.axn-nav__chevron {
	width: 16px;
	height: 16px;
	transition: transform var(--dur) var(--ease);
}

.axn-nav__trigger[aria-expanded="true"] .axn-nav__chevron {
	transform: rotate(180deg);
}

/* ---------- Nav dropdown panel (always light, floats over the page) ---------- */
.axn-dropdown {
	position: absolute;
	top: calc(100% + (var(--header-h) - var(--type-nav-line)) / 2 + 12px);
	left: -24px;
	width: 380px;
	display: flex;
	flex-direction: column;
	gap: var(--space-16);
	padding: var(--space-24);
	border: 1px solid var(--c-neutral-200);
	border-radius: var(--radius-12);
	background: var(--c-white);
	box-shadow: var(--shadow-overlay);
	color: var(--c-navy);
}

.axn-header.is-scrolled .axn-dropdown {
	top: calc(100% + (var(--header-h-scrolled) - var(--type-nav-line)) / 2 + 12px);
}

.axn-dropdown[hidden] {
	display: none;
}

/* Invisible bridge over the gap to the trigger so hover survives the move into the panel. */
.axn-dropdown::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 40px;
}

@media (prefers-reduced-motion: no-preference) {
	.axn-dropdown:not([hidden]),
	.axn-lang__menu:not([hidden]) {
		animation: axn-pop var(--dur) var(--ease);
	}
}

@keyframes axn-pop {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

.axn-dropdown__items {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	margin: 0;
	padding: 0;
	list-style: none;
}

.axn-dropdown__item {
	display: flex;
	align-items: flex-start;
	gap: var(--space-12);
	padding: var(--space-12);
	border-radius: var(--radius-8);
	color: var(--c-navy);
	text-decoration: none;
	transition: background-color var(--dur-fast) var(--ease);
}

.axn-dropdown__item:hover,
.axn-dropdown__item[aria-current="page"] {
	background: var(--c-neutral-075);
}

.axn-dropdown__item:focus-visible {
	outline: 2px solid var(--c-navy);
	outline-offset: -2px;
}

.axn-dropdown__chip {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-8);
	background: var(--c-pale-blue);
	color: var(--c-logo-blue);
}

.axn-dropdown__chip .axn-icon {
	width: 24px;
	height: 24px;
}

.axn-dropdown__text {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	min-width: 0;
}

.axn-dropdown__title {
	font-size: var(--type-body-m-size);
	line-height: var(--type-body-m-line);
	font-weight: 600;
}

.axn-dropdown__desc {
	font-size: var(--type-body-s-size);
	line-height: var(--type-body-s-line);
	color: var(--c-neutral-700);
}

.axn-dropdown__footer {
	padding-top: var(--space-12);
	border-top: 1px solid var(--c-neutral-200);
	padding-inline: var(--space-12);
}

.axn-dropdown__footer .axn-arrow-link {
	margin-top: var(--space-12);
	color: var(--c-dark-blue);
}

/* ---------- Actions ---------- */
.axn-header__actions {
	display: flex;
	align-items: center;
	gap: var(--space-16);
	flex: none;
}

.axn-icon-btn {
	display: inline-grid;
	place-items: center;
	width: var(--touch-min);
	height: var(--touch-min);
	padding: 0;
	border: 0;
	border-radius: var(--radius-8);
	background: transparent;
	color: var(--text-primary);
	cursor: pointer;
	transition: background-color var(--dur-fast) var(--ease);
}

.axn-icon-btn:hover {
	background: var(--surface-raised);
}

.axn-icon-btn .axn-icon {
	width: 20px;
	height: 20px;
}

/* Size S: 36px visible, 44px hit area via invisible padding. */
.axn-icon-btn--s {
	width: var(--control-s);
	height: var(--control-s);
	position: relative;
	color: var(--text-link);
}

.axn-icon-btn--s::before {
	content: "";
	position: absolute;
	inset: -4px;
}

.axn-header__menu-btn {
	display: none;
}

/* ---------- Language switcher: dropdown ---------- */
.axn-lang {
	position: relative;
}

.axn-lang__trigger {
	display: inline-flex;
	align-items: center;
	gap: var(--space-8);
	height: 40px;
	padding: 0 var(--space-12);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-8);
	background: var(--surface-page);
	color: var(--text-primary);
	cursor: pointer;
	transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.axn-header.is-transparent:not(.is-scrolled) .axn-lang__trigger {
	background: transparent;
	border-color: var(--border-subtle);
}

.axn-lang__trigger:hover {
	background: var(--surface-raised);
	border-color: var(--border-strong);
}

.axn-lang__trigger[aria-expanded="true"] {
	border-color: var(--border-focus);
}

.axn-lang__globe {
	width: 20px;
	height: 20px;
	color: var(--text-secondary);
}

.axn-lang__code {
	font-size: var(--type-meta-size);
	line-height: var(--type-meta-line);
	font-weight: 500;
	letter-spacing: 0.02em;
}

.axn-lang__chevron {
	width: 16px;
	height: 16px;
	color: var(--text-secondary);
	transition: transform var(--dur) var(--ease);
}

.axn-lang__trigger[aria-expanded="true"] .axn-lang__chevron {
	transform: rotate(180deg);
}

.axn-lang__menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 200px;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0;
	padding: var(--space-6);
	list-style: none;
	border: 1px solid var(--c-neutral-300);
	border-radius: var(--radius-12);
	background: var(--c-white);
	box-shadow: var(--shadow-overlay);
	color: var(--c-navy);
}

.axn-lang__menu[hidden] {
	display: none;
}

.axn-lang__row {
	display: flex;
	align-items: center;
	gap: var(--space-10);
	height: 44px;
	padding: 0 var(--space-12);
	border-radius: var(--radius-8);
	color: var(--c-navy);
	text-decoration: none;
}

.axn-lang__row:hover,
.axn-lang__row[aria-current="true"] {
	background: var(--c-neutral-075);
}

.axn-lang__row:focus-visible {
	outline: 2px solid var(--c-navy);
	outline-offset: -2px;
}

.axn-lang__check {
	width: 16px;
	height: 16px;
	color: var(--c-dark-blue);
}

.axn-lang__check .axn-icon {
	width: 16px;
	height: 16px;
}

.axn-lang__name {
	flex: 1;
	font-size: var(--type-body-m-size);
	line-height: var(--type-body-m-line);
}

.axn-lang__row[aria-current="true"] .axn-lang__name {
	font-weight: 600;
}

.axn-lang__row-code {
	font-size: var(--type-meta-size);
	line-height: var(--type-meta-line);
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--c-neutral-700);
}

/* ---------- Language switcher: inline (footer, drawer) ---------- */
.axn-lang-inline ul {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.axn-lang-inline li + li {
	display: flex;
	align-items: center;
}

.axn-lang-inline li + li::before {
	content: "";
	width: 1px;
	height: 14px;
	margin: 0 var(--space-2);
	background: var(--border-subtle);
}

.axn-lang-inline a {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: var(--space-6) var(--space-10);
	color: var(--text-secondary);
	font-size: var(--type-meta-size);
	line-height: var(--type-meta-line);
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
}

.axn-lang-inline a:hover {
	color: var(--text-primary);
}

.axn-lang-inline a[aria-current="true"] {
	color: var(--text-primary);
	font-weight: 600;
}

.axn-lang-inline a[aria-current="true"]::after {
	content: "";
	position: absolute;
	left: var(--space-10);
	right: var(--space-10);
	bottom: calc(50% - 9px - 4px);
	height: 2px;
	background: var(--c-light-blue);
}

/* ---------- Mobile header (< 1024) ---------- */
@media (max-width: 1023px) {
	.axn-header__logo .axn-logo {
		width: 172px;
	}

	.axn-nav,
	.axn-header__cta {
		display: none;
	}

	.axn-header__actions {
		gap: var(--space-4);
	}

	.axn-header__menu-btn {
		display: inline-grid;
	}

	/* Language trigger collapses to a 44px globe icon button. */
	.axn-lang__trigger,
	.axn-header.is-transparent:not(.is-scrolled) .axn-lang__trigger {
		width: var(--touch-min);
		height: var(--touch-min);
		padding: 0;
		justify-content: center;
		border-color: transparent;
		background: transparent;
	}

	.axn-lang__code,
	.axn-lang__chevron {
		display: none;
	}

	.axn-lang__globe {
		color: var(--text-primary);
	}
}

/* ---------- Mobile nav drawer (Dark theme mode) ---------- */
.axn-drawer {
	position: fixed;
	inset: 0;
	z-index: 200;
}

.axn-drawer[hidden] {
	display: none;
}

.axn-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: var(--c-navy);
	opacity: 0.6;
}

.axn-drawer__panel {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden auto;
	background: var(--surface-page);
	color: var(--text-primary);
}

@media (prefers-reduced-motion: no-preference) {
	.axn-drawer__panel {
		transition: transform 280ms var(--ease), opacity 280ms var(--ease);
	}

	.axn-drawer:not(.is-open) .axn-drawer__panel {
		transform: translateX(100%);
		opacity: 0;
	}

	.axn-drawer__sub {
		transition: transform 280ms var(--ease);
	}
}

.axn-drawer__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: none;
	height: 64px;
	padding: 0 var(--space-20);
}

.axn-drawer__logo .axn-logo {
	width: 172px;
	height: auto;
}

.axn-drawer__body {
	flex: 1;
	padding: var(--space-20);
}

.axn-drawer__rows {
	margin: 0 0 var(--space-32);
	padding: 0;
	list-style: none;
}

.axn-drawer__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 60px;
	padding: 0;
	border: 0;
	border-bottom: 1px solid var(--border-subtle);
	background: none;
	color: var(--text-primary);
	font-family: var(--font-display);
	font-size: var(--type-h4-size);
	line-height: var(--type-h4-line);
	font-weight: 600;
	letter-spacing: -0.01em;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.axn-drawer__row .axn-icon {
	width: 24px;
	height: 24px;
	color: var(--text-secondary);
}

.axn-drawer__cta {
	width: 100%;
}

.axn-drawer__footer {
	display: flex;
	flex-direction: column;
	gap: var(--space-20);
	padding: var(--space-20);
	border-top: 1px solid var(--border-subtle);
}

.axn-drawer__footer .axn-lang-inline {
	margin-left: calc(-1 * var(--space-10));
}

.axn-drawer__contact {
	font-size: var(--type-body-s-size);
	line-height: var(--type-body-s-line);
	color: var(--text-secondary);
}

/* Second level slides over the first. */
.axn-drawer__sub {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: var(--surface-page);
}

.axn-drawer__sub[hidden] {
	display: flex;
	transform: translateX(100%);
	visibility: hidden;
}

.axn-drawer__back {
	display: flex;
	align-items: center;
	gap: var(--space-12);
	flex: none;
	height: 60px;
	padding: 0 var(--space-20);
	border: 0;
	border-bottom: 1px solid var(--border-subtle);
	background: none;
	color: var(--text-primary);
	font-size: var(--type-nav-size);
	line-height: var(--type-nav-line);
	font-weight: 500;
	cursor: pointer;
}

.axn-drawer__back .axn-icon {
	width: 24px;
	height: 24px;
}

.axn-drawer__children {
	margin: 0;
	padding: var(--space-20);
	list-style: none;
}

.axn-drawer__child {
	display: flex;
	align-items: center;
	height: 56px;
	border-bottom: 1px solid var(--border-subtle);
	color: var(--text-primary);
	font-family: var(--font-display);
	font-size: var(--type-h5-size);
	line-height: var(--type-h5-line);
	font-weight: 600;
	letter-spacing: -0.005em;
	text-decoration: none;
}

.axn-drawer__child[aria-current="page"],
.axn-drawer__row[aria-current="page"] {
	text-decoration: underline;
	text-decoration-color: var(--c-light-blue);
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}

body.has-drawer-open {
	overflow: hidden;
}

@media (min-width: 1024px) {
	.axn-drawer {
		display: none !important;
	}
}
