/*
 * Main mega menu – template-parts/navigation/mega-menu.php, assets/js/mega-menu.js
 * Desktop ≥1081px: flyout with columns L2 | L3 | image | CTA.
 * Mobile ≤1080px: accordion inside .big_menu .container (opened by .mbl_bgmnu).
 */

.mm,
.mm ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.mm li {
	list-style: none;
}
.mm-row {
	display: flex;
	align-items: center;
}
.mm a {
	text-decoration: none;
}
.mm-toggle {
	flex: 0 0 auto;
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	box-shadow: none;
}
/* Chevron drawn with borders, takes the text colour. */
.mm-toggle::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translate(-50%, -75%) rotate(45deg);
	transition: transform .2s;
}
.mm-toggle[aria-expanded="true"]::before {
	transform: translate(-50%, -25%) rotate(-135deg);
}
.mm-toggle:focus-visible,
.mm a:focus-visible {
	outline: 2px solid #99e0f2;
	outline-offset: 2px;
}
.mm-flyout a:focus-visible,
.mm-flyout .mm-toggle:focus-visible {
	outline-color: #2d6faa;
}

/* ---------- Desktop ---------- */
@media (min-width: 1081px) {
	.mm {
		float: left;
		width: 100%;
	}
	.mm-l1-list {
		display: flex;
		position: relative;
	}
	.mm-l1 {
		flex: 1 1 0;
		border-right: 1px solid #245f97;
	}
	.mm-l1:last-child {
		border-right: 0;
	}
	.mm-l1 > .mm-row {
		justify-content: left;
		height: 53px;
		padding: 0 10px;
		transition: background-color .15s;
	}
	.mm-l1-link {
		color: #fff;
		font-family: 'Bebas Neue Regular';
		font-size: 20px;
		letter-spacing: 1px;
		text-transform: uppercase;
		white-space: nowrap;
	}
	.mm-toggle-l1 {
		width: 22px;
		height: 22px;
		margin-left: 6px;
		color: #fff;
	}
	.mm-l1:hover > .mm-row,
	.mm-l1.is-open > .mm-row {
		background: #2d6faa;
	}
	.mm-l1.has-flyout.is-open > .mm-row {
		background: #fff;
	}
	.mm-l1.has-flyout.is-open .mm-l1-link,
	.mm-l1.has-flyout.is-open .mm-toggle-l1 {
		color: #153b60;
	}
	.mm-l1.is-current .mm-l1-link,
	.mm-l1.is-ancestor .mm-l1-link {
		color: #a4e0f9;
	}

	.mm-flyout {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 20;
		background: #fff;
		text-align: left;
	}
	.mm-l1.is-open > .mm-flyout,
	.mm:not(.mm-js) .mm-l1:hover > .mm-flyout,
	.mm:not(.mm-js) .mm-l1:focus-within > .mm-flyout {
		display: block;
	}
	.mm-flyout-inner {
		display: flex;
		align-items: flex-start;
		gap: 30px;
		padding: 35px 30px 40px;
		box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.2);
	}

	/* Column 1 (+2): L2, with the L3 lists placed into the second column.
	   The L3 column is always reserved, so the image sits in the same place in every flyout. */
	.mm-l2-list {
		flex: 0 0 500px;
		position: relative;
		align-self: stretch;
	}
	.mm-l2 {
		width: 240px;
	}
	.mm-l2 > .mm-row {
		padding: 10px 0;
	}
	.mm-l2-link {
		color: #2d6faa;
		font-family: 'roboto_reg';
		font-size: 16px;
		line-height: 1.25;
		letter-spacing: .3px;
		text-transform: uppercase;
	}
	.mm-l2.is-open > .mm-row .mm-l2-link,
	.mm-l2.is-current > .mm-row .mm-l2-link,
	.mm-l2.is-ancestor > .mm-row .mm-l2-link {
		color: #153b60;
	}
	.mm .mm-l2-link:hover,
	.mm .mm-l2-link:focus-visible {
		color: #99e0f2;
	}
	.mm-toggle-l2 {
		width: 22px;
		height: 22px;
		margin-left: 4px;
		color: #2d6faa;
	}
	/* Same chevron as L1, but it turns right (towards the L3 column) instead of up. */
	.mm-toggle-l2[aria-expanded="true"]::before {
		transform: translate(-75%, -50%) rotate(-45deg);
	}
	.mm .mm-l3-list {
		display: none;
		position: absolute;
		top: 0;
		left: 260px;
		width: 240px;
		min-height: 100%;
		padding-left: 15px;
		border-left: 2px solid #c9d8e8;
	}
	.mm-l2.is-open > .mm-l3-list,
	.mm:not(.mm-js) .mm-l2:hover > .mm-l3-list {
		display: block;
	}
	.mm-l3 {
		padding: 5px 0;
	}
	.mm-l3-link {
		color: #2d6faa;
		font-family: 'roboto_reg';
		font-size: 15px;
		line-height: 1.3;
	}
	.mm-l3.is-current .mm-l3-link {
		color: #153b60;
		text-decoration: underline;
	}
	.mm .mm-l3-link:hover,
	.mm .mm-l3-link:focus-visible {
		color: #99e0f2;
	}

	/* Column 3: image */
	.mm-media {
		flex: 1 1 auto;
		max-width: 360px;
	}
	.mm-media-img {
		display: block;
		width: 100%;
		height: auto;
	}

	/* Column 4: CTA */
	.mm-cta {
		flex: 0 0 220px;
		margin-left: auto;
	}
	.mm-cta-box {
		position: relative;
		display: block;
		padding: 15px 15px 18px;
		background: #009534 url(../../images/bell.png) no-repeat center center;
		background-size: auto 55%;
		box-shadow: 0 6px 4px #cfe0ed;
		color: #fff;
		font-family: 'Bebas Neue Book';
		font-size: 19px;
		line-height: 1.15;
		letter-spacing: .5px;
		text-transform: uppercase;
	}
	.mm-cta-box::after {
		content: "";
		position: absolute;
		top: 100%;
		left: 25px;
		border-top: 26px solid #009534;
		border-right: 26px solid transparent;
	}
	.mm-cta-box:hover {
		color: #fff;
		background-color: #007f2c;
	}
	.mm-cta-box:hover::after {
		border-top-color: #007f2c;
	}
	.mm-cta-action {
		display: block;
		font-family: 'Bebas Neue Bold';
	}
	.mm-cta-text {
		margin-top: 40px;
		color: #2d6faa;
		font-family: 'roboto_reg';
		font-size: 14px;
		line-height: 1.4;
	}
	.mm-cta-text p {
		margin: 0 0 1em;
		color: inherit;
		font-size: inherit;
		line-height: inherit;
	}
	.mm-cta-text strong,
	.mm-cta-text b {
		font-family: 'roboto_bold';
		font-weight: normal;
	}
}

/* Only the image or only the CTA: keep them from stretching across the flyout. */
@media (min-width: 1081px) {
	.mm-flyout:not(.has-l2) .mm-cta {
		margin-left: 0;
	}
}

/* ---------- Mobile / tablet: accordion ---------- */
@media (max-width: 1080px) {
	.mm {
		float: left;
		width: 100%;
	}
	.mm-l1 {
		border-bottom: 1px solid #36536e;
	}
	.mm-row {
		justify-content: space-between;
	}
	.mm-l1-link,
	.mm-l2-link,
	.mm-l3-link {
		flex: 1 1 auto;
		display: block;
		padding: 10px;
		color: #fff;
		text-align: left;
	}
	.mm-l1-link {
		font-family: 'Bebas Neue Regular';
		font-size: 18px;
		letter-spacing: 1px;
		text-transform: uppercase;
	}
	.mm-l1.is-current > .mm-row .mm-l1-link,
	.mm-l1.is-ancestor > .mm-row .mm-l1-link,
	.mm-l2.is-current > .mm-row .mm-l2-link,
	.mm-l2.is-ancestor > .mm-row .mm-l2-link,
	.mm-l3.is-current .mm-l3-link {
		color: #a4e0f9;
	}
	.mm .mm-l2-link:hover,
	.mm .mm-l3-link:hover {
		color: #99e0f2;
	}
	.mm-toggle {
		width: 45px;
		height: 45px;
		color: #fff;
	}
	.mm-flyout,
	.mm-l3-list {
		display: none;
	}
	.mm-l1.is-open > .mm-flyout,
	.mm-l2.is-open > .mm-l3-list {
		display: block;
	}
	.mm-flyout {
		background: #2d6faa;
		padding-bottom: 15px;
	}
	.mm-l2 {
		border-top: 1px solid rgba(255, 255, 255, .1);
	}
	.mm-l2-link {
		padding-left: 20px;
		font-family: 'roboto_reg';
		font-size: 15px;
		letter-spacing: .3px;
		text-transform: uppercase;
	}
	.mm-l3-list {
		background: #245f97;
	}
	.mm-l3-link {
		padding: 8px 10px 8px 35px;
		font-family: 'roboto_reg';
		font-size: 15px;
	}
	.mm-media,
	.mm-cta-text {
		display: none;
	}
	.mm-cta {
		padding: 15px 10px 0;
	}
	.mm-cta-box {
		display: block;
		padding: 12px 15px;
		background: #009534;
		color: #fff;
		font-family: 'Bebas Neue Book';
		font-size: 18px;
		letter-spacing: .5px;
		text-align: center;
		text-transform: uppercase;
	}
	.mm-cta-action {
		font-family: 'Bebas Neue Bold';
	}
	.mm-cta-action::before {
		content: " – ";
	}
}

@media (prefers-reduced-motion: reduce) {
	.mm-toggle::before,
	.mm-l1 > .mm-row {
		transition: none;
	}
}

/* ---------- Top bar: "Legal" dropdown (template-parts/navigation/legal-menu.php) ---------- */
.top_right .mm-legal {
	position: relative;
	display: flex;
	align-items: center;
}
.mm-legal-toggle {
	position: relative;
	margin: 0;
	padding: 12px 22px 12px 6px;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: #2d6faa;
	font-family: 'roboto_reg';
	font-size: 14px;
	line-height: 19px;
	cursor: pointer;
}
.mm-legal-toggle::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 6px;
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-75%) rotate(45deg);
	transition: transform .2s;
}
.mm-legal-toggle[aria-expanded="true"]::after {
	transform: translateY(-25%) rotate(-135deg);
}
.mm-legal-toggle:hover,
.mm-legal-toggle[aria-expanded="true"] {
	color: #fff;
}
.mm-legal-toggle:focus-visible,
.top_right .mm-legal-menu a:focus-visible {
	outline: 2px solid #99e0f2;
	outline-offset: -2px;
}
.top_right .mm-legal-menu {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 30;
	width: auto;
	min-width: 220px;
	max-width: calc(100vw - 32px);
	margin: 0;
	padding: 0;
	background: #1b3149;
	border-bottom: 6px solid #2d6faa;
	box-shadow: 0 8px 16px rgba(0, 0, 0, .25);
	list-style: none;
}
.top_right .mm-legal.is-open > .mm-legal-menu,
.top_right .mm-legal:not(.is-js):hover > .mm-legal-menu,
.top_right .mm-legal:not(.is-js):focus-within > .mm-legal-menu {
	display: block;
}
.top_right .mm-legal-menu li {
	float: none;
	width: 100%;
}
.top_right .mm-legal-menu li a {
	display: block;
	padding: 10px 15px;
	border-bottom: 1px solid rgba(255, 255, 255, .15);
	color: #fff;
	font-size: 14px;
	white-space: nowrap;
}
.top_right .mm-legal-menu li:last-child a {
	border-bottom: 0;
}
.top_right .mm-legal-menu li a:hover,
.top_right .mm-legal-menu li.current-menu-item a {
	color: #99e0f2;
}
/* Shortcode items (Borlabs "Cookies") come wrapped in a span. */
.top_right .mm-legal-menu li > span {
	display: block;
}

/* Mobile: keep "Legal" in the top row, left of the mobile language switcher
   (style.css makes .top_right a full-width row at ≤520px). */
@media (max-width: 520px) {
	.top_menu .top_right {
		width: auto !important;
		float: right;
	}
	.top_menu .top_right ul.top-right-menu {
		padding: 0;
	}
	.mm-legal-toggle {
		padding-left: 10px;
	}
	.top_right .mm-legal-menu {
		min-width: 200px;
	}
	.top_right .mm-legal-menu li a {
		white-space: normal;
	}
}
