/*
 * OMTRA mega menu - full-height cascading columns, any depth.
 * Design: Figma "OmtrAdvisory", nodes 4101:66 / 4101:119 / 4101:176. Colours and fonts from the site.
 *
 * Every selector starts with #main-menu .om-mm: the theme dropdown rules on .header__menu,
 * .header__menu--dropdown/--hoverable and li.current-menu-ancestor must not reach the columns.
 * Panels are hidden below the theme breakpoint because the theme hides the top items there.
 */

#main-menu .om-mm {
	--om-mm-blue: #303d9f;
	--om-mm-orange: #ff7900;
	--om-mm-hover-bg: rgba(223, 134, 36, 0.1);
	--om-mm-col-w: clamp(250px, 24.5vw, 367px); /* 4 columns fit from 1024px up */
	--om-mm-top: 98px;
	/* Depth: every column throws its shadow only to the right, onto the next one (which sits below). */
	--om-mm-shadow: 26px 0 44px -18px rgba(0, 0, 0, 0.24);
	--om-mm-speed: 0.22s;
}

/* ---------- Top bar: open state = same look as hover ---------- */

#main-menu .om-mm > li.is-open > a {
	background-color: var(--om-mm-blue);
	color: #fff;
}

#main-menu .om-mm > li.is-open > a svg * {
	fill: #fff;
}

#main-menu .om-mm > li > a:focus-visible {
	outline: 2px solid var(--om-mm-blue);
	outline-offset: -2px;
}

#main-menu .om-mm > li.is-open > a:focus-visible {
	outline-color: #fff;
}

/* ---------- Panel: full width under the header, blurred page behind ---------- */

#main-menu .om-mm .om-mm__panel {
	position: fixed;
	z-index: 10;
	top: var(--om-mm-top);
	left: 0;
	width: 100%;
	height: calc(100vh - var(--om-mm-top));
	margin: 0;
	padding: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: rgba(255, 255, 255, 0.1);
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
	text-align: left;
	white-space: normal;
	cursor: default;
	visibility: hidden;
	opacity: 0;
	transition: opacity var(--om-mm-speed) ease, visibility 0s linear var(--om-mm-speed);
}

/* Shadow under the main bar, above every column: the top menu reads as the starting level. */
#main-menu .om-mm .om-mm__panel::before {
	content: "";
	display: block;
	position: -webkit-sticky;
	position: sticky;
	z-index: 6;
	top: 0;
	height: 24px;
	margin-bottom: -24px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.05) 45%, rgba(0, 0, 0, 0));
	pointer-events: none;
}

@supports (height: 100dvh) {
	#main-menu .om-mm .om-mm__panel {
		height: calc(100dvh - var(--om-mm-top));
	}
}

#main-menu .om-mm > li.is-open > .om-mm__panel,
#main-menu .om-mm:not(.om-mm--js) > li:hover > .om-mm__panel,
#main-menu .om-mm:not(.om-mm--js) > li:focus-within > .om-mm__panel {
	visibility: visible;
	opacity: 1;
	transition: opacity var(--om-mm-speed) ease, visibility 0s;
}

/* A panel or column that is closing (still fading) must not catch the pointer. */
#main-menu .om-mm--js > li:not(.is-open) > .om-mm__panel,
#main-menu .om-mm--js .om-mm__item:not(.is-open) > .om-mm__col {
	pointer-events: none;
}

/* ---------- Columns ---------- */

#main-menu .om-mm .om-mm__col {
	position: absolute;
	top: 0;
	left: 100%;
	box-sizing: border-box;
	width: var(--om-mm-col-w);
	min-height: 100%;
	margin: 0;
	padding: 138px 0 48px;
	background: #fff;
	box-shadow: var(--om-mm-shadow);
	visibility: hidden;
	opacity: 0;
	transform: translateX(-14px);
	transition: opacity var(--om-mm-speed) ease, transform var(--om-mm-speed) ease, visibility 0s linear var(--om-mm-speed);
}

/* Shadow received from the previous column: this one slides out from underneath it.
   Above the item highlight too (z-index), so the edge always reads as "below". */
#main-menu .om-mm .om-mm__col::before {
	content: "";
	position: absolute;
	z-index: 1;
	top: 0;
	bottom: 0;
	left: 0;
	width: 60px;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.17), rgba(0, 0, 0, 0.06) 35%, rgba(0, 0, 0, 0));
	pointer-events: none;
}

#main-menu .om-mm .om-mm__col--1 {
	position: relative;
	left: 0;
	padding-top: 60px;
	visibility: inherit;
	opacity: 1;
	transform: translateX(var(--om-mm-shift, 0px));
	transition: transform var(--om-mm-speed) ease;
}

#main-menu .om-mm .om-mm__col--1::before {
	content: none;
}

#main-menu .om-mm .om-mm__item.is-open > .om-mm__col,
#main-menu .om-mm:not(.om-mm--js) .om-mm__item:hover > .om-mm__col,
#main-menu .om-mm:not(.om-mm--js) .om-mm__item:focus-within > .om-mm__col {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity var(--om-mm-speed) ease, transform var(--om-mm-speed) ease, visibility 0s;
}

/* Column 1 title: name of the top item, orange rule below. */
#main-menu .om-mm .om-mm__title {
	margin: 0 37px 34px;
	padding: 0 0 15px;
	position: relative;
	color: var(--om-mm-blue);
	font-size: 24px;
	font-weight: 700;
	line-height: 29px;
	letter-spacing: 0.02em;
	text-transform: none;
}

#main-menu .om-mm .om-mm__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 70px;
	height: 3px;
	background: var(--om-mm-orange);
}

/* ---------- Lists and items (reset of the theme dropdown rules) ---------- */

#main-menu .om-mm .om-mm__list {
	display: block;
	position: static;
	margin: 0;
	padding: 0;
	list-style: none;
	background: transparent;
	transform: none;
	min-width: 0;
	width: auto;
	height: auto;
}

#main-menu .om-mm .om-mm__list > li {
	display: block;
	float: none;
	position: static;
	width: auto;
	height: auto;
	margin: 0 0 11px;
	padding: 0;
	border: 0;
	background: transparent;
}

#main-menu .om-mm .om-mm__list > li::before,
#main-menu .om-mm .om-mm__list > li::after {
	content: none;
}

#main-menu .om-mm .om-mm__link {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	box-sizing: border-box;
	width: 100%;
	min-height: 39px;
	height: auto;
	margin: 0;
	padding: 10px 52px 10px 71px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--om-mm-blue);
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-align: left;
	text-decoration: none;
	text-transform: uppercase;
	white-space: normal;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.15s ease;
}

/* Orange dash before every label: short in column 1, joined to the edge in the next ones. */
#main-menu .om-mm .om-mm__link::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 37px;
	width: 20px;
	height: 1px;
	background: var(--om-mm-orange);
}

#main-menu .om-mm .om-mm__col:not(.om-mm__col--1) .om-mm__link::before {
	left: 0;
	width: 57px;
}

#main-menu .om-mm .om-mm__link::after {
	content: none;
}

#main-menu .om-mm .om-mm__label {
	display: block;
	max-width: 192px;
	color: inherit;
}

#main-menu .om-mm .om-mm__link:hover,
#main-menu .om-mm .om-mm__item.is-open > .om-mm__link {
	background: var(--om-mm-hover-bg);
	color: var(--om-mm-blue);
}

/* Separate rule: browsers without :focus-visible must not drop the one above. */
#main-menu .om-mm .om-mm__link:focus-visible {
	background: var(--om-mm-hover-bg);
	color: var(--om-mm-blue);
	outline: 2px solid var(--om-mm-blue);
	outline-offset: -2px;
}

#main-menu .om-mm .om-mm__link:focus:not(:focus-visible) {
	outline: none;
}

/* Current page: text stays blue (contrast), the orange dash gets thicker. */
#main-menu .om-mm .om-mm__link[aria-current="page"]::before {
	height: 3px;
	margin-top: -1px;
}

/* Arrow of items with a sub-column. */
#main-menu .om-mm .om-mm__arrow {
	position: absolute;
	top: 50%;
	right: 27px;
	width: 10px;
	height: 11px;
	margin-top: -5.5px;
	color: var(--om-mm-orange);
	transform: none;
	transition: transform 0.15s ease;
}

#main-menu .om-mm .om-mm__arrow,
#main-menu .om-mm .om-mm__arrow * {
	fill: currentColor;
}

#main-menu .om-mm .om-mm__item.is-open > .om-mm__link .om-mm__arrow {
	transform: translateX(3px);
}

/* External link icon (target _blank). */
#main-menu .om-mm .om-mm__link .om-external-link-icon-wrap {
	flex: 0 0 auto;
	display: inline-flex;
	width: 10px;
	height: 10px;
	margin-left: 8px;
}

#main-menu .om-mm .om-mm__link .om-external-link-icon-wrap svg {
	width: 10px;
	height: 10px;
}

#main-menu .om-mm .om-mm__link .om-external-link-icon-wrap {
	color: var(--om-mm-orange);
}

/* ---------- Accessibility / motion ---------- */

@media (prefers-reduced-motion: reduce) {
	#main-menu .om-mm .om-mm__panel,
	#main-menu .om-mm .om-mm__col,
	#main-menu .om-mm .om-mm__link,
	#main-menu .om-mm .om-mm__arrow {
		transition: none !important;
	}
}

/* Browsers without backdrop-filter: a light veil instead of the blur. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	#main-menu .om-mm .om-mm__panel {
		background: rgba(255, 255, 255, 0.82);
	}
}
