/*
 * Info-Popups (native <dialog>) – Fenster hinter den Fragezeichen-Symbolen.
 * Farben und Schriften kommen aus der Theme-Maske (--hb-* Variablen, inc/output.php).
 */

.hb-pop {
	--pop-accent: var(--hb-primary, #ff7f2a);
	--pop-navy: var(--hb-secondary, #00184d);
	--pop-text: var(--hb-text, #00184d);
	--pop-soft: var(--hb-bg-light, #f9f6f5);
	--pop-line: rgba(0, 24, 77, 0.1);

	box-sizing: border-box;
	width: min(1040px, calc(100vw - 48px));
	max-width: none;
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--pop-text);
	font-family: var(--hb-font-main, inherit);
	overflow: visible;
}

.hb-pop *,
.hb-pop *::before,
.hb-pop *::after {
	box-sizing: border-box;
}

.hb-pop::backdrop {
	background: rgba(0, 16, 56, 0.66);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

.hb-pop[open] {
	animation: hb-pop-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hb-pop[open]::backdrop {
	animation: hb-pop-fade 0.3s ease;
}

@keyframes hb-pop-in {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes hb-pop-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

html.hb-pop-lock {
	overflow: hidden;
	scrollbar-gutter: stable;
}

/* ---- Karte ----------------------------------------------------------- */

.hb-pop__card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(220px, 36%) 1fr;
	grid-template-rows: minmax(0, 1fr);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	min-height: 360px;
	background: #fff;
	border-radius: 8px;
	border-top: 4px solid var(--pop-accent);
	overflow: hidden;
	box-shadow: 0 34px 90px -24px rgba(0, 16, 56, 0.6), 0 2px 8px rgba(0, 0, 0, 0.18);
}

.hb-pop--noimg {
	width: min(560px, calc(100vw - 48px));
}

.hb-pop--noimg .hb-pop__card {
	grid-template-columns: 1fr;
	min-height: 0;
}

.hb-pop__media {
	position: relative;
	min-height: 260px;
	background: var(--pop-navy);
}

.hb-pop__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hb-pop__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 24, 77, 0) 60%, rgba(0, 24, 77, 0.28));
	pointer-events: none;
}

.hb-pop__main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.hb-pop__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 40px 52px 24px;
	outline: 0;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 24, 77, 0.3) transparent;
}

/* ---- Kopf ------------------------------------------------------------ */

.hb-pop__title {
	margin: 0;
	padding-right: 36px;
	color: var(--pop-navy);
	font-family: var(--hb-font-main, inherit);
	font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-wrap: balance;
}

.hb-pop__rule {
	display: block;
	width: 56px;
	height: 3px;
	margin: 16px 0 24px;
	border-radius: 2px;
	background: var(--pop-accent);
}

/* ---- Inhalt ---------------------------------------------------------- */

.hb-pop__body {
	font-size: 0.92rem;
	line-height: 1.6;
}

.hb-pop__body p {
	margin: 0 0 0.9em;
}

.hb-pop__body a {
	color: var(--hb-link, var(--pop-navy));
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hb-pop__body h3 {
	margin: 0 0 12px;
	color: var(--pop-navy);
	font-family: var(--hb-font-main, inherit);
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.hb-pop__sec + .hb-pop__sec {
	margin-top: 26px;
	padding-top: 24px;
	border-top: 1px solid var(--pop-line);
}

.hb-pop__body ul,
.hb-pop__body ol {
	margin: 0 0 4px;
	padding: 0;
	list-style: none;
}

.hb-pop__body li {
	position: relative;
	margin: 0;
	padding: 3.5px 0 3.5px 30px;
	break-inside: avoid;
	--pop-mark: var(--pop-accent);
}

/* Markierung vor jedem Listenpunkt: getönter Kreis (::before) + Symbol (::after) */
.hb-pop__body li::before,
.hb-pop__body li::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0.4em;
	width: 19px;
	height: 19px;
	border-radius: 50%;
}

.hb-pop__body li::before {
	background: color-mix(in srgb, var(--pop-mark) 15%, #fff);
}

.hb-pop__body li::after {
	background: var(--pop-mark);
	-webkit-mask: var(--pop-glyph) center / 100% 100% no-repeat;
	mask: var(--pop-glyph) center / 100% 100% no-repeat;
	border-radius: 0;
}

/* neutral: kleiner Punkt */
.hb-pop__body {
	--pop-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/svg%3E");
}

/* „Das darf hinein“: Haken */
.hb-pop__sec.is-yes {
	--pop-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.6 10.4l3 3 5.8-6.2' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.hb-pop__sec.is-yes li {
	--pop-mark: var(--hb-open, #008000);
}

/* „Das darf nicht hinein“: Kreuz */
.hb-pop__sec.is-no {
	--pop-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6.8 6.8l6.4 6.4M13.2 6.8l-6.4 6.4' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E");
}

.hb-pop__sec.is-no li {
	--pop-mark: color-mix(in srgb, var(--hb-closed, #ff0000) 78%, #000);
}

/* Öffnungsstatus (Plugin-Shortcode [op-is-open]) als kleine Pille */
.hb-pop .op-is-open-shortcode {
	margin: 0 0 14px;
}

.hb-pop .op-is-open-shortcode span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 13px 4px 11px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.hb-pop .op-is-open-shortcode span::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

.hb-pop .op-is-open-shortcode .op-open {
	color: var(--hb-open, #008000);
	background: color-mix(in srgb, var(--hb-open, #008000) 12%, #fff);
}

.hb-pop .op-is-open-shortcode .op-closed {
	color: color-mix(in srgb, var(--hb-closed, #ff0000) 78%, #000);
	background: color-mix(in srgb, var(--hb-closed, #ff0000) 10%, #fff);
}

/* Eingebettetes Video */
.hb-pop__video {
	position: relative;
	margin: 0 0 1em;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: #0b1534;
}

.hb-pop__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Zwei Spalten nebeneinander (z. B. Weißglas / Buntglas) */
.hb-pop__cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 36px;
}

.hb-pop__cols ul.is-long {
	columns: 1;
}

.hb-pop__body ul.is-long {
	columns: 2;
	column-gap: 36px;
}

.hb-pop__body img {
	max-width: 100%;
	height: auto;
}

/* ---- Fuß: Hinweis + Buttons ------------------------------------------ */

.hb-pop__foot {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
	padding: 20px 52px 22px;
	border-top: 1px solid var(--pop-line);
	background: var(--pop-soft);
	box-shadow: 0 -12px 16px -14px rgba(0, 24, 77, 0.22);
}

.hb-pop__cta {
	margin: 0;
	color: var(--pop-navy);
	font-family: var(--hb-font-script, cursive);
	font-size: 1.4rem;
	line-height: 1.25;
}

.hb-pop__btns {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.hb-pop__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 22px;
	border: 2px solid transparent;
	border-radius: 4px;
	font-family: var(--hb-font-main, inherit);
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-align: center;
	text-decoration: none !important;
	text-transform: uppercase;
	transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.hb-pop__btn svg {
	width: 17px;
	height: 17px;
	flex: 0 0 auto;
}

.hb-pop__body a.hb-pop__btn,
.hb-pop a.hb-pop__btn--primary {
	color: var(--hb-cta-fg, #00184d);
}

.hb-pop__btn--primary {
	background: var(--pop-accent);
	border-color: var(--pop-accent);
	color: var(--hb-cta-fg, #00184d);
}

.hb-pop__btn--primary:hover,
.hb-pop__btn--primary:focus-visible {
	background: color-mix(in srgb, var(--pop-accent) 88%, #000);
	border-color: color-mix(in srgb, var(--pop-accent) 88%, #000);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--pop-accent) 80%, #000);
}

.hb-pop a.hb-pop__btn--ghost {
	background: transparent;
	border-color: var(--pop-navy);
	color: var(--pop-navy);
}

.hb-pop a.hb-pop__btn--ghost:hover,
.hb-pop a.hb-pop__btn--ghost:focus-visible {
	background: var(--pop-navy);
	color: #fff;
	transform: translateY(-1px);
}

/* ---- Schließen-Button ------------------------------------------------ */

.hb-pop__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 5;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pop-navy);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 16px -6px rgba(0, 16, 56, 0.6);
	transition: transform 0.25s, background-color 0.2s;
}

.hb-pop__close svg {
	width: 18px;
	height: 18px;
}

.hb-pop__close:hover {
	background: var(--pop-accent);
	color: var(--hb-cta-fg, #00184d);
	transform: rotate(90deg);
}

.hb-pop__close:focus-visible,
.hb-pop__btn:focus-visible {
	outline: 3px solid var(--pop-accent);
	outline-offset: 2px;
}

/* ---- Mobil: Bottom-Sheet ---------------------------------------------- */

@media (max-width: 820px) {
	.hb-pop,
	.hb-pop--noimg {
		width: 100vw;
		margin: auto 0 0;
	}

	.hb-pop__card {
		display: flex;
		flex-direction: column;
		min-height: 0;
		max-height: 92vh;
		max-height: 92dvh;
		border-radius: 16px 16px 0 0;
	}

	.hb-pop__media {
		flex: 0 0 auto;
		height: 132px;
		min-height: 0;
	}

	.hb-pop__scroll {
		padding: 24px 22px 18px;
	}

	.hb-pop__rule {
		margin: 12px 0 18px;
	}

	.hb-pop__body ul.is-long {
		columns: 1;
	}

	.hb-pop__cols {
		grid-template-columns: 1fr;
	}

	.hb-pop__foot {
		flex-direction: column;
		align-items: stretch;
		padding: 16px 22px calc(18px + env(safe-area-inset-bottom, 0px));
	}

	.hb-pop__cta {
		font-size: 1.15rem;
	}

	.hb-pop__btns {
		flex-direction: column;
	}

	.hb-pop__btn {
		width: 100%;
	}

	.hb-pop__close {
		top: 10px;
		right: 10px;
		width: 38px;
		height: 38px;
	}

	.hb-pop[open] {
		animation-name: hb-pop-sheet;
	}
}

@keyframes hb-pop-sheet {
	from {
		opacity: 0;
		transform: translateY(40px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hb-pop[open],
	.hb-pop[open]::backdrop {
		animation: none;
	}

	.hb-pop__close,
	.hb-pop__btn {
		transition: none;
	}
}
