/* ==========================================================================
   Flavor Mega Menu — Components card grid
   Reuses the GeekaWhat "Browse by Component" card DNA.
   ========================================================================== */

:root {
	--flavor-mm-blue: #2962ff;
	--flavor-mm-blue-deep: #1e4fd6;
	--flavor-mm-tint: rgba(41, 98, 255, 0.08);
	--flavor-mm-tint-2: rgba(41, 98, 255, 0.16);
	--flavor-mm-border: rgba(41, 98, 255, 0.14);
	--flavor-mm-navy: #161c2d;
	--flavor-mm-muted: #737e94;
	--flavor-mm-shadow: 0 18px 50px -18px rgba(22, 28, 45, 0.28);
	--flavor-mm-shadow-card: 0 10px 26px -12px rgba(41, 98, 255, 0.45);
}

/* The flagged <li> goes static so the panel can span full width
   relative to the header/nav rather than the narrow menu item.
   !important is needed because many themes (incl. Neeon) set
   position:relative on the menu item, which would otherwise trap the
   panel at the width of the "Components" link. */
.flavor-mm-parent {
	position: static !important;
}

/* Kill any caret/arrow the theme injects onto menu links (e.g. a
   dropdown indicator via ::after) so it doesn't leak onto the cards. */
.flavor-mm-panel a::before,
.flavor-mm-panel a::after,
.flavor-mm-card::before,
.flavor-mm-card::after {
	content: none !important;
	display: none !important;
}

/* --- Panel shell --- */
.flavor-mm-parent .flavor-mm-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 999;
	background: #fff;
	border-top: 1px solid #eceef4;
	box-shadow: var(--flavor-mm-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	pointer-events: none;
}

/* Reveal on hover or keyboard focus within the item. */
.flavor-mm-parent:hover .flavor-mm-panel,
.flavor-mm-parent:focus-within .flavor-mm-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}

.flavor-mm-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 26px 26px 30px;
	box-sizing: border-box;
}

/* --- Card grid ---
   All card rules are scoped under .flavor-mm-panel and lock the key
   layout properties, because the theme's `.menu-item a` rules are more
   specific than a bare `.flavor-mm-card` and were overriding display,
   padding, colour and word-breaking. */
.flavor-mm-panel .flavor-mm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
	gap: 12px;
}

.flavor-mm-panel .flavor-mm-card {
	position: relative;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 22px 12px !important;
	min-height: 132px !important;
	height: auto !important;
	background: #fff;
	border: 1px solid var(--flavor-mm-border);
	border-radius: 16px;
	text-decoration: none !important;
	color: var(--flavor-mm-navy) !important;
	line-height: 1.2 !important;
	box-sizing: border-box;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.flavor-mm-panel .flavor-mm-ic {
	width: 50px;
	height: 50px;
	border-radius: 13px;
	background: var(--flavor-mm-tint);
	display: grid;
	place-items: center;
	color: var(--flavor-mm-blue);
	flex: none;
	transition: background 0.18s ease, transform 0.18s ease;
}

.flavor-mm-panel .flavor-mm-ic svg {
	width: 26px;
	height: 26px;
}

.flavor-mm-panel .flavor-mm-lbl {
	display: block;
	width: 100%;
	text-align: center;
	font-family: 'League Spartan', 'Spartan', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-weight: 700;
	font-size: 13.5px;
	line-height: 1.25;
	color: var(--flavor-mm-navy) !important;
	white-space: normal;
	word-break: keep-all;
	overflow-wrap: normal;
	hyphens: none;
	transition: transform 0.18s ease, color 0.18s ease;
}

.flavor-mm-panel .flavor-mm-go {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;
	text-align: center;
	font-family: 'League Spartan', 'Spartan', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--flavor-mm-blue) !important;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
}

.flavor-mm-panel .flavor-mm-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--flavor-mm-shadow-card);
	border-color: var(--flavor-mm-blue);
}

.flavor-mm-panel .flavor-mm-card:hover .flavor-mm-ic {
	background: var(--flavor-mm-tint-2);
	transform: translateY(-10px);
}

.flavor-mm-panel .flavor-mm-card:hover .flavor-mm-lbl {
	color: var(--flavor-mm-blue) !important;
	transform: translateY(-10px);
}

.flavor-mm-panel .flavor-mm-card:hover .flavor-mm-go,
.flavor-mm-panel .flavor-mm-card:focus-visible .flavor-mm-go {
	opacity: 1;
	transform: translateY(0);
}

.flavor-mm-panel .flavor-mm-card:focus-visible {
	outline: 2px solid var(--flavor-mm-blue);
	outline-offset: 2px;
}

/* --- Mobile: collapse to a tap-to-open accordion --- */
@media (max-width: 980px) {
	.flavor-mm-parent .flavor-mm-panel {
		position: static;
		box-shadow: none;
		border-top: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		pointer-events: auto;
		display: none;
	}

	.flavor-mm-parent.is-open .flavor-mm-panel {
		display: block;
	}

	.flavor-mm-inner {
		padding: 14px 16px 18px;
	}

	.flavor-mm-panel .flavor-mm-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 10px;
	}

	.flavor-mm-panel .flavor-mm-go {
		display: none;
	}
}

@media (max-width: 520px) {
	.flavor-mm-panel .flavor-mm-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.flavor-mm-panel,
	.flavor-mm-card,
	.flavor-mm-ic,
	.flavor-mm-go {
		transition: none !important;
	}
}
