/**
 * Alleen op de site (niet in de editor): zwevende sticky header, foto-hero
 * achter de header en het mobiele menu.
 */

body {
	overflow-x: clip;
}

/* ---------- Sticky, zwevende header ---------- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 30;
	padding: 14px clamp(16px, 4vw, 48px) 0;
	pointer-events: none;
}

body.admin-bar header.wp-block-template-part {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar header.wp-block-template-part {
		top: 46px;
	}
}

/* Onder 600px staat de admin-balk zelf niet vast. */
@media (max-width: 600px) {
	body.admin-bar header.wp-block-template-part {
		top: 0;
	}
}

.ems-header-bar {
	pointer-events: auto;
}

/* Foto-hero als eerste blok schuift onder de zwevende header door. */
.ems-main > .wp-block-post-content > .ems-hero:first-child {
	margin-top: -80px !important;
}

/* ---------- Carrousel / raster: tonen wat er (nog) niet is ---------- */
.ems-editor-notice {
	padding: 24px;
	border: 1px dashed #444;
	border-radius: 16px;
	color: var(--ems-mut);
}

/* ---------- Mobiel menu ---------- */
@media (max-width: 960px) {
	.ems-header-bar {
		row-gap: 0;
		padding: 8px 8px 8px 18px;
	}

	.ems-menu-toggle {
		display: inline-grid;
		align-content: center;
		justify-items: center;
		gap: 5px;
		width: 46px;
		height: 46px;
		margin-left: 2px;
		padding: 0;
		border: 1px solid #3a3a3a;
		border-radius: 12px;
		background: transparent;
		cursor: pointer;
	}

	.ems-menu-toggle span {
		display: block;
		width: 20px;
		height: 2px;
		border-radius: 2px;
		background: #fff;
		transition: transform .25s var(--ems-ease), opacity .2s;
	}

	.is-menu-open .ems-menu-toggle span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}

	.is-menu-open .ems-menu-toggle span:nth-child(2) {
		opacity: 0;
	}

	.is-menu-open .ems-menu-toggle span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	/* Menu klapt open onder de balk, binnen dezelfde zwevende kaart. */
	.ems-primary-nav {
		order: 10;
		display: grid;
		grid-template-rows: 0fr;
		width: 100%;
		visibility: hidden;
		transition: grid-template-rows .3s var(--ems-ease), visibility 0s .3s;
	}

	.is-menu-open .ems-primary-nav {
		grid-template-rows: 1fr;
		visibility: visible;
		transition: grid-template-rows .3s var(--ems-ease);
	}

	.ems-primary-nav > * {
		min-height: 0;
		overflow: hidden;
	}

	/* Geen padding op de lijst zelf: die zou het dichtgeklapte menu open houden. */
	.ems-primary-nav-list {
		flex-direction: column;
		gap: 2px;
		padding: 0;
	}

	.ems-primary-nav-list > li:first-child {
		margin-top: 10px;
	}

	.ems-primary-nav-list > li:last-child {
		margin-bottom: 6px;
	}

	.ems-primary-nav-list a {
		padding: 14px 12px;
		font-size: 17px;
	}
}

/* Smal scherm: offerteknop zit al in de hero en onder "Contact" in het menu. */
@media (max-width: 520px) {
	.ems-header-bar .ems-header-cta {
		display: none;
	}

	.is-menu-open .ems-header-bar .ems-header-cta {
		display: flex;
		order: 11;
		width: 100%;
		margin: 4px 0 4px;
	}

	.is-menu-open .ems-header-cta .wp-block-button,
	.is-menu-open .ems-header-cta .wp-block-button__link {
		width: 100%;
	}
}

@media (max-width: 340px) {
	.ems-site-title a {
		font-size: 0;
		gap: 0;
	}

	.ems-site-title a::before {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
