/* ---------------------------------------------------------------------------
   Ace Glove — Section 01: Site header

   Transparent overlay bar. Three groups: brand hard left, menu centred,
   actions hard right. Nothing here touches a theme file — the few rules
   under .ags-header-active only neutralise Hub's own header wrapper so our
   bar can sit over the hero.
--------------------------------------------------------------------------- */

/* --- Hub wrapper neutralising ------------------------------------------- */

.ags-header-active .main-header,
.ags-header-active #header.site-header {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	min-height: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
	z-index: 900;
}

/* Hub prints its own bar on tablet and mobile; ours replaces it. */
.ags-header-active .lqd-mobile-sec {
	display: none !important;
}

/*
 * ...and below its own breakpoint Hub hides the whole desktop header wrapper
 * to make way for that bar. With the bar gone, the wrapper has to stay on at
 * every width or there is no header at all on tablet and phone. Its container
 * and column are flattened because our bar does its own full-width layout.
 */
.ags-header-active .lqd-head-sec-wrap {
	display: block !important;
}

.ags-header-active .lqd-head-sec,
.ags-header-active .lqd-head-col {
	display: block !important;
	width: 100%;
	max-width: none;
	padding: 0;
	margin: 0;
}

.ags-header-active {
	--lqd-mobile-sec-height: 0px;
}

/* --- The bar ------------------------------------------------------------ */

.ags-header {
	--ags-head-pad-top: 18px;
	--ags-head-pad-bottom: 18px;
	--ags-logo-h: 42px;
	--ags-ink: var(--ags-black);
	--ags-ink-soft: rgba(0, 0, 0, 0.68);

	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
	background: transparent;
	padding: var(--ags-head-pad-top) var(--ags-pad-x) var(--ags-head-pad-bottom);
	font-family: inherit;
	transition: background-color var(--ags-speed) var(--ags-ease),
	            box-shadow var(--ags-speed) var(--ags-ease),
	            padding var(--ags-speed) var(--ags-ease);
}

/*
 * The WordPress admin bar is itself fixed to the top of the viewport, so a
 * fixed header starting at 0 sits underneath it. Only logged-in users ever
 * see this. Below 600px WordPress lets the bar scroll away with the page, so
 * the offset is dropped again there.
 */
body.admin-bar .ags-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .ags-header {
		top: 46px;
	}
}

@media screen and (max-width: 600px) {
	body.admin-bar .ags-header {
		top: 0;
	}
}

.ags-header--light {
	--ags-ink: var(--ags-white);
	--ags-ink-soft: rgba(255, 255, 255, 0.78);
}

/* Once the page has scrolled the bar takes a solid ground, so the black
   nav text stays readable over whatever is passing underneath. */
.ags-header--solidify.is-scrolled {
	--ags-ink: var(--ags-black);
	--ags-ink-soft: rgba(0, 0, 0, 0.68);
	background-color: var(--ags-white);
	box-shadow: 0 1px 0 rgba(19, 31, 40, 0.08), 0 6px 24px rgba(19, 31, 40, 0.06);
	--ags-head-pad-top: 12px;
	--ags-head-pad-bottom: 12px;
}

.ags-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
}

/* --- Left: brand lockup -------------------------------------------------- */

.ags-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: none;
	text-decoration: none;
	color: var(--ags-ink);
}

.ags-brand:hover,
.ags-brand:focus {
	color: var(--ags-ink);
	text-decoration: none;
}

.ags-brand__logo {
	display: block;
	height: var(--ags-logo-h);
	width: auto;
	max-width: 100%;
	transition: height var(--ags-speed) var(--ags-ease);
}

.ags-brand__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1px;
	line-height: 1.15;
}

.ags-brand__name {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--ags-ink);
}

.ags-brand__tagline {
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.005em;
	color: var(--ags-ink-soft);
}

/* --- Middle: primary navigation ------------------------------------------ */

.ags-nav {
	flex: 0 1 auto;
}

.ags-menu {
	display: flex;
	align-items: center;
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ags-menu li {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ags-menu > li > a {
	position: relative;
	display: block;
	padding: 6px 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.2;
	color: var(--ags-ink);
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--ags-speed) var(--ags-ease);
}

.ags-nav--case-uppercase .ags-menu > li > a,
.ags-nav--case-uppercase .ags-mobile__menu > li > a { text-transform: uppercase; }

.ags-nav--case-capitalize .ags-menu > li > a,
.ags-nav--case-capitalize .ags-mobile__menu > li > a { text-transform: capitalize; }

.ags-nav--case-none .ags-menu > li > a,
.ags-nav--case-none .ags-mobile__menu > li > a { text-transform: none; }

/* The underline wipes in rather than appearing — the one piece of motion
   in the bar, deliberately small. */
.ags-menu > li > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background-color: currentColor;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--ags-speed) var(--ags-ease);
}

.ags-menu > li > a:hover,
.ags-menu > li > a:focus-visible {
	color: var(--ags-primary);
}

.ags-menu > li > a:hover::after,
.ags-menu > li > a:focus-visible::after {
	transform: scaleX(1);
}

/* Active page — primary colour plus a solid rule underneath. */
.ags-menu > li.current-menu-item > a,
.ags-menu > li.current_page_item > a,
.ags-menu > li.current-menu-ancestor > a,
.ags-menu > li.current-menu-parent > a {
	color: var(--ags-primary);
}

.ags-menu > li.current-menu-item > a::after,
.ags-menu > li.current_page_item > a::after,
.ags-menu > li.current-menu-ancestor > a::after,
.ags-menu > li.current-menu-parent > a::after {
	background-color: var(--ags-primary);
	transform: scaleX(1);
}

/* Sub menus */
.ags-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background-color: var(--ags-white);
	border-radius: var(--ags-radius);
	box-shadow: 0 12px 32px rgba(19, 31, 40, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--ags-speed) var(--ags-ease),
	            transform var(--ags-speed) var(--ags-ease),
	            visibility var(--ags-speed);
}

.ags-menu > li:hover > .sub-menu,
.ags-menu > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ags-menu .sub-menu a {
	display: block;
	padding: 9px 18px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ags-secondary);
	text-decoration: none;
	transition: color var(--ags-speed) var(--ags-ease),
	            background-color var(--ags-speed) var(--ags-ease);
}

.ags-menu .sub-menu a:hover {
	color: var(--ags-primary);
	background-color: rgba(0, 127, 62, 0.06);
}

/* --- Right: language switcher and CTA ------------------------------------ */

.ags-actions {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: none;
}

.ags-lang {
	position: relative;
}

.ags-lang__toggle {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 8px 4px;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--ags-ink);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: color var(--ags-speed) var(--ags-ease);
}

.ags-lang__toggle:hover,
.ags-lang__toggle:focus-visible {
	color: var(--ags-primary);
}

.ags-lang__globe   { width: 16px; height: 16px; }
.ags-lang__chevron { width: 9px;  height: 9px; transition: transform var(--ags-speed) var(--ags-ease); }

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

.ags-lang__menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 160px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background-color: var(--ags-white);
	border-radius: var(--ags-radius);
	box-shadow: 0 12px 32px rgba(19, 31, 40, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity var(--ags-speed) var(--ags-ease),
	            transform var(--ags-speed) var(--ags-ease),
	            visibility var(--ags-speed);
	z-index: 5;
}

.ags-lang.is-open .ags-lang__menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ags-lang__menu li { margin: 0; list-style: none; }

.ags-lang__menu a {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ags-secondary);
	text-decoration: none;
	transition: color var(--ags-speed) var(--ags-ease),
	            background-color var(--ags-speed) var(--ags-ease);
}

.ags-lang__menu a:hover {
	color: var(--ags-primary);
	background-color: rgba(0, 127, 62, 0.06);
}

.ags-lang__label {
	font-size: 12px;
	font-weight: 400;
	opacity: 0.65;
}

/* CTA */
.ags-cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 20px;
	border-radius: var(--ags-radius);
	background-color: var(--ags-primary);
	color: var(--ags-white);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--ags-speed) var(--ags-ease);
}

.ags-cta--case-uppercase .ags-cta__label,
.ags-cta--case-uppercase { text-transform: uppercase; }

.ags-cta:hover,
.ags-cta:focus-visible {
	background-color: var(--ags-secondary);
	color: var(--ags-white);
	text-decoration: none;
}

.ags-cta__icon {
	width: 15px;
	height: 11px;
	transition: transform var(--ags-speed) var(--ags-ease);
}

.ags-cta:hover .ags-cta__icon {
	transform: translateX(4px);
}

/* --- Mobile toggle and panel --------------------------------------------- */

.ags-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0 10px;
	margin: 0;
	border: 0;
	border-radius: var(--ags-radius);
	background: none;
	cursor: pointer;
}

.ags-burger span {
	display: block;
	height: 2px;
	width: 100%;
	background-color: var(--ags-ink);
	transition: transform var(--ags-speed) var(--ags-ease),
	            opacity var(--ags-speed) var(--ags-ease),
	            background-color var(--ags-speed) var(--ags-ease);
}

.ags-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ags-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ags-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.ags-mobile {
	display: none;
	margin: var(--ags-head-pad-bottom) calc(var(--ags-pad-x) * -1) calc(var(--ags-head-pad-bottom) * -1);
	padding: 8px var(--ags-pad-x) 24px;
	background-color: var(--ags-white);
	border-top: 1px solid rgba(19, 31, 40, 0.08);
}

.ags-mobile__menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ags-mobile__menu li { margin: 0; list-style: none; }

.ags-mobile__menu > li > a {
	display: block;
	padding: 14px 0;
	border-bottom: 1px solid rgba(19, 31, 40, 0.08);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--ags-secondary);
	text-decoration: none;
}

.ags-mobile__menu > li.current-menu-item > a,
.ags-mobile__menu > li.current_page_item > a {
	color: var(--ags-primary);
}

.ags-mobile__menu .sub-menu {
	margin: 0 0 0 14px;
	padding: 0;
	list-style: none;
}

.ags-mobile__menu .sub-menu a {
	display: block;
	padding: 11px 0;
	font-size: 13px;
	font-weight: 400;
	color: var(--ags-secondary);
	text-decoration: none;
}

.ags-mobile__actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 20px;
}

.ags-mobile__langs {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: none;
}

.ags-mobile__lang {
	padding: 10px 12px;
	border: 1px solid rgba(19, 31, 40, 0.16);
	border-radius: var(--ags-radius);
	font-size: 12px;
	font-weight: 500;
	color: var(--ags-secondary);
	text-decoration: none;
	line-height: 1;
}

.ags-mobile__lang.is-current {
	border-color: var(--ags-primary);
	color: var(--ags-primary);
}

.ags-cta--block {
	flex: 1 1 auto;
	justify-content: center;
	padding: 15px 20px;
}

/* --- Breakpoints ---------------------------------------------------------- */

/* The nav collapses earlier than the site's layout breakpoints: seven
   uppercase items plus the brand lockup and actions stop fitting well
   before 1024px. */
@media (max-width: 1100px) {
	.ags-header__inner > .ags-nav { display: none; }
	.ags-header__inner > .ags-actions > .ags-lang { display: none; }
	.ags-burger { display: flex; }
	.ags-mobile { display: block; }
	.ags-mobile[hidden] { display: none; }

	/* The panel needs a solid bar behind it whatever the hero looks like. */
	.ags-header.is-menu-open {
		--ags-ink: var(--ags-black);
		--ags-ink-soft: rgba(0, 0, 0, 0.68);
		background-color: var(--ags-white);
	}
}

@media (max-width: 767px) {
	/* The configured logo height arrives as an inline custom property, which
	   would outrank a plain override here — so cap it instead of replacing it.
	   A logo set shorter than the cap keeps its own height. */
	.ags-brand__logo { height: min(var(--ags-logo-h), 34px); }
	.ags-brand { gap: 9px; }
	.ags-brand__name { font-size: 15px; }
	.ags-brand__tagline { font-size: 10px; }
	.ags-cta { padding: 11px 15px; font-size: 12px; }
	.ags-mobile__actions { flex-wrap: wrap; }
}

@media (max-width: 420px) {
	.ags-header__inner > .ags-actions > .ags-cta { display: none; }
}

/* Only the narrowest phones lose the tagline. */
@media (max-width: 359px) {
	.ags-brand__tagline { display: none; }
}

/* --- Load animation ------------------------------------------------------- */

/* Hidden only when GSAP is going to animate them in; the class is removed
   immediately if the script fails, so nothing can stay invisible. */
.ags-header--animate.is-armed .ags-brand,
.ags-header--animate.is-armed .ags-nav,
.ags-header--animate.is-armed .ags-actions {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ags-header--animate.is-armed .ags-brand,
	.ags-header--animate.is-armed .ags-nav,
	.ags-header--animate.is-armed .ags-actions {
		opacity: 1;
	}
}
