/* Orbitalia Mega Menu — full structural CSS (external, cacheable).
   Loads only on pages where the widget renders (conditional enqueue). */

/* ----------------------------------------------------- Reveal -------- */

.omm-l1-item:hover > .omm-panel,
.omm-l1-item:focus-within > .omm-panel,
.omm-l1-item.is-open > .omm-panel,
.omm-toggle[aria-expanded="true"] ~ .omm-panel {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.omm-panel__inner {
	display: grid;
	grid-template-columns: var(--omm-sidebar-w) 1fr;
	background: #fff;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
	border-radius: 0 0 10px 10px;
	overflow: hidden;
}

.omm-l2 {
	margin: 0;
	padding: 12px;
	list-style: none;
	border-inline-end: 1px solid rgba(0, 0, 0, 0.08);
}

.omm-l2-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	font: inherit;
	color: inherit;
	text-align: start;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.omm-l2-item.is-current .omm-l2-link,
.omm-l2-link:hover,
.omm-l2-link:focus-visible {
	background: rgba(0, 0, 0, 0.05);
}

.omm-chevron {
	width: 0.5em;
	height: 0.5em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	flex: none;
}

.omm-chevron--sm {
	width: 0.42em;
	height: 0.42em;
}

.omm-grids {
	position: relative;
	padding: 16px;
}

.omm-grid {
	width: 100%;
}

.omm-panel-fallback {
	padding: 16px;
	color: #888;
	font-size: 0.9em;
}

/* --------------------------------------------------- Images --------- */

.omm-img {
	max-width: 100%;
	height: auto;
}

/* -------------------------------------------------- Stagger --------- */

@media (prefers-reduced-motion: no-preference) {
	/* Per-card cascade (when the L3 template's cards carry the .omm-card class).
	   First declaration uses the JS-provided --omm-i (all browsers); the second
	   uses sibling-index() where supported and silently wins. */
	.omm[data-stagger="1"] .omm-grid.is-active .omm-card {
		animation: omm-slide var(--omm-dur) var(--omm-ease) both;
		animation-delay: calc(min(var(--omm-i, 0), var(--omm-cap)) * var(--omm-step));
		animation-delay: calc(min(sibling-index(), var(--omm-cap)) * var(--omm-step));
		will-change: transform, opacity;
	}

	/* Baseline reveal for grids without tagged cards. */
	.omm[data-stagger="1"] .omm-grid.is-active:not(:has(.omm-card)) {
		animation: omm-slide var(--omm-dur) var(--omm-ease) both;
	}

	/* Stagger disabled -> simple fade. */
	.omm[data-stagger="0"] .omm-grid.is-active {
		animation: omm-fade 0.2s ease both;
	}
}

@media (prefers-reduced-motion: reduce) {
	.omm .omm-grid.is-active,
	.omm .omm-grid.is-active .omm-card {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

/* -------------------------------------------------- Focus ----------- */

.omm-l1-link:focus-visible,
.omm-l2-link:focus-visible,
.omm-toggle:focus-visible,
.omm-burger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 4px;
}

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

@media (max-width: 1024px) {
	.omm-burger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: none;
		color: inherit;
		cursor: pointer;
	}

	.omm-burger__bars,
	.omm-burger__bars::before,
	.omm-burger__bars::after {
		content: "";
		display: block;
		width: 22px;
		height: 2px;
		background: currentColor;
		position: relative;
	}

	.omm-burger__bars::before {
		position: absolute;
		top: -7px;
	}

	.omm-burger__bars::after {
		position: absolute;
		top: 7px;
	}

	.omm-nav {
		position: fixed;
		inset: 0 0 0 auto;
		width: min(86vw, 380px);
		max-width: 100%;
		background: #fff;
		transform: translateX(100%);
		transition: transform 0.25s ease;
		overflow-y: auto;
		z-index: 1000;
		visibility: hidden;
		padding: 64px 16px 24px;
	}

	.omm.is-open .omm-nav {
		transform: translateX(0);
		visibility: visible;
	}

	.omm.is-open::before {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		z-index: 999;
	}

	.omm-l1 {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.omm-l1-item {
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	}

	.omm-l1-link {
		padding: 14px 4px;
	}

	/* Panels become inline accordion sections on mobile. */
	.omm-panel {
		position: static;
		display: none;
		visibility: visible;
		opacity: 1;
		transform: none;
		box-shadow: none;
		z-index: auto;
	}

	.omm-l1-item.is-open > .omm-panel,
	.omm-toggle[aria-expanded="true"] ~ .omm-panel {
		display: block;
	}

	.omm-panel__inner {
		grid-template-columns: 1fr;
		box-shadow: none;
		border-radius: 0;
	}

	.omm-l2 {
		border-inline-end: 0;
		padding: 0 0 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.omm-nav {
		transition: none;
	}
}
