:where(*, *::before, *::after) {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	overflow-x: clip;
}

body {
	min-height: 100vh;
	overflow-x: clip;
	overflow-wrap: break-word;
}

:where(img, picture, svg, video) {
	display: block;
	height: auto;
	max-width: 100%;
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid Highlight;
	outline-offset: 3px;
}

.wp-site-blocks {
	display: flex;
	min-height: 100vh;
	flex-direction: column;
	gap: 0;
}

.wp-site-blocks > main {
	flex: 1;
	margin-top: 0;
	padding-top: 0;
}

.wp-site-blocks > header,
.wp-site-blocks > .wp-block-template-part:first-child {
	margin-bottom: 0;
}

.wp-block-post-content > .mabil-hero:first-child,
.wp-block-post-content > .wp-block-mabil-hero:first-child {
	margin-block-start: 0;
}

.nav {
	--nav-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--nav-line: color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	position: sticky;
	top: 0;
	z-index: 60;
	background: color-mix(in srgb, var(--wp--preset--color--base) 72%, transparent);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--nav-line);
	transition: background 0.3s var(--nav-ease), border-color 0.3s var(--nav-ease);
}

.nav.scrolled {
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	border-bottom-color: color-mix(in srgb, var(--wp--preset--color--contrast) 22%, transparent);
}

.nav__inner,
.nav .nav__inner.wp-block-group,
.nav .nav__inner.is-layout-flex {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	column-gap: 1.5rem;
	row-gap: 0;
	min-height: 82px;
	flex-wrap: nowrap;
}

.nav__inner > .wp-block-site-logo,
.nav__inner > .nav__logo,
.nav__inner > .wp-block-mabil-classic-navigation,
.nav__inner > .wp-block-mabil-nav-cta {
	display: flex;
	align-items: center;
	align-self: center;
	margin: 0;
	width: auto;
	max-width: none;
}

.nav__inner > .wp-block-site-logo,
.nav__inner > .nav__logo {
	grid-column: 1;
	justify-self: start;
	flex: 0 0 auto;
	line-height: 0;
}

.nav__inner > .wp-block-mabil-classic-navigation {
	grid-column: 2;
	justify-self: center;
	justify-content: center;
	width: 100%;
	min-width: 0;
}

.nav__inner > .wp-block-mabil-nav-cta {
	grid-column: 3;
	justify-self: end;
	flex: 0 0 auto;
}

.nav__inner > .wp-block-site-logo img,
.nav__inner > .nav__logo img {
	height: 50px;
	width: auto;
}

/* Classic menu (wp_nav_menu) */
.nav-links-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	width: 100%;
	min-width: 0;
}

.nav-desktop {
	display: flex;
	align-items: center;
}

.nav-desktop ul.nav-links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 2.2rem;
	align-items: center;
	justify-content: center;
}

.nav-desktop li {
	position: relative;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-desktop .nav-links > .menu-item > a {
	display: inline-flex;
	align-items: center;
	gap: 0.38em;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 500;
	font-size: 1rem;
	letter-spacing: 0.005em;
	color: var(--wp--preset--color--muted);
	position: relative;
	padding: 0.3em 0;
	white-space: nowrap;
	text-decoration: none;
	transition: color 0.2s var(--nav-ease);
}

.nav-desktop .nav-links > .menu-item > a::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	height: 1.5px;
	width: 0;
	background: var(--wp--preset--color--red-hi);
	transition: width 0.25s var(--nav-ease);
}

.nav-desktop .nav-links > .menu-item > a:hover,
.nav-desktop .nav-links > .menu-item.current-menu-item > a,
.nav-desktop .nav-links > .menu-item.current-menu-ancestor > a,
.nav-desktop .nav-links > .menu-item.current_page_item > a {
	color: var(--wp--preset--color--contrast);
}

.nav-desktop .nav-links > .menu-item > a:hover::before,
.nav-desktop .nav-links > .menu-item.current-menu-item > a::before,
.nav-desktop .nav-links > .menu-item.current-menu-ancestor > a::before,
.nav-desktop .nav-links > .menu-item.current_page_item > a::before {
	width: 100%;
}

.nav-desktop .menu-item-has-children::after {
	content: "";
	position: absolute;
	top: 100%;
	left: -10px;
	right: -10px;
	height: 18px;
}

.nav-desktop .menu-item-has-children > a::after {
	content: "";
	width: 11px;
	height: 11px;
	flex: 0 0 auto;
	background-color: var(--wp--preset--color--muted);
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	transition: transform 0.25s var(--nav-ease), background-color 0.2s var(--nav-ease);
}

.nav-desktop .menu-item-has-children:hover > a::after,
.nav-desktop .menu-item-has-children:focus-within > a::after {
	transform: rotate(180deg);
	background-color: var(--wp--preset--color--red-hi);
}

.nav-desktop .sub-menu {
	display: none;
	position: absolute;
	top: calc(100% + 16px);
	left: 50%;
	transform: translateX(-50%) translateY(8px);
	min-width: 16rem;
	margin: 0;
	padding: 10px;
	list-style: none;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--nav-line);
	border-radius: var(--wp--custom--radius--lg);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.22s var(--nav-ease), transform 0.22s var(--nav-ease);
	box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6);
	z-index: 90;
}

.nav-desktop .sub-menu::before {
	content: "";
	position: absolute;
	top: -5px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 10px;
	height: 10px;
	background: var(--wp--preset--color--surface);
	border-left: 1px solid var(--nav-line);
	border-top: 1px solid var(--nav-line);
}

.nav-desktop li:hover > .sub-menu,
.nav-desktop li:focus-within > .sub-menu {
	display: block;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

.nav-desktop .sub-menu .menu-item {
	margin: 0;
}

.nav-desktop .sub-menu a {
	display: flex;
	align-items: center;
	gap: 0.7em;
	padding: 0.66em 0.85em;
	border-radius: var(--wp--custom--radius--md);
	font-weight: 500;
	font-size: 0.98rem;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	white-space: nowrap;
}

.nav-desktop .sub-menu a::before {
	display: none;
}

.nav-desktop .sub-menu a:hover,
.nav-desktop .sub-menu .current-menu-item > a {
	color: var(--wp--preset--color--contrast);
	background: color-mix(in srgb, var(--wp--preset--color--surface) 70%, var(--wp--preset--color--contrast) 30%);
}

/* CTA button */
.nav-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.62em 1.25em;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.96rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1;
	color: #fff;
	background: var(--wp--preset--color--red);
	border: none;
	border-radius: 999px;
	white-space: nowrap;
	text-decoration: none;
	flex: 0 0 auto;
	transition: background 0.25s var(--nav-ease), transform 0.25s var(--nav-ease), box-shadow 0.25s var(--nav-ease);
}

.nav-cta__icon {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.nav-cta:hover,
.nav-cta:focus-visible {
	color: #fff;
	background: var(--wp--preset--color--red-hi);
	transform: translateY(-1px);
	box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--wp--preset--color--red) 42%, transparent);
}

/* Burger + drawer (mobile) */
.burger {
	display: none;
	width: 46px;
	height: 46px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 22%, transparent);
	border-radius: 999px;
	background: transparent;
	padding: 0;
	position: relative;
	flex: 0 0 auto;
}

.burger span {
	position: absolute;
	left: 12px;
	right: 12px;
	height: 1.5px;
	background: currentColor;
	transition: transform .25s ease, opacity .25s ease;
}

.burger span:nth-child(1) {
	top: 16px;
}

.burger span:nth-child(2) {
	top: 22px;
}

.burger span:nth-child(3) {
	top: 28px;
}

.burger.open span:nth-child(1) {
	top: 22px;
	transform: rotate(45deg);
}

.burger.open span:nth-child(2) {
	opacity: 0;
}

.burger.open span:nth-child(3) {
	top: 22px;
	transform: rotate(-45deg);
}

.mobile-nav {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: auto;
	width: min(86vw, 360px);
	max-width: 100vw;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 92%, transparent);
	border-left: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 22%, transparent);
	z-index: 80;
	transform: translate3d(100%, 0, 0);
	visibility: hidden;
	pointer-events: none;
	transition: transform .35s ease, visibility .35s ease;
	padding: 96px clamp(20px, 5vw, 64px) 40px;
	overflow-y: auto;
	overflow-x: hidden;
}

.mobile-nav.open {
	transform: translate3d(0, 0, 0);
	visibility: visible;
	pointer-events: auto;
}

.mobile-nav__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: .75rem;
}

.mobile-nav__list a {
	color: var(--wp--preset--color--muted, inherit);
}

.scrim {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .65);
	z-index: 70;
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s ease;
}

.scrim.open {
	opacity: 1;
	pointer-events: auto;
}

@media (max-width: 880px) {
	.nav__inner {
		min-height: 72px;
	}

	.nav-desktop {
		display: none;
	}

	.nav__cta-wrap,
	.nav-cta {
		display: none;
	}

	.nav-links-wrap {
		flex: 0 0 auto;
		justify-content: flex-end;
	}

	.burger {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
