/* Hover Mega Menu — front-end styles (v1.2.0)
 * The panel is printed once near the end of the page and positioned
 * with JavaScript against whatever menu link it's matched to, so it
 * works no matter how the active theme builds its menu markup.
 *
 * Desktop (> 782px): hover dropdown, image on the right.
 * Mobile  (<= 782px): full-screen sheet, no image, big tap targets,
 *                     smooth open + smooth sub-menu accordion.
 */

/* small caret JS adds to the live menu link once it's matched to a panel */
a.hmm-has-panel {
	position: relative;
}

a.hmm-has-panel::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 6px;
	margin-bottom: 2px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	vertical-align: middle;
	opacity: 0.7;
	transition: transform 0.2s ease;
}

a.hmm-has-panel[aria-expanded="true"]::after {
	transform: rotate(-135deg);
	margin-bottom: -2px;
}

/* ---------------------------------------------------------------- */
/* Panel (desktop defaults)                                          */
/* ---------------------------------------------------------------- */

.hmm-panel {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99999;
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	text-align: left;
	box-sizing: border-box;
	overflow-y: auto;
	overscroll-behavior: contain;
	overflow-anchor: none;
}

.hmm-panel *,
.hmm-panel *::before,
.hmm-panel *::after {
	box-sizing: border-box;
}

.hmm-panel.hmm-visible {
	display: block;
	animation: hmm-fade-in 0.18s ease-out both;
}

/* `translate` is a separate property from `transform`, so this never
 * fights the translateX(-50%) centring of the contained panel. */
@keyframes hmm-fade-in {
	from {
		opacity: 0;
		translate: 0 6px;
	}
	to {
		opacity: 1;
		translate: 0 0;
	}
}

.hmm-panel--container {
	left: 50%;
	right: auto;
	transform: translateX(-50%);
	width: min(1100px, 92vw);
	border-radius: 6px;
	margin-top: 8px;
}

/* mobile-only header bar (title + close) */
.hmm-panel-head {
	display: none;
}

.hmm-panel-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 40px 48px;
	display: flex;
	flex-wrap: nowrap;
	gap: 40px;
	align-items: flex-start;
}

.hmm-panel-columns {
	flex: 1 1 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 32px 48px;
	min-width: 0;
}

.hmm-panel-column {
	min-width: 160px;
	flex: 1 1 160px;
}

.hmm-panel-column-title {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.hmm-panel-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hmm-panel-list li {
	margin: 0 0 14px;
}

.hmm-panel-list a {
	display: inline-block;
	color: inherit;
	text-decoration: none;
	font-size: 15px;
	line-height: 1.4;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease, opacity 0.15s ease;
}

.hmm-panel-list a:hover,
.hmm-panel-list a:focus-visible,
.hmm-panel-list a.hmm-active-link {
	border-color: currentColor;
	opacity: 0.85;
}

/* third level — a link that expands its own "sub sub menu" */
.hmm-sub-toggle > summary {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 15px;
	line-height: 1.4;
	list-style: none;
	-webkit-user-select: none;
	user-select: none;
}

.hmm-sub-toggle > summary::-webkit-details-marker,
.hmm-sub-toggle > summary::marker {
	display: none;
	content: "";
}

.hmm-sub-toggle > summary::after {
	content: "";
	flex: 0 0 auto;
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.6;
	transition: transform 0.2s ease;
}

.hmm-sub-toggle[open]:not(.hmm-closing) > summary::after {
	transform: rotate(-135deg);
}

.hmm-sub-toggle > summary:hover,
.hmm-sub-toggle > summary.hmm-active-link {
	opacity: 0.85;
}

.hmm-sub-list {
	list-style: none;
	margin: 10px 0 0 4px;
	padding: 0 0 0 14px;
	border-left: 2px solid rgba(0, 0, 0, 0.08);
}

.hmm-sub-list li {
	margin: 0 0 10px;
}

.hmm-sub-list a {
	display: inline-block;
	color: inherit;
	text-decoration: none;
	font-size: 14px;
	opacity: 0.8;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease, opacity 0.15s ease;
}

.hmm-sub-list a:hover,
.hmm-sub-list a:focus-visible {
	border-color: currentColor;
	opacity: 1;
}

.hmm-panel-image {
	flex: 0 0 auto;
	width: 340px;
	max-width: 40vw;
	align-self: stretch;
}

.hmm-panel-image-img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 220px;
	object-fit: cover;
	border-radius: 4px;
	transition: opacity 0.18s ease;
}

.hmm-panel-image-img.hmm-fading {
	opacity: 0;
}

/* ---------------------------------------------------------------- */
/* Tablet / small laptop — keep the image beside the links           */
/* ---------------------------------------------------------------- */

@media (max-width: 1100px) {
	.hmm-panel-inner {
		padding: 32px;
		gap: 28px;
	}

	.hmm-panel-columns {
		gap: 24px 32px;
	}

	.hmm-panel-image {
		width: 240px;
	}

	.hmm-panel-image-img {
		min-height: 180px;
	}
}

/* ---------------------------------------------------------------- */
/* Mobile — full-screen sheet, NO image                              */
/* ---------------------------------------------------------------- */

@media (max-width: 782px) {
	.hmm-panel,
	.hmm-panel.hmm-panel--container {
		position: fixed !important;
		inset: 0 !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		transform: none;
		width: 100% !important;
		height: 100%;
		max-height: none !important;
		margin: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	.hmm-panel.hmm-visible {
		animation: hmm-sheet-in 0.26s cubic-bezier(0.22, 0.61, 0.36, 1) both;
	}

	@keyframes hmm-sheet-in {
		from {
			opacity: 0;
			translate: 0 24px;
		}
		to {
			opacity: 1;
			translate: 0 0;
		}
	}

	/* no image on mobile */
	.hmm-panel-image,
	.hmm-panel .hmm-panel-image {
		display: none !important;
	}

	.hmm-panel-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		position: sticky;
		top: 0;
		z-index: 2;
		min-height: 56px;
		padding: env(safe-area-inset-top, 0px) 8px 0 20px;
		background: #fff;
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	}

	.hmm-panel-title {
		font-size: 17px;
		font-weight: 700;
		line-height: 1.3;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.hmm-panel-close {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		font-size: 30px;
		line-height: 1;
		color: inherit;
		background: transparent;
		border: 0;
		border-radius: 50%;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.hmm-panel-close:active {
		background: rgba(0, 0, 0, 0.06);
	}

	.hmm-panel-inner {
		display: block;
		max-width: none;
		padding: 4px 20px 32px;
	}

	.hmm-panel-columns {
		display: block;
		width: 100%;
	}

	.hmm-panel-column {
		width: 100%;
		min-width: 0;
		padding: 16px 0 8px;
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	}

	.hmm-panel-column:last-child {
		border-bottom: 0;
	}

	.hmm-panel-column-title {
		margin: 0 0 4px;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		opacity: 0.55;
	}

	.hmm-panel-list li,
	.hmm-sub-list li {
		margin: 0;
	}

	/* full-width rows with comfortable tap targets */
	.hmm-panel-list a,
	.hmm-sub-toggle > summary {
		display: flex;
		align-items: center;
		width: 100%;
		min-height: 46px;
		padding: 10px 0;
		font-size: 16px;
		line-height: 1.35;
		border: 0;
		opacity: 1;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
	}

	.hmm-sub-toggle > summary {
		justify-content: space-between;
	}

	.hmm-sub-toggle > summary::after {
		margin-right: 6px;
	}

	.hmm-panel-list a:hover,
	.hmm-panel-list a:focus-visible,
	.hmm-panel-list a.hmm-active-link,
	.hmm-sub-toggle > summary:hover,
	.hmm-sub-toggle > summary.hmm-active-link {
		border: 0;
		opacity: 1;
	}

	.hmm-panel-list a:active,
	.hmm-sub-toggle > summary:active {
		opacity: 0.6;
	}

	.hmm-sub-list {
		margin: 0 0 8px 2px;
		padding: 0 0 0 16px;
		overflow: hidden;
	}

	.hmm-sub-list a {
		min-height: 42px;
		padding: 9px 0;
		font-size: 15px;
		opacity: 0.8;
	}

	html.hmm-panel-locked,
	body.hmm-panel-locked {
		overflow: hidden !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hmm-panel.hmm-visible {
		animation: none !important;
	}

	.hmm-panel-image-img,
	a.hmm-has-panel::after,
	.hmm-sub-toggle > summary::after {
		transition: none !important;
	}
}
