/*
 * Menu Styles (inc/menu-styles.php). Desktop only — at 960px and below the
 * mobile menu takes over unchanged. Colours come from the theme tokens, so
 * every style follows the site's own palette and dark mode.
 */
@media (min-width: 961px) {

	/* ---------- Underline: grows from the centre ---------- */
	.ust-menu-style-underline .ust-menu > li > a { position: relative; }
	.ust-menu-style-underline .ust-menu > li > a::after {
		content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px;
		background: var(--ust-color-nav-text-hover); transform: scaleX(0); transform-origin: center;
		transition: transform .3s cubic-bezier(.4, 0, .2, 1);
	}
	.ust-menu-style-underline .ust-menu > li:hover > a::after,
	.ust-menu-style-underline .ust-menu > li > a:focus-visible::after,
	.ust-menu-style-underline .ust-menu > li.current-menu-item > a::after,
	.ust-menu-style-underline .ust-menu > li.current-menu-ancestor > a::after { transform: scaleX(1); }

	/* ---------- Pill: soft rounded highlight ---------- */
	.ust-menu-style-pill .ust-menu > li > a { border-radius: 999px; transition: background-color .2s ease, color .2s ease; }
	.ust-menu-style-pill .ust-menu > li:hover > a,
	.ust-menu-style-pill .ust-menu > li > a:focus-visible,
	.ust-menu-style-pill .ust-menu > li.current-menu-item > a,
	.ust-menu-style-pill .ust-menu > li.current-menu-ancestor > a {
		background: color-mix(in srgb, var(--ust-color-nav-text-hover) 14%, transparent);
	}

	/* ---------- Caps: uppercase, spaced, dot under the current page ---------- */
	.ust-menu-style-caps .ust-menu > li > a {
		position: relative; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700;
	}
	.ust-menu-style-caps .ust-menu > li > a::after {
		content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
		background: var(--ust-color-nav-text-hover); opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease;
	}
	.ust-menu-style-caps .ust-menu > li:hover > a::after,
	.ust-menu-style-caps .ust-menu > li.current-menu-item > a::after,
	.ust-menu-style-caps .ust-menu > li.current-menu-ancestor > a::after { opacity: 1; transform: none; }

	/* ---------- Glide line / glide pill / island: one highlight that moves (assets/js/menu-styles.js) ---------- */
	.ust-menu-style-glide-line .ust-menu,
	.ust-menu-style-glide-pill .ust-menu,
	.ust-menu-style-island .ust-menu { position: relative; isolation: isolate; }
	.ust-menu-glider {
		position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; opacity: 0;
		transition: transform .38s cubic-bezier(.4, 0, .2, 1), width .38s cubic-bezier(.4, 0, .2, 1), height .38s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
	}
	.ust-menu-glider.is-visible { opacity: 1; }
	.ust-menu-style-glide-line .ust-menu-glider { height: 2px !important; border-radius: 2px; background: var(--ust-color-nav-text-hover); }
	.ust-menu-style-glide-pill .ust-menu-glider,
	.ust-menu-style-island .ust-menu-glider { border-radius: 999px; background: color-mix(in srgb, var(--ust-color-nav-text-hover) 16%, transparent); }

	/* Island: the menu sits in its own capsule. */
	.ust-menu-style-island .ust-menu {
		padding: 5px; gap: 2px; border-radius: 999px;
		background: color-mix(in srgb, var(--ust-color-nav-text) 6%, transparent);
		border: 1px solid color-mix(in srgb, var(--ust-color-nav-text) 10%, transparent);
	}
	.ust-menu-style-island .ust-menu > li > a { padding: 8px 14px; border-radius: 999px; }
	.ust-menu-style-island .ust-menu .ust-submenu-toggle { min-height: 36px; }

	/* ---------- Dropdowns: animated and cards ---------- */
	.ust-dropdown-animated .ust-menu li:hover > .sub-menu,
	.ust-dropdown-animated .ust-menu li:focus-within > .sub-menu,
	.ust-dropdown-animated .ust-menu li.ust-submenu-open > .sub-menu,
	.ust-dropdown-cards .ust-menu li:hover > .sub-menu,
	.ust-dropdown-cards .ust-menu li:focus-within > .sub-menu,
	.ust-dropdown-cards .ust-menu li.ust-submenu-open > .sub-menu { animation: ust-dropdown-in .22s cubic-bezier(.2, .8, .2, 1); }

	.ust-dropdown-cards .ust-menu .sub-menu {
		min-width: 300px; padding: 10px; border-radius: calc(var(--ust-radius) + 8px);
		border: 1px solid var(--ust-surface-border); box-shadow: 0 24px 50px var(--ust-surface-shadow);
	}
	.ust-dropdown-cards .ust-menu .sub-menu a { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; white-space: normal; }
	.ust-dropdown-cards .ust-menu .sub-menu a:hover,
	.ust-dropdown-cards .ust-menu .sub-menu a:focus-visible { padding-left: 20px; }
	.ust-menu-desc { display: block; font-size: .8rem; font-weight: 400; line-height: 1.35; color: var(--ust-surface-text-muted, var(--ust-surface-text)); opacity: .85; }
}

@keyframes ust-dropdown-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Header on scroll: shrink / glass (body.ust-scrolled comes from header-builder.js) ----------
   Nothing here changes the header's height: on a sticky header a height change shifts the
   whole page mid-scroll (felt as jumpy scrolling). The top bar instead slides up out of view
   by moving the sticky offset, which never touches layout. */
.ust-header-fx-shrink #ust-masthead,
.ust-header-fx-glass #ust-masthead { transition: top .3s ease, box-shadow .3s ease; }
@media (min-width: 783px) {
	.ust-header-fx-shrink.ust-scrolled #ust-masthead,
	.ust-header-fx-glass.ust-scrolled #ust-masthead { top: calc(-1 * var(--ust-topbar-h, 44px)); }
}
.ust-header-fx-shrink.ust-scrolled #ust-masthead,
.ust-header-fx-glass.ust-scrolled #ust-masthead { box-shadow: 0 8px 30px var(--ust-surface-shadow, rgba(0, 0, 0, .12)); }
.ust-header-fx-glass .ust-header { transition: background-color .35s ease; }
.ust-header-fx-glass.ust-scrolled .ust-header {
	background: color-mix(in srgb, var(--ust-color-header-bg) 86%, transparent);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-bottom-color: color-mix(in srgb, var(--ust-color-nav-text) 10%, transparent);
}

@media (prefers-reduced-motion: reduce) {
	.ust-menu-style-underline .ust-menu > li > a::after,
	.ust-menu-style-caps .ust-menu > li > a::after,
	.ust-menu-glider,
	.ust-header-fx-shrink #ust-masthead, .ust-header-fx-glass #ust-masthead { transition: none; }
	.ust-dropdown-animated .ust-menu .sub-menu, .ust-dropdown-cards .ust-menu .sub-menu { animation: none !important; }
}

/* Shrink/Glass already collapse the top bar, so the mobile "scroll the top bar away"
   offset (style.css, top: -56px) would clip the logo row; keep the header at the top. */


/* Submenu indicator (desktop). The toggle button remains — only its look changes. */
@media (min-width: 961px) {
	.ust-submenu-ind-dot .ust-menu > li > .ust-submenu-toggle,
	.ust-submenu-ind-none .ust-menu > li > .ust-submenu-toggle { width: 14px; margin-inline-start: -8px; }
	.ust-submenu-ind-dot .ust-menu > li > .ust-submenu-toggle svg,
	.ust-submenu-ind-none .ust-menu > li > .ust-submenu-toggle svg { display: none; }
	.ust-submenu-ind-dot .ust-menu > li > .ust-submenu-toggle::before {
		content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ust-color-nav-text-hover); opacity: .75;
		transition: transform .2s ease, opacity .2s ease;
	}
	.ust-submenu-ind-dot .ust-menu > li:hover > .ust-submenu-toggle::before,
	.ust-submenu-ind-dot .ust-menu > li.ust-submenu-open > .ust-submenu-toggle::before { opacity: 1; transform: scale(1.35); }
	.ust-submenu-ind-none .ust-menu > li > .ust-submenu-toggle { width: 4px; margin-inline-start: -4px; overflow: hidden; }
	.ust-submenu-ind-none .ust-menu > li > .ust-submenu-toggle:focus-visible { width: 14px; }
	.ust-submenu-ind-none .ust-menu > li > .ust-submenu-toggle:focus-visible::before { content: "▾"; font-size: .7rem; }
}
