/* Mega Menu Builder — front end
   ------------------------------------------------------------------ */

.mmb-nav {
	--mmb-accent: #1b1b1b;
	--mmb-surface: #fffdfb;
	--mmb-cream: #faf6f2;
	--mmb-ink: #1b1b1b;
	--mmb-muted: #8b8781;
	--mmb-line: rgba(27, 27, 27, 0.08);
	--mmb-panel-width: 1040px;
	--mmb-radius: 16px;
	--mmb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
		"Helvetica Neue", Arial, sans-serif;

	position: relative;
	z-index: 900;
	font-family: var(--mmb-font);
	background: #fff;
	border-bottom: 1px solid var(--mmb-line);
}

.mmb-nav.is-sticky {
	position: sticky;
	top: 0;
}

.mmb-nav *,
.mmb-nav *::before,
.mmb-nav *::after {
	box-sizing: border-box;
}

.mmb-nav__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	min-height: 64px;
}

/* Brand ------------------------------------------------------------- */

.mmb-brand {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: var(--mmb-ink);
	flex: 0 0 auto;
}

.mmb-brand__logo {
	display: block;
	max-height: 30px;
	width: auto;
}

.mmb-brand__text {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.02em;
}

/* Menu -------------------------------------------------------------- */

.mmb-menu {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	gap: 20px;
}

.mmb-menu__list {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mmb-menu__item {
	position: static;
	margin: 0;
}

.mmb-menu__link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: -0.01em;
	color: var(--mmb-ink);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mmb-menu__link:hover,
.mmb-menu__item.is-open > .mmb-menu__link {
	background: var(--mmb-cream);
}

.mmb-menu__link:focus-visible {
	outline: 2px solid var(--mmb-accent);
	outline-offset: 2px;
}

.mmb-chevron {
	width: 9px;
	height: 6px;
	opacity: 0.55;
	transition: transform 0.2s ease;
}

.mmb-menu__item.is-open .mmb-chevron {
	transform: rotate(180deg);
}

.mmb-cta {
	margin-left: auto;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	padding: 9px 18px;
	border-radius: 999px;
	background: var(--mmb-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.mmb-cta:hover {
	opacity: 0.85;
	color: #fff;
}

/* Panel ------------------------------------------------------------- */

.mmb-panel {
	position: absolute;
	top: calc(100% - 6px);
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	--mmb-col-w: 250px;
	--mmb-col-min: 190px;
	--mmb-side-w: 250px;
	--mmb-cols-pad: 20px; /* grid padding + frame border */
	/* Sit at the comfortable width for this many columns, never wider than the
	   configured maximum, never narrower than the readable floor, never wider
	   than the viewport. */
	width: min(
		max(
			calc(
				var(--mmb-cols, 3) * var(--mmb-col-min) + var(--mmb-side-w) +
					var(--mmb-cols-pad)
			),
			min(
				calc(
					var(--mmb-cols, 3) * var(--mmb-col-w) + var(--mmb-side-w) +
						var(--mmb-cols-pad)
				),
				var(--mmb-panel-width)
			)
		),
		calc(100vw - 32px)
	);
	padding-top: 10px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.mmb-panel[hidden] {
	display: block; /* animated instead of hard-hidden; JS toggles aria + class */
	visibility: hidden;
}

.mmb-menu__item.is-open .mmb-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

/* Plain dropdown list -------------------------------------------- */

.mmb-menu__item--list {
	position: relative;
}

.mmb-drop {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 2;
	min-width: 216px;
	max-width: 320px;
	margin-top: 4px;
	padding: 6px;
	background: var(--mmb-surface);
	border: 1px solid var(--mmb-line);
	border-radius: 12px;
	box-shadow: 0 1px 0 rgba(27, 27, 27, 0.04),
		0 14px 34px -12px rgba(27, 27, 27, 0.24);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-4px);
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.mmb-drop[hidden] {
	display: block;
	visibility: hidden;
}

.mmb-menu__item.is-open > .mmb-drop {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.mmb-list--drop a {
	padding: 8px 10px;
}

@media (min-width: 901px) and (hover: hover) {
	.mmb-nav:not(.mmb-js) .mmb-menu__item--list:hover > .mmb-drop,
	.mmb-nav:not(.mmb-js) .mmb-menu__item--list:focus-within > .mmb-drop {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
	}
}

@media (min-width: 901px) and (hover: hover) {
	.mmb-nav:not(.mmb-js) .mmb-menu__item--mega:hover > .mmb-panel,
	.mmb-nav:not(.mmb-js) .mmb-menu__item--mega:focus-within > .mmb-panel {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateX(-50%) translateY(0);
	}
}

.mmb-panel__frame {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	grid-template-rows: 1fr auto;
	overflow: hidden;
	background: var(--mmb-surface);
	border-radius: var(--mmb-radius);
	box-shadow: 0 1px 0 rgba(27, 27, 27, 0.06), 0 18px 50px -12px rgba(27, 27, 27, 0.22);
	/* the soft prism edge from the reference */
	outline: 1px solid transparent;
	background-image: linear-gradient(var(--mmb-surface), var(--mmb-surface)),
		linear-gradient(100deg, #c9c4f2 0%, #f3c9d6 26%, #f6dcc2 52%, #cfe3c4 78%, #c9c4f2 100%);
	background-origin: border-box;
	background-clip: padding-box, border-box;
	border: 1.5px solid transparent;
}

.mmb-panel--nofeature {
	--mmb-side-w: 0px;
}

.mmb-panel--nofeature .mmb-panel__frame {
	grid-template-columns: minmax(0, 1fr);
}

/* Feature sidebar */

.mmb-feature {
	grid-column: 1;
	grid-row: 1 / 3;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 14px 20px;
	background: var(--mmb-cream);
	border-right: 1px solid var(--mmb-line);
}

.mmb-feature__card {
	display: block;
	text-decoration: none;
	color: var(--mmb-ink);
	border-radius: 10px;
	transition: opacity 0.18s ease;
}

.mmb-feature__card:hover {
	opacity: 0.82;
}

.mmb-feature__media {
	display: block;
	height: 84px;
	border-radius: 10px;
	background-size: cover;
	background-position: center;
}

.mmb-feature__copy {
	display: block;
	padding: 12px 4px 2px;
}

.mmb-feature__title {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.mmb-feature__sub {
	display: block;
	margin-top: 3px;
	font-size: 12.5px;
	line-height: 1.35;
	color: var(--mmb-muted);
}

/* Link lists */

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

.mmb-list li {
	margin: 0;
}

.mmb-list a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 450;
	letter-spacing: -0.005em;
	line-height: 1.3;
	color: var(--mmb-ink);
	text-decoration: none;
	transition: background-color 0.14s ease;
}

.mmb-list a:hover {
	background: rgba(27, 27, 27, 0.045);
}

.mmb-list a:focus-visible {
	outline: 2px solid var(--mmb-accent);
	outline-offset: -2px;
}

.mmb-list--feature a {
	padding-left: 4px;
	padding-right: 4px;
}

.mmb-icon {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 16px;
	color: rgba(27, 27, 27, 0.55);
}

.mmb-icon--svg {
	stroke: currentColor;
	color: rgba(27, 27, 27, 0.6);
}

.mmb-col__badge .mmb-icon--svg {
	color: #fff;
}

.mmb-icon--img {
	object-fit: contain;
	border-radius: 3px;
}

.mmb-icon--empty {
	display: none;
}

.mmb-list a > span:last-child {
	min-width: 0;
}

/* Columns */

.mmb-cols {
	grid-column: 2;
	grid-row: 1;
	display: grid;
	align-content: start;
	grid-template-columns: repeat(var(--mmb-cols, 3), minmax(0, 1fr));
	padding: 18px 8px 22px;
}

/* Five or more columns wrap onto rows instead of squashing. */

.mmb-panel--wrap .mmb-cols {
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	row-gap: 22px;
}

.mmb-panel--wrap .mmb-col {
	border-right: 0;
}

.mmb-panel--wrap .mmb-col__head {
	padding-bottom: 10px;
	margin-bottom: 8px;
}

.mmb-col {
	padding: 0 14px;
	border-right: 1px solid var(--mmb-line);
}

.mmb-col:last-child {
	border-right: 0;
}

.mmb-col__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 2px 10px 14px;
	margin-bottom: 10px;
	border-bottom: 1px solid var(--mmb-line);
	text-decoration: none;
	color: var(--mmb-ink);
}

.mmb-col__head:hover .mmb-col__title {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mmb-col__badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: var(--mmb-accent);
	color: #fff;
}

.mmb-col__badge .mmb-icon {
	color: #fff;
	width: 17px;
	height: 17px;
	font-size: 17px;
	line-height: 17px;
}

.mmb-col__badge .mmb-icon--svg {
	stroke: currentColor;
	color: rgba(27, 27, 27, 0.6);
}

.mmb-col__badge .mmb-icon--svg {
	color: #fff;
}

.mmb-icon--img {
	width: 100%;
	height: 100%;
	border-radius: 9px;
	object-fit: cover;
}

.mmb-col__copy {
	display: block;
	min-width: 0;
}

.mmb-col__title {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.mmb-col__sub {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	line-height: 1.3;
	color: var(--mmb-muted);
}

/* Footer strip */

.mmb-panel__footer {
	grid-column: 2;
	grid-row: 2;
	background: var(--mmb-cream);
	border-top: 1px solid var(--mmb-line);
}

.mmb-panel--nofeature .mmb-panel__footer {
	grid-column: 1;
}

.mmb-panel__footer a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--mmb-ink);
	text-decoration: none;
}

.mmb-panel__footer a:hover .mmb-arrow {
	transform: translateX(3px);
}

.mmb-arrow {
	width: 14px;
	height: 10px;
	margin-left: 2px;
	opacity: 0.6;
	transition: transform 0.18s ease;
}

/* Burger ------------------------------------------------------------ */

.mmb-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 40px;
	height: 40px;
	margin-left: auto;
	padding: 0 9px;
	border: 1px solid var(--mmb-line);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
}

.mmb-burger span {
	display: block;
	height: 1.6px;
	border-radius: 2px;
	background: var(--mmb-ink);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.mmb-burger[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(5.6px) rotate(45deg);
}

.mmb-burger[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.mmb-burger[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-5.6px) rotate(-45deg);
}

/* Mobile ------------------------------------------------------------ */

@media (max-width: 900px) {
	.mmb-nav__inner {
		flex-wrap: wrap;
		gap: 0;
		padding: 10px 16px;
	}

	.mmb-burger {
		display: flex;
	}

	.mmb-menu {
		display: none;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		max-height: calc(100vh - 80px);
		overflow-y: auto;
		padding: 8px 0 18px;
		gap: 0;
	}

	.mmb-nav.is-open .mmb-menu {
		display: flex;
	}

	.mmb-menu__list {
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
	}

	.mmb-menu__link {
		width: 100%;
		justify-content: space-between;
		padding: 12px 10px;
		font-size: 15px;
	}

	.mmb-cta {
		margin: 12px 10px 0;
		justify-content: center;
	}

	.mmb-drop {
		position: static;
		display: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		min-width: 0;
		max-width: none;
		margin: 0 0 6px;
		box-shadow: none;
		background: var(--mmb-cream);
	}

	.mmb-drop[hidden] {
		display: none;
	}

	.mmb-menu__item.is-open > .mmb-drop {
		display: block;
	}

	.mmb-panel {
		position: static;
		width: 100%;
		transform: none;
		padding-top: 0;
		display: none;
		opacity: 1;
	}

	.mmb-panel[hidden] {
		display: none;
	}

	.mmb-menu__item.is-open .mmb-panel {
		display: block;
		transform: none;
	}

	.mmb-panel__frame {
		display: block;
		border-radius: 12px;
		box-shadow: none;
	}

	.mmb-feature,
	.mmb-panel__footer {
		border-right: 0;
	}

	.mmb-cols {
		display: block;
		padding: 12px 6px 16px;
	}

	.mmb-col {
		border-right: 0;
		padding: 0 8px 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mmb-nav *,
	.mmb-nav *::before {
		transition: none !important;
	}
}
