/* Hinweis-Popups – Frontend
   Alle Farben sind über CSS-Variablen im :root des Themes überschreibbar. */

:root {
	--hpu-surface: #ffffff;
	--hpu-text: #1c2024;
	--hpu-muted: #5b6570;
	--hpu-line: rgba(20, 26, 32, 0.12);
	--hpu-accent: #1c2024;
	--hpu-accent-text: #ffffff;
	--hpu-backdrop: rgba(16, 20, 26, 0.55);
	--hpu-radius: 14px;
	--hpu-shadow: 0 24px 60px -12px rgba(12, 16, 22, 0.32), 0 2px 6px rgba(12, 16, 22, 0.08);
	--hpu-z: 100000;
}

.hpu-root {
	position: fixed;
	inset: 0;
	z-index: var(--hpu-z);
	display: flex;
	pointer-events: none;
	font-size: 16px;
	line-height: 1.6;
	color: var(--hpu-text);
}

.hpu-root[hidden] {
	display: none;
}

.hpu-backdrop {
	position: absolute;
	inset: 0;
	background: var(--hpu-backdrop);
	pointer-events: auto;
	opacity: 0;
	transition: opacity 0.28s ease;
}

.hpu-root.is-open .hpu-backdrop {
	opacity: 1;
}

/* --- Dialog ------------------------------------------------------------ */

.hpu-dialog {
	position: relative;
	pointer-events: auto;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--hpu-width, 560px);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--hpu-surface);
	color: var(--hpu-text);
	border-radius: var(--hpu-radius);
	box-shadow: var(--hpu-shadow);
	padding: 30px 32px 26px;
	opacity: 0;
	transform: translateY(10px) scale(0.985);
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.hpu-root.is-open .hpu-dialog {
	opacity: 1;
	transform: none;
}

.hpu-dialog:focus {
	outline: none;
}

/* Der Kasten bleibt weiß, auch wenn das Theme dunkel ist. */
.hpu-dialog,
.hpu-dialog * {
	background-image: none;
	text-shadow: none;
	box-sizing: border-box;
}

.hpu-dialog {
	background-color: var(--hpu-surface, #ffffff);
}

/* Nur Titel und Text – Theme-Elemente, die sich sonst einschleichen,
   werden hier ausgeblendet. */
.hpu-content .sharedaddy,
.hpu-content .yarpp-related,
.hpu-content .related-posts,
.hpu-content .post-navigation,
.hpu-content .comments-area,
.hpu-content .wp-block-post-content,
.hpu-content .entry-footer,
.hpu-content script,
.hpu-content style,
.hpu-content noscript {
	display: none !important;
}

/* --- Positionen -------------------------------------------------------- */

.hpu-pos-center {
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hpu-pos-bottom-right,
.hpu-pos-bottom-left {
	align-items: flex-end;
	padding: 20px;
}

.hpu-pos-bottom-right {
	justify-content: flex-end;
}

.hpu-pos-bottom-left {
	justify-content: flex-start;
}

.hpu-pos-bottom-right .hpu-dialog,
.hpu-pos-bottom-left .hpu-dialog {
	max-width: min(var(--hpu-width, 560px), 400px);
	padding: 24px 26px 22px;
	transform: translateY(16px);
}

.hpu-pos-top {
	align-items: flex-start;
	justify-content: center;
	padding: 0;
}

.hpu-pos-top .hpu-dialog {
	max-width: 100%;
	border-radius: 0;
	padding: 18px clamp(20px, 5vw, 64px);
	box-shadow: 0 8px 24px -8px rgba(12, 16, 22, 0.25);
	border-bottom: 1px solid var(--hpu-line);
	transform: translateY(-100%);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
}

.hpu-pos-top .hpu-body {
	flex: 1 1 320px;
}

.hpu-pos-top .hpu-title {
	font-size: 1.05rem;
	margin-bottom: 2px;
}

.hpu-pos-top .hpu-actions {
	margin-top: 0;
	padding-right: 34px;
}

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

.hpu-title {
	margin: 0 0 10px;
	padding: 0 34px 0 0;
	font-size: 1.3rem;
	font-weight: 650;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: inherit;
}

.hpu-content {
	color: var(--hpu-muted);
}

.hpu-content > *:first-child {
	margin-top: 0;
}

.hpu-content > *:last-child {
	margin-bottom: 0;
}

.hpu-content p {
	margin: 0 0 0.85em;
}

.hpu-content a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hpu-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.hpu-content ul,
.hpu-content ol {
	margin: 0 0 0.85em;
	padding-left: 1.25em;
}

/* --- Buttons ----------------------------------------------------------- */

.hpu-actions {
	margin-top: 22px;
	display: flex;
	justify-content: flex-end;
}

.hpu-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1;
	padding: 12px 22px;
	border-radius: 8px;
	background: var(--hpu-accent);
	color: var(--hpu-accent-text);
	transition: transform 0.15s ease, filter 0.15s ease;
}

.hpu-btn:hover {
	filter: brightness(1.15);
}

.hpu-btn:active {
	transform: translateY(1px);
}

.hpu-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--hpu-muted);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hpu-close:hover {
	background: var(--hpu-line);
	color: var(--hpu-text);
}

.hpu-close svg {
	width: 15px;
	height: 15px;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	fill: none;
}

.hpu-btn:focus-visible,
.hpu-close:focus-visible,
.hpu-content a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* --- Scroll-Sperre bei modalem Popup ----------------------------------- */

html.hpu-locked,
html.hpu-locked body {
	overflow: hidden;
}

/* --- Mobil ------------------------------------------------------------- */

@media (max-width: 600px) {
	.hpu-pos-center,
	.hpu-pos-bottom-right,
	.hpu-pos-bottom-left {
		padding: 14px;
		align-items: flex-end;
	}

	.hpu-dialog {
		padding: 26px 22px 22px;
		max-height: calc(100vh - 28px);
	}

	.hpu-pos-bottom-right .hpu-dialog,
	.hpu-pos-bottom-left .hpu-dialog {
		max-width: 100%;
	}

	.hpu-actions .hpu-btn {
		width: 100%;
		padding: 14px 22px;
	}
}

/* --- Reduzierte Bewegung ----------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.hpu-backdrop,
	.hpu-dialog {
		transition: opacity 0.01ms linear;
		transform: none !important;
	}
}
