/* Pollux Bausatz – Teaser im Beitrag und Dialog mit der Auflösung */

/*
 * Zu den doppelten Klassen in den Selektoren unten: Der Teaser steht im
 * Beitragstext, und Themes formatieren den mit Regeln wie
 * ".entry-content p { margin: 0 0 var(--space-4) }". Eine solche Regel ist
 * spezifischer (eine Klasse plus ein Element) als ".pollux-bausatz__cta"
 * (nur eine Klasse) und überschreibt deshalb die Abstände des Teasers.
 * Der zusätzliche Elternselektor hebt die Spezifität auf zwei Klassen und
 * macht die Abstände unabhängig vom Theme.
 */

.pollux-bausatz {
	--plb-bg: #232838;
	--plb-accent: #ffffff;

	display: grid;
	gap: 1.75rem;
	align-items: center;
	margin: 2.5rem 0;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border-radius: 14px;
	background: var(--plb-bg);
	color: var(--plb-accent);
	box-sizing: border-box;
}

.pollux-bausatz * {
	box-sizing: border-box;
}

.pollux-bausatz .pollux-bausatz__headline {
	margin: 0 0 0.85rem;
	font-size: clamp(1.35rem, 2.6vw, 1.75rem);
	font-weight: 700;
	line-height: 1.25;
	color: var(--plb-accent);
}

.pollux-bausatz .pollux-bausatz__text p {
	margin: 0 0 0.9rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--plb-accent);
	opacity: 0.95;
}

.pollux-bausatz .pollux-bausatz__text p:last-child {
	margin-bottom: 0;
}

.pollux-bausatz .pollux-bausatz__cta {
	margin: 2.1rem 0 0;
}

.pollux-bausatz .pollux-bausatz__button {
	display: inline-block;
	padding: 0.85em 1.9em;
	border: 0;
	border-radius: 999px;
	background: var(--plb-accent);
	color: var(--plb-bg);
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pollux-bausatz .pollux-bausatz__button:hover,
.pollux-bausatz .pollux-bausatz__button:focus {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.pollux-bausatz .pollux-bausatz__button:focus-visible {
	outline: 3px solid var(--plb-accent);
	outline-offset: 3px;
}

.pollux-bausatz .pollux-bausatz__note {
	margin: 0.75rem 0 0;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--plb-accent);
	opacity: 0.75;
}

.pollux-bausatz .pollux-bausatz__media {
	aspect-ratio: 16 / 9;
	width: 100%;
	max-height: 300px;
	margin: 0 auto;
}

.pollux-bausatz .pollux-bausatz__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 10px;
}

@media (min-width: 700px) {
	.pollux-bausatz--img-right,
	.pollux-bausatz--img-left {
		grid-template-columns: 1.4fr 1fr;
	}

	.pollux-bausatz--img-right .pollux-bausatz__media,
	.pollux-bausatz--img-left .pollux-bausatz__media {
		aspect-ratio: 4 / 3;
		max-height: 340px;
	}

	/* Das Bild steht im Markup zuerst – für "rechts" wandert es nach hinten. */
	.pollux-bausatz--img-right .pollux-bausatz__media {
		order: 2;
	}
}

.pollux-bausatz--img-none {
	grid-template-columns: 1fr;
}

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

.pollux-bausatz-dialog {
	width: min(30rem, calc(100vw - 2rem));
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: #ffffff;
	color: #1f2330;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.pollux-bausatz-dialog::backdrop {
	background: rgba(15, 18, 28, 0.6);
}

/* Fallback für Browser ohne <dialog>-Unterstützung. */
.pollux-bausatz-dialog.is-fallback-open {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 99999;
	transform: translate(-50%, -50%);
}

.pollux-bausatz-dialog__inner {
	padding: clamp(1.5rem, 5vw, 2.25rem);
}

.pollux-bausatz-dialog__close-form {
	margin: 0;
	text-align: right;
}

.pollux-bausatz-dialog__close {
	padding: 0.35rem 0.75rem;
	margin: 0.5rem 0.5rem 0 0;
	border: 0;
	background: none;
	color: #646970;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.pollux-bausatz-dialog__close:hover {
	color: #1f2330;
}

.pollux-bausatz-dialog__title {
	margin: 0 0 0.9rem;
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.25;
}

.pollux-bausatz-dialog__text p {
	margin: 0 0 0.9rem;
	font-size: 0.98rem;
	line-height: 1.6;
	color: #3c434a;
}

.pollux-bausatz-dialog__form {
	margin-top: 1.5rem;
}

.pollux-bausatz-dialog__label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.85rem;
	font-weight: 600;
}

.pollux-bausatz-dialog__input {
	width: 100%;
	padding: 0.7em 0.9em;
	border: 1px solid #c3c8d2;
	border-radius: 8px;
	background: #ffffff;
	color: #1f2330;
	font: inherit;
}

.pollux-bausatz-dialog__input:focus {
	border-color: var(--plb-bg, #232838);
	outline: 2px solid rgba(37, 99, 235, 0.25);
	outline-offset: 1px;
}

/* Honeypot: unsichtbar, aber nicht display:none – das durchschauen Bots. */
.pollux-bausatz-dialog__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.pollux-bausatz-dialog__consent {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	margin: 1rem 0 1.25rem;
	font-size: 0.85rem;
	line-height: 1.5;
	color: #3c434a;
}

.pollux-bausatz-dialog__consent input {
	margin-top: 0.2rem;
	flex: 0 0 auto;
}

.pollux-bausatz-dialog__submit {
	width: 100%;
	padding: 0.85em 1.5em;
	border: 0;
	border-radius: 999px;
	background: var(--plb-bg, #232838);
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.pollux-bausatz-dialog__submit:disabled {
	opacity: 0.55;
	cursor: default;
}

.pollux-bausatz-dialog__message {
	margin: 0.9rem 0 0;
	font-size: 0.9rem;
	line-height: 1.5;
	min-height: 1.2em;
}

.pollux-bausatz-dialog__message.is-error {
	color: #b32d2e;
}

.pollux-bausatz-dialog__message.is-success {
	color: #007017;
	font-weight: 600;
}

.pollux-bausatz-dialog__message.is-pending {
	color: #646970;
}

/* Nach erfolgreicher Eintragung bleibt nur die Bestätigung stehen. */
.pollux-bausatz-dialog__form.is-done .pollux-bausatz-dialog__label,
.pollux-bausatz-dialog__form.is-done .pollux-bausatz-dialog__input,
.pollux-bausatz-dialog__form.is-done .pollux-bausatz-dialog__consent,
.pollux-bausatz-dialog__form.is-done .pollux-bausatz-dialog__submit {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.pollux-bausatz__button {
		transition: none;
	}

	.pollux-bausatz__button:hover,
	.pollux-bausatz__button:focus {
		transform: none;
	}
}
