/* Freistil Popup – Crowdfunding-Overlay */

.freistil-popup {
	--fp-blue:  var(--ast-global-color-0, #2719b7);
	--fp-white: #ffffff;

	/* Das <dialog> selbst ist nur die Bühne: randlos, transparent, ganzflächig.
	   Die blaue Box ist das Kind – nur so trifft ein Klick daneben das <dialog>
	   und kann als "Klick auf den Hintergrund" ausgewertet werden. */
	position: fixed;
	inset: 0;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 20px;
	border: 0;
	background: transparent;
	color: var(--fp-white);
	box-sizing: border-box;
	overflow: hidden;
}

/* display nur im offenen Zustand setzen! Ein unbedingtes display:flex würde
   das UA-Stylesheet (dialog:not([open]) { display: none }) überstimmen und das
   Popup dauerhaft sichtbar machen. */
.freistil-popup[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.freistil-popup::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

/* ── Blaue Box ── */
.freistil-popup__box {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(800px, 100%);
	max-height: 100%;
	background: var(--fp-blue);
	box-sizing: border-box;
}

/* Trägt den Anfangsfokus (tabindex="-1" autofocus). Ein Fokusrahmen wäre hier
   falsch – sichtbarer Indikator ist der Dialog selbst. */
.freistil-popup__box:focus {
	outline: none;
}

.freistil-popup__content {
	padding: 64px 56px;
	/* Falls die Box in sehr flachen Viewports (Querformat) nicht passt, scrollt
	   der Inhalt – der Schließen-Button liegt außerhalb dieses Bereichs und
	   bleibt dadurch immer sichtbar. */
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* ── Überschrift ── */
.freistil-popup__title {
	margin: 0 0 32px;
	padding: 0;
	color: var(--fp-white);
	font-size: clamp(26px, 5.4vw, 52px);
	line-height: 1.12;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	/* Kein Trennen mitten im Wort – "UNTERSTÜTZUNG" darf nicht zerbrechen. */
	hyphens: none;
	overflow-wrap: normal;
	word-break: normal;
}

/* ── Button ── */
.freistil-popup__cta {
	display: inline-block;
	padding: 13px 22px;
	border: 2px solid var(--fp-white);
	background: transparent;
	color: var(--fp-white);
	text-decoration: none;
	font-family: monospace, monospace;
	font-size: clamp(11px, 2.4vw, 13px);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	line-height: 1.3;
	transition: background 0.15s ease, color 0.15s ease;
}

.freistil-popup__cta:hover,
.freistil-popup__cta:focus-visible {
	background: var(--fp-white);
	color: var(--fp-blue);
}

.freistil-popup__cta:focus-visible {
	outline: 3px solid var(--fp-white);
	outline-offset: 3px;
}

/* ── Schließen ──
   Innerhalb der Box, 44x44 Klickfläche. Außerhalb positioniert (wie beim
   Spectra-Popup) landet der Button auf schmalen Schirmen neben dem Viewport
   und ist dann nicht mehr erreichbar. */
.freistil-popup__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--fp-white);
	cursor: pointer;
	line-height: 0;
	transition: opacity 0.15s ease;
}

.freistil-popup__close svg {
	width: 24px;
	height: 24px;
}

.freistil-popup__close:hover {
	opacity: 0.7;
}

.freistil-popup__close:focus-visible {
	outline: 3px solid var(--fp-white);
	outline-offset: -3px;
}

/* ── Einblenden ── */
@keyframes freistil-popup-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

.freistil-popup[open] .freistil-popup__box {
	animation: freistil-popup-in 0.25s ease-out;
}

/* ── Mobil ── */
@media (max-width: 600px) {
	.freistil-popup {
		padding: 12px;
	}

	.freistil-popup__content {
		padding: 56px 24px 32px;
	}

	.freistil-popup__title {
		margin-bottom: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.freistil-popup[open] .freistil-popup__box {
		animation: none;
	}

	.freistil-popup__cta,
	.freistil-popup__close {
		transition: none;
	}
}
