/* Site header with mega menu, a copy of the menu design. Below 1360px the mobile menu takes over.
   Logo, menu and button sit together in the content container of the page (content size of theme.json, root padding). */
.mg-header {
	--mg-pad: var(--wp--style--root--padding-left, clamp(20px, 4.8vw, 92px));
	--mg-wide: var(--wp--style--global--content-size, 1296px);
	--mg-red: var(--wp--preset--color--color-4, #AA0000);
	--mg-maroon: var(--wp--preset--color--color-1, #7F001B);
	--mg-orange: var(--wp--preset--color--color-2, #FF6400);
	--mg-orange-hover: #FF5500;
	--mg-yellow: #FFB90A;
	--mg-black: #000;
	--mg-white: #fff;
	--mg-tint: #F8F8F8;
	--mg-grey: #726660;
	--mg-line: #00000022;
	--mg-display: var(--wp--preset--font-family--heading);
	position: relative;
	z-index: 100;
	margin-block: 0;
	font-family: var(--wp--preset--font-family--body);
	line-height: 1.3;
	letter-spacing: normal;
	color: var(--mg-black);
}

.mg-header p,
.mg-header ul {
	margin: 0;
}

.mg-header ul {
	padding: 0;
	list-style: none;
}

.mg-header button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	cursor: pointer;
}

.mg-header a {
	color: var(--mg-black);
}

.mg-header a:hover {
	color: var(--mg-orange);
}

.mg-header :focus-visible {
	outline: 2px solid var(--mg-orange);
	outline-offset: 2px;
}

.mg-container {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--mg-wide);
	height: 100%;
	margin: 0 auto;
}

/* Service bar: bordeaux, links on the right. */
.mg-header__service {
	box-sizing: border-box;
	height: 40px;
	padding: 0 var(--mg-pad);
	background: var(--mg-maroon);
	color: var(--mg-white);
	font-size: 13px;
}

.mg-header__service .mg-container {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.mg-service {
	display: flex;
	align-items: center;
	gap: 24px;
}

.mg-header .mg-service a {
	color: var(--mg-white);
	text-decoration: none;
}

.mg-header .mg-service a:hover {
	color: var(--mg-yellow);
}

/* Main bar: logo, menu in the middle, donate button. */
.mg-header__bar {
	box-sizing: border-box;
	height: 84px;
	padding: 0 var(--mg-pad);
	border-bottom: 1px solid var(--mg-line);
	background: var(--mg-white);
}

.mg-header__inner {
	display: flex;
	align-items: center;
	gap: 16px;
}

.mg-header__logo a,
.mg-mobile__logo a {
	display: block;
	text-decoration: none;
}

.mg-header__logo img {
	display: block;
	width: auto;
	height: 40px;
}

.mg-mega {
	display: flex;
	flex: 1;
	justify-content: center;
	min-width: 0;
}

/* The top items spread over the space between logo and button, with equal space in between. */
.mg-mega__list {
	display: flex;
	flex: 1;
	justify-content: space-between;
}

.mg-header .mg-mega__toggle {
	display: flex;
	align-items: center;
	gap: 5px;
	height: 84px;
	padding: 0 5px;
	color: var(--mg-black);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.mg-header .mg-mega__toggle[aria-expanded="true"] {
	box-shadow: inset 0 -4px 0 var(--mg-orange);
}

.mg-header .mg-mega__toggle:focus-visible {
	outline-offset: -2px;
}

.mg-chevron {
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	transition: transform 0.15s ease;
}

[aria-expanded="true"] > .mg-chevron {
	transform: rotate(180deg);
}

/* Buttons as in the design system: pill, semibold, optional arrow. */
.mg-header .mg-btn {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 16px 24px;
	border: 1px solid transparent;
	border-radius: 9999px;
	font-size: 17.6px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out, transform 0.15s ease-out;
}

.mg-header .mg-btn:active {
	transform: scale(0.97);
}

.mg-header .mg-btn--sm {
	padding: 9.6px 17.6px;
	font-size: 15.2px;
}

.mg-header .mg-btn--solid {
	border-color: var(--mg-orange);
	background: var(--mg-orange);
	color: var(--mg-white);
}

.mg-header .mg-btn--solid:hover {
	border-color: var(--mg-orange-hover);
	background: var(--mg-orange-hover);
	color: var(--mg-white);
}

.mg-header .mg-btn--ghost {
	border-color: var(--mg-black);
	background: transparent;
	color: var(--mg-black);
}

.mg-header .mg-btn--ghost:hover {
	background: var(--mg-black);
	color: var(--mg-white);
}

.mg-header .mg-btn--ghost-inverse {
	border-color: var(--mg-white);
	background: transparent;
	color: var(--mg-white);
}

.mg-header .mg-btn--ghost-inverse:hover {
	background: var(--mg-white);
	color: var(--mg-red);
}

.mg-arrow {
	flex-shrink: 0;
}

/* Mega menu panel, full width below the header. */
.mg-panel {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 2;
	border-radius: 0 0 8px 8px;
	background: var(--mg-white);
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
	cursor: auto;
}

.mg-panel[hidden] {
	display: none;
}

/* Opening fades the panel and the dark layer in. Switching to another item while a panel is open
   shows the new panel at once (view.js sets mg-switch), so it does not flicker. */
@keyframes mg-fade-in {
	from {
		opacity: 0;
	}
}

.mg-panel,
.mg-scrim {
	animation: mg-fade-in 0.2s ease-out;
}

.mg-switch .mg-panel {
	animation: none;
}

/* The panel content lines up with the logo, in the same container. */
.mg-panel__inner {
	box-sizing: border-box;
	display: flex;
	gap: 48px;
	max-width: calc(var(--mg-wide) + 2 * var(--mg-pad));
	margin: 0 auto;
	padding: 40px var(--mg-pad);
}

.mg-panel__main {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.mg-panel__columns {
	display: flex;
	gap: 40px;
}

.mg-panel__column {
	flex: 1;
	min-width: 0;
}

.mg-header .mg-eyebrow {
	margin-bottom: 8px;
	color: var(--mg-red);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mg-header .mg-link {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 -12px;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--mg-black);
	text-decoration: none;
}

.mg-header .mg-link:hover {
	background: var(--mg-tint);
	color: var(--mg-black);
}

.mg-link__title {
	font-size: 16px;
	font-weight: 600;
}

.mg-link:hover .mg-link__title {
	color: var(--mg-red);
}

.mg-link__text {
	color: var(--mg-grey);
	font-size: 14px;
	line-height: 1.4;
}

/* Small links below a menu link, such as the parking garages below Route en parkeren. */
.mg-header .mg-sublinks {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: -4px 0 8px;
	padding: 0;
	list-style: none;
}

.mg-header .mg-sublinks .mg-sublink {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 0;
	padding: 3px 0;
	color: var(--mg-grey);
	font-size: 14px;
	line-height: 1.3;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.mg-header .mg-sublinks .mg-sublink:hover {
	color: var(--mg-red);
}

.mg-header .mg-sublink__icon {
	flex-shrink: 0;
	color: var(--mg-maroon);
}

/* In the mobile menu the small links stay easy to tap. */
.mg-header .mg-acc__links .mg-sublinks {
	margin: -6px 0 6px;
}

.mg-header .mg-acc__links .mg-sublinks .mg-sublink {
	min-height: 36px;
	padding: 0;
}

.mg-header .mg-panel__overview {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-top: 16px;
	border-top: 1px solid var(--mg-line);
	color: var(--mg-black);
	font-size: 15px;
	font-weight: 600;
}

.mg-header .mg-panel__overview:hover {
	color: var(--mg-orange);
}

/* Address and opening hours, as an extra column. */
.mg-info {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 24px;
	border-radius: 8px;
	background: var(--mg-tint);
	font-size: 15px;
	line-height: 1.5;
}

.mg-header .mg-info .mg-eyebrow {
	margin-bottom: 0;
}

/* Highlighted card on the right. */
.mg-panel__aside {
	display: flex;
	flex-shrink: 0;
	width: 360px;
}

.mg-card {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	padding: 32px;
	border-radius: 8px;
}

.mg-card__eyebrow {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mg-card__title {
	font-family: var(--mg-display);
	font-size: 36px;
	line-height: 1.05;
}

.mg-card__text {
	font-size: 15px;
	line-height: 1.5;
}

.mg-card__caption {
	font-size: 14px;
}

.mg-header .mg-card__button {
	margin-top: auto;
}

.mg-card--small .mg-card__title {
	font-size: 32px;
}

.mg-card--quote .mg-card__title {
	font-size: 24px;
	line-height: 1.2;
}

.mg-card--large {
	gap: 10px;
}

.mg-card--large .mg-card__title {
	font-size: 72px;
	line-height: 1;
}

.mg-card--bordeaux {
	background: var(--mg-maroon);
	color: var(--mg-white);
}

.mg-card--rood {
	background: var(--mg-red);
	color: var(--mg-white);
}

.mg-card--bordeaux .mg-card__eyebrow,
.mg-card--rood .mg-card__eyebrow {
	color: var(--mg-yellow);
}

.mg-card--oranje {
	background: var(--mg-orange);
	color: var(--mg-black);
}

.mg-card--geel {
	background: var(--mg-yellow);
	color: var(--mg-black);
}

.mg-card--geel .mg-card__eyebrow {
	color: var(--mg-maroon);
}

.mg-card--grijs {
	border: 1px solid var(--mg-line);
	background: var(--mg-tint);
	color: var(--mg-black);
}

.mg-card--grijs .mg-card__eyebrow {
	color: var(--mg-red);
}

/* Dark layer over the page while the mega menu is open. */
.mg-scrim {
	position: fixed;
	inset: 0;
	z-index: -1;
	background: rgba(0, 0, 0, 0.45);
}

.mg-scrim[hidden] {
	display: none;
}

/* Hamburger, only on small screens. */
.mg-header .mg-header__burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--mg-black);
}

/* Mobile menu: white full screen layer. */
.mg-mobile {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--mg-white);
	color: var(--mg-black);
}

.mg-mobile[hidden] {
	display: none;
}

.admin-bar .mg-mobile {
	top: var(--wp-admin--admin-bar--height, 0px);
}

.mg-mobile__head {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: space-between;
	height: 64px;
	padding: 0 12px 0 20px;
	border-bottom: 1px solid var(--mg-line);
}

.mg-mobile__logo img {
	display: block;
	width: auto;
	height: 34px;
}

.mg-header .mg-mobile__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--mg-black);
}

.mg-mobile__nav {
	flex: 1;
	overflow-y: auto;
	padding: 8px 20px;
	overscroll-behavior: contain;
}

.mg-acc__item {
	border-bottom: 1px solid var(--mg-line);
}

.mg-header .mg-acc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 56px;
	color: var(--mg-black);
	font-size: 18px;
	font-weight: 600;
	text-align: left;
	text-decoration: none;
}

.mg-header .mg-acc__toggle[aria-expanded="true"] {
	color: var(--mg-red);
}

.mg-acc__toggle .mg-chevron {
	width: 14px;
	height: 14px;
}

.mg-acc__panel {
	margin-bottom: 16px;
	padding: 0 0 12px 14px;
	border-left: 3px solid var(--mg-orange);
}

.mg-acc__panel[hidden] {
	display: none;
}

.mg-header .mg-acc__panel .mg-eyebrow {
	margin-bottom: 0;
	padding: 10px 0 2px;
}

.mg-header .mg-acc__links a,
.mg-header .mg-acc__overview {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--mg-black);
	font-size: 16px;
	text-decoration: none;
}

.mg-header .mg-acc__overview {
	gap: 8px;
	margin-top: 4px;
	font-weight: 600;
}

.mg-header .mg-acc__links a:hover,
.mg-header .mg-acc__overview:hover {
	color: var(--mg-red);
}

.mg-mobile__foot {
	display: flex;
	flex-shrink: 0;
	flex-direction: column;
	gap: 14px;
	padding: 16px 20px 24px;
	border-top: 1px solid var(--mg-line);
	background: var(--mg-tint);
}

.mg-mobile__buttons {
	display: flex;
	gap: 10px;
}

.mg-header .mg-mobile__buttons .mg-btn {
	flex: 1;
}

.mg-mobile__links {
	display: flex;
	gap: 20px;
	font-size: 14px;
}

/* The donate button in the bar is the small size, so logo, menu and button fit the content width together. */
.mg-header .mg-header__donate {
	padding: 9.6px 17.6px;
	font-size: 15.2px;
}

/* Between 1360 and 1440px the container is narrower than the content size, the menu text gets a little smaller. */
@media (min-width: 1360px) and (max-width: 1439px) {
	.mg-header .mg-mega__toggle {
		font-size: 14px;
	}
}

/* Below 1360px: logo, donate button and hamburger. The service links move into the mobile menu. */
@media (max-width: 1359px) {
	.mg-header__service,
	.mg-mega,
	.mg-panel,
	.mg-scrim {
		display: none !important;
	}

	.mg-header__bar {
		height: 64px;
	}

	.mg-header__inner {
		justify-content: space-between;
		gap: 12px;
	}

	/* The icon lines up with the container edge, the touch area may stick out. */
	.mg-header .mg-header__burger {
		margin-right: -10px;
	}

	.mg-header__logo {
		margin-right: auto;
	}

	.mg-header__logo img {
		height: 34px;
	}

	.mg-header .mg-header__donate {
		padding: 9.6px 17.6px;
		font-size: 15.2px;
	}

	.mg-header .mg-header__burger {
		display: flex;
	}
}

@media (min-width: 1360px) {
	.mg-mobile {
		display: none !important;
	}
}

@media (max-width: 359px) {
	.mg-header .mg-header__donate .mg-arrow {
		display: none;
	}
}

html.mg-menu-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.mg-chevron,
	.mg-header .mg-btn {
		transition: none;
	}

	.mg-panel,
	.mg-scrim {
		animation: none;
	}
}

/* Sticky header. view.js puts mg-sticky on the header part and measures what sits above the white
   bar, so the action bar and service bar scroll away and the bar with logo, menu and button stays. */
.mg-sticky {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--mg-sticky-offset, 0px));
	z-index: 100;
}

/* On small screens the admin bar scrolls along with the page. */
@media (max-width: 600px) {
	.mg-sticky {
		top: calc(-1 * var(--mg-sticky-offset, 0px));
	}
}

/* An open panel never runs past the bottom of the window. */
.mg-panel {
	max-height: calc(100vh - 84px - var(--wp-admin--admin-bar--height, 0px));
	overflow-y: auto;
}

/* Links to an anchor on the page land below the sticky bar. */
html:has(.mg-sticky) {
	scroll-padding-top: 100px;
}

@media (max-width: 1359px) {
	html:has(.mg-sticky) {
		scroll-padding-top: 80px;
	}
}
