/**
 * Hunebedmedia – Dynamische pop-ups: weergave op de website.
 */

.hbm-popup {
	--hbm-bg: #ffffff;
	--hbm-text: #1f2933;
	--hbm-accent: #b0451e;
	--hbm-accent-text: #ffffff;
	--hbm-width: 520px;
	--hbm-radius: 14px;
	--hbm-overlay: 0.55;
	--hbm-z: 99999;

	/* Eén bron voor de binnenmarges: titel, inhoud en knoppen liggen zo altijd
	   op dezelfde lijn, ongeacht wat het thema met koppen doet. */
	--hbm-pad-x: 30px;
	--hbm-pad-y: 28px;
	--hbm-title-size: 1.5em;

	position: fixed;
	inset: 0;
	z-index: var(--hbm-z);
	display: flex;
	pointer-events: none;
	font-family: inherit;
}

.hbm-popup[hidden] {
	display: none;
}

/* Basis gelijktrekken: thema's zetten vaak padding, borders of decoratie op koppen. */
.hbm-popup *,
.hbm-popup *::before,
.hbm-popup *::after {
	box-sizing: border-box;
}

.hbm-popup.is-open .hbm-popup__overlay,
.hbm-popup.is-open .hbm-popup__box {
	pointer-events: auto;
}

.hbm-popup__overlay {
	position: absolute;
	inset: 0;
	background: #0b1620;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.hbm-popup.is-open .hbm-popup__overlay {
	opacity: var(--hbm-overlay);
}

.hbm-popup__box {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--hbm-width);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: var(--hbm-bg);
	color: var(--hbm-text);
	border-radius: var(--hbm-radius);
	box-shadow: 0 24px 60px rgba(11, 22, 32, 0.28);
	font-size: 16px;
	line-height: 1.6;
	text-align: left;
	opacity: 0;
	transition: opacity 0.28s ease, transform 0.28s ease;
}

.hbm-popup.is-open .hbm-popup__box {
	opacity: 1;
	transform: none;
}

.hbm-popup__box:focus {
	outline: none;
}

/* Posities */
.hbm-popup--center {
	align-items: center;
	justify-content: center;
	padding: 24px;
}

/* Slide-ins en balken laten de rest van de pagina bruikbaar: het kader beslaat
   alleen de hoek of de balk, en er is geen verduistering. */
.hbm-popup--bottom-right,
.hbm-popup--bottom-left {
	inset: auto 0 0 0;
	align-items: flex-end;
	padding: 20px;
}

.hbm-popup--bottom-right {
	justify-content: flex-end;
}

.hbm-popup--bottom-left {
	justify-content: flex-start;
}

.hbm-popup--bottom-right .hbm-popup__overlay,
.hbm-popup--bottom-left .hbm-popup__overlay {
	display: none;
}

.hbm-popup--top-bar,
.hbm-popup--bottom-bar {
	justify-content: center;
}

.hbm-popup--top-bar {
	inset: 0 0 auto 0;
	align-items: flex-start;
}

.hbm-popup--bottom-bar {
	inset: auto 0 0 0;
	align-items: flex-end;
}

.hbm-popup--top-bar .hbm-popup__box,
.hbm-popup--bottom-bar .hbm-popup__box {
	max-width: none;
	border-radius: 0;
	box-shadow: 0 6px 24px rgba(11, 22, 32, 0.18);
}

.hbm-popup--top-bar .hbm-popup__overlay,
.hbm-popup--bottom-bar .hbm-popup__overlay {
	display: none;
}

.hbm-popup--top-bar .hbm-popup__body,
.hbm-popup--bottom-bar .hbm-popup__body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	max-width: 1160px;
	margin: 0 auto;
	padding: 16px calc(var(--hbm-pad-x) + 26px) 16px var(--hbm-pad-x);
}

.hbm-popup--top-bar .hbm-popup__title,
.hbm-popup--bottom-bar .hbm-popup__title {
	margin: 0;
	padding-right: 0;
	font-size: 1.1em;
}

.hbm-popup--top-bar .hbm-popup__content p:last-child,
.hbm-popup--bottom-bar .hbm-popup__content p:last-child {
	margin-bottom: 0;
}

.hbm-popup--top-bar .hbm-popup__actions,
.hbm-popup--bottom-bar .hbm-popup__actions {
	margin-top: 0;
	margin-left: auto;
}

/* Animaties */
.hbm-popup--anim-slide .hbm-popup__box {
	transform: translateY(24px);
}

.hbm-popup--anim-zoom .hbm-popup__box {
	transform: scale(0.94);
}

.hbm-popup--anim-none .hbm-popup__box,
.hbm-popup--anim-none .hbm-popup__overlay {
	transition: none;
}

/* Onderdelen */
.hbm-popup__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--hbm-radius) var(--hbm-radius) 0 0;
}

.hbm-popup__body {
	padding: var(--hbm-pad-y) var(--hbm-pad-x);
}

.hbm-popup__title {
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: var(--hbm-title-size);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: inherit;
	text-align: inherit;
	text-transform: none;
	text-wrap: pretty;
}

/* Sommige thema's hangen een streepje of icoon aan koppen. */
.hbm-popup__title::before,
.hbm-popup__title::after {
	content: none;
	display: none;
}

.hbm-popup__title a {
	color: inherit;
	text-decoration: none;
}

.hbm-popup__title a:hover,
.hbm-popup__title a:focus {
	color: inherit;
	text-decoration: underline;
}

/* Ruimte vrijhouden voor het kruisje, zonder de linkermarge te veranderen. */
.hbm-popup__box:has(.hbm-popup__close) .hbm-popup__title {
	padding-right: 30px;
}

.hbm-popup__content {
	font-size: 1em;
	line-height: 1.6;
}

.hbm-popup__content p,
.hbm-popup__content ul,
.hbm-popup__content ol,
.hbm-popup__content h3,
.hbm-popup__content h4 {
	margin: 0 0 0.9em;
	padding-left: 0;
	color: inherit;
}

.hbm-popup__content ul,
.hbm-popup__content ol {
	padding-left: 1.3em;
}

.hbm-popup__content li {
	margin: 0 0 0.35em;
}

.hbm-popup__content h3,
.hbm-popup__content h4 {
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.35;
}

.hbm-popup__content > :first-child {
	margin-top: 0;
}

.hbm-popup__content > :last-child {
	margin-bottom: 0;
}

.hbm-popup__content a {
	color: var(--hbm-accent);
	text-decoration: underline;
}

.hbm-popup__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-top: 22px;
}

.hbm-popup__cta {
	display: inline-block;
	padding: 11px 22px;
	border-radius: calc(var(--hbm-radius) / 2 + 2px);
	background: var(--hbm-accent);
	color: var(--hbm-accent-text);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: filter 0.2s ease;
}

.hbm-popup__cta:hover,
.hbm-popup__cta:focus {
	color: var(--hbm-accent-text);
	filter: brightness(0.92);
	text-decoration: none;
}

.hbm-popup__dismiss {
	padding: 10px 4px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	opacity: 0.7;
	cursor: pointer;
	text-decoration: underline;
}

.hbm-popup__dismiss:hover {
	opacity: 1;
}

.hbm-popup__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(15, 25, 35, 0.06);
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.hbm-popup__close:hover,
.hbm-popup__close:focus {
	background: rgba(15, 25, 35, 0.14);
}

.hbm-popup__box .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	white-space: nowrap;
}

@media (max-width: 600px) {
	.hbm-popup {
		--hbm-pad-x: 22px;
		--hbm-pad-y: 24px;
		--hbm-title-size: 1.3em;
	}

	.hbm-popup--bottom-right,
	.hbm-popup--bottom-left {
		justify-content: center;
	}

	.hbm-popup__box {
		max-width: 100%;
	}

	.hbm-popup--top-bar .hbm-popup__actions,
	.hbm-popup--bottom-bar .hbm-popup__actions {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hbm-popup--reduced .hbm-popup__box,
	.hbm-popup--reduced .hbm-popup__overlay {
		transition: none;
		transform: none;
	}
}
