/**
 * Modern Horizontal Menu — frontend
 *
 * @package Modern_Horizontal_Menu
 */

.mhm {
	--mhm-bg: #0f172a;
	--mhm-text: #f8fafc;
	--mhm-text-muted: #94a3b8;
	--mhm-accent: #38bdf8;
	--mhm-accent-hover: #7dd3fc;
	--mhm-panel-bg: #1e293b;
	--mhm-radius: 12px;
	--mhm-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
	--mhm-z-nav: 100000;
	position: relative;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.mhm--bar {
	background: linear-gradient(180deg, #0f172a 0%, #1a2332 100%);
	border-radius: var(--mhm-radius);
	padding: 0.4rem 0.6rem;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.25);
}

.mhm-panel {
	display: flex;
	align-items: center;
}

.mhm-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mhm-item {
	position: relative;
	margin: 0;
	padding: 0;
}

.mhm-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 0.85rem;
	border-radius: 999px;
	color: var(--mhm-text);
	text-decoration: none;
	font-weight: 500;
	transition: background 0.15s ease, color 0.15s ease;
}

.mhm-link:hover,
.mhm-link:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	color: var(--mhm-accent-hover);
	outline: none;
}

.mhm-link:focus-visible {
	box-shadow: 0 0 0 2px var(--mhm-bg), 0 0 0 4px var(--mhm-accent);
}

.mhm-caret {
	display: inline-block;
	width: 0.45em;
	height: 0.45em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-0.1em);
	opacity: 0.85;
}

.mhm-item--parent:hover > .mhm-submenu--root,
.mhm-item--parent:focus-within > .mhm-submenu--root,
.mhm-item--parent.mhm--open > .mhm-submenu--root {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.mhm-submenu {
	list-style: none;
	margin: 0;
	padding: 0.4rem 0;
	min-width: 14rem;
	background: var(--mhm-panel-bg);
	border-radius: var(--mhm-radius);
	box-shadow: var(--mhm-shadow);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.mhm-submenu--root {
	position: absolute;
	left: 0;
	top: 100%;
	z-index: 10;
	margin-top: 0.15rem;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(0.35rem);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.mhm-submenu .mhm-link {
	border-radius: 0;
	width: 100%;
	padding: 0.5rem 1rem;
	white-space: nowrap;
}

.mhm-submenu--root .mhm-submenu--root,
.mhm-submenu .mhm-submenu {
	position: absolute;
	left: 100%;
	top: 0;
	margin-left: 0.15rem;
	margin-top: 0;
}

.mhm-item--parent .mhm-item--parent > .mhm-submenu--root,
.mhm-submenu .mhm-item--parent {
	position: relative;
}

.mhm-burger {
	display: none;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.9rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: var(--mhm-radius);
	background: var(--mhm-panel-bg);
	color: var(--mhm-text);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}

.mhm-burger__box {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mhm-burger__line {
	display: block;
	width: 20px;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	transition: transform 0.2s ease, opacity 0.2s;
}

.mhm--nav-open .mhm-burger__line:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.mhm--nav-open .mhm-burger__line:nth-child(2) {
	opacity: 0;
}

.mhm--nav-open .mhm-burger__line:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

.mhm__label--sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 900px) {
	.mhm-burger {
		display: inline-flex;
	}

	.mhm .mhm-panel:not(.mhm-panel--no-burger) {
		position: fixed;
		inset: 0 0 0 0;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		padding: 4.5rem 1.25rem 1.5rem;
		background: rgba(15, 23, 42, 0.92);
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
		z-index: var(--mhm-z-nav);
		max-height: 100vh;
		overflow-y: auto;
		visibility: hidden;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s ease, visibility 0.2s;
	}

	.mhm--nav-open .mhm-panel:not(.mhm-panel--no-burger) {
		visibility: visible;
		opacity: 1;
		pointer-events: auto;
	}

	.mhm--nav-open {
		position: static;
	}

	.mhm .mhm-list {
		flex-direction: column;
		align-items: stretch;
		gap: 0.15rem;
	}

	.mhm .mhm-link {
		border-radius: var(--mhm-radius);
		padding: 0.75rem 1rem;
		background: var(--mhm-panel-bg);
	}

	.mhm .mhm-submenu--root,
	.mhm .mhm-submenu {
		position: static;
		box-shadow: none;
		border: 0;
		background: transparent;
		margin: 0.15rem 0 0.35rem 0.5rem;
		padding-left: 0.5rem;
		border-left: 2px solid rgba(56, 189, 248, 0.35);
		min-width: 0;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
	}

	.mhm .mhm-item--parent .mhm-submenu--root {
		display: none;
	}

	.mhm .mhm-item--parent.mhm--open .mhm-submenu--root,
	.mhm .mhm-item--parent.mhm--sub-open .mhm-submenu--root {
		display: block;
	}
}

.mhm.mhm--theme-light {
	--mhm-bg: #ffffff;
	--mhm-text: #0f172a;
	--mhm-text-muted: #64748b;
	--mhm-accent: #0284c7;
	--mhm-accent-hover: #0369a1;
	--mhm-panel-bg: #f1f5f9;
	--mhm-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.mhm.mhm--theme-light .mhm-link:hover,
.mhm.mhm--theme-light .mhm-link:focus-visible {
	background: rgba(2, 132, 199, 0.1);
}

.mhm.mhm--theme-light .mhm-burger {
	background: #f1f5f9;
	color: #0f172a;
}

@media (min-width: 901px) {
	.mhm-panel--no-burger,
	.mhm .mhm-panel--no-burger {
		visibility: visible;
		opacity: 1;
		pointer-events: auto;
		position: static;
		background: none;
		padding: 0;
		max-height: none;
		backdrop-filter: none;
	}
}

body.mhm-scroll-locked {
	overflow: hidden;
}
