/* PopUps – Frontend Styles */

.popup-logo-trigger img {
	transition: opacity 0.2s ease;
}
.popup-logo-trigger:hover img {
	opacity: 0.85;
}
.popup-logo-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Overlay (Abdunklung kommt als Inline-Stil je PopUp) */
.popup-logo-overlay {
	display: none;
	position: fixed;
	inset: 0;
	/* Max possible z-index + !important — kein Divi-Stylesheet kann dies überschreiben */
	z-index: 2147483647 !important;
	background: rgba(0, 0, 0, 0.72);
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.25s ease;
}
.popup-logo-overlay.is-fading-in,
.popup-logo-overlay.is-closing {
	display: flex;
}
.popup-logo-overlay.is-open {
	display: flex;
	opacity: 1;
}
.popup-logo-overlay:focus {
	outline: none;
}

/* Box (Breite, Ecken und Farben kommen als Inline-Stil je PopUp) */
.popup-logo-box {
	position: relative;
	width: 100%;
	max-width: min(90vw, 720px);
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
	transform: scale(0.92);
	transition: transform 0.25s ease;
	box-sizing: border-box;
}
/* Reines Bild-PopUp: Box schmiegt sich ans Bild wie in 1.0.x */
.popup-logo-box:not(.ppl-mit-text) {
	width: auto;
}
.popup-logo-overlay.is-open .popup-logo-box {
	transform: scale(1);
}
.popup-logo-scroll {
	max-height: 90vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* Bild */
.popup-logo-img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 85vh;
	object-fit: contain;
	margin: 0;
}
/* Mit Text darunter: Bild begrenzen, aber nie beschneiden – schmale
   Hochformate bekommen links und rechts die Farbe des Textbereichs. */
.ppl-mit-text .popup-logo-img {
	max-height: 60vh;
	object-fit: contain;
	background: var(--ppl-hg, #fff);
}
.popup-logo-img-link {
	display: block;
	line-height: 0;
	cursor: pointer;
}
.popup-logo-img-link .popup-logo-img {
	transition: opacity 0.2s ease;
}
.popup-logo-img-link:hover .popup-logo-img {
	opacity: 0.88;
}

/* Textbereich */
.popup-logo-inhalt {
	background: var(--ppl-hg, #fff);
	color: var(--ppl-text, #222);
	padding: 24px 28px 28px;
	text-align: center;
	line-height: 1.55;
}
.ppl-ohne-bild .popup-logo-inhalt {
	padding-top: 44px; /* Platz für das X */
}
.popup-logo-overlay .popup-logo-titel {
	color: inherit;
	font-size: 1.6em;
	line-height: 1.25;
	margin: 0 0 0.5em;
	padding: 0;
}
.popup-logo-text {
	color: inherit;
}
.popup-logo-text p {
	margin: 0 0 0.8em;
	padding: 0;
}
.popup-logo-text p:last-child {
	margin-bottom: 0;
}
.popup-logo-text a {
	color: inherit;
	text-decoration: underline;
}
.popup-logo-overlay .popup-logo-button {
	display: inline-block;
	margin-top: 18px;
	padding: 12px 26px;
	border-radius: 999px;
	background: var(--ppl-btn, #222);
	color: var(--ppl-btn-text, #fff);
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: filter 0.2s ease, transform 0.2s ease;
}
.popup-logo-overlay .popup-logo-button:hover,
.popup-logo-overlay .popup-logo-button:focus-visible {
	filter: brightness(1.12);
	transform: translateY(-1px);
	color: var(--ppl-btn-text, #fff);
}

/* Schließen-Button */
.popup-logo-close {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 10;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 34px;
	height: 34px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
	padding: 0;
}
.popup-logo-close:hover,
.popup-logo-close:focus-visible {
	background: rgba(0, 0, 0, 0.8);
}

/* Ablaufbalken (Dauer kommt als --ppl-dauer je PopUp) */
.popup-logo-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: rgba(255, 255, 255, 0.2);
	z-index: 10;
}
.ppl-mit-text .popup-logo-progress {
	background: rgba(0, 0, 0, 0.08);
}
.popup-logo-progress-bar {
	height: 100%;
	width: 100%;
	background: rgba(255, 255, 255, 0.75);
	transform-origin: left center;
	transform: scaleX(1);
}
.ppl-mit-text .popup-logo-progress-bar {
	background: var(--ppl-btn, #222);
}
.popup-logo-progress-bar.is-running {
	animation: plProgressDrain var(--ppl-dauer, 5s) linear forwards;
}
.popup-logo-progress-bar.is-paused {
	animation-play-state: paused;
}

@keyframes plProgressDrain {
	from { transform: scaleX(1); }
	to   { transform: scaleX(0); }
}

/* Responsive */
@media (max-width: 600px) {
	.popup-logo-box {
		max-width: 96vw !important;
		max-height: 86vh;
	}
	.popup-logo-scroll {
		max-height: 86vh;
	}
	.popup-logo-inhalt {
		padding: 20px 18px 22px;
	}
	.popup-logo-close {
		width: 30px;
		height: 30px;
		font-size: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.popup-logo-overlay,
	.popup-logo-box {
		transition: none;
	}
}
