/* VAB Minimal Popup – minimal, accessible, CSP-friendly (no inline styles/handlers) */

#vab-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(0, 0, 0, 0.5);
}

/*
 * Wichtig: Das HTML-Attribut [hidden] hat nur UA-Styles mit niedriger
 * Spezifität. display:flex oberhalb wuerde es ueberschreiben, deshalb
 * hier eine explizite Regel mit hoeherer Spezifitaet (ID + Attribut).
 */
#vab-popup-overlay[hidden] {
	display: none;
}

html.vab-popup-open {
	overflow: hidden;
}

#vab-popup {
	position: relative;
	width: 100%;
	max-width: 32rem;
	max-height: calc(100vh - 3rem);
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border-radius: 12px;
	padding: 2.25rem;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/*
 * Der Container selbst wird beim Start fokussiert (statt des Close-Buttons),
 * damit beim Erscheinen kein sichtbarer Fokus-Ring angezeigt wird.
 */
#vab-popup:focus {
	outline: none;
}

/*
 * Inhalt startet unterhalb der Button-Zone (Button endet bei 2.75rem
 * von oben), damit Text nicht vom Close-Button ueberlagert wird.
 */
.vab-popup-body {
	padding-top: 1rem;
}

.vab-popup-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #ececec;
	color: #333;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s ease, color 0.15s ease;
}

/* Fallback, falls ein Theme Buttons generisch mit Rahmen/Schatten versieht. */
button.vab-popup-close,
#vab-popup .vab-popup-close {
	border: 0;
	box-shadow: none;
}

.vab-popup-close:hover {
	background: #dedede;
	color: #000;
}

/*
 * Kein Standard-Fokus-Ring beim programmatischen Fokus (Oeffnen/Reset),
 * aber sichtbarer eigener Ring fuer echte Tastatur-Navigation.
 */
.vab-popup-close:focus {
	outline: none;
}

.vab-popup-close:focus-visible {
	outline: 2px solid #999;
	outline-offset: 2px;
	background: #dedede;
	color: #000;
}

.vab-popup-body :first-child {
	margin-top: 0;
}

.vab-popup-body :last-child {
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	#vab-popup,
	.vab-popup-close {
		transition: none;
	}
}
