/* Trigger liegt über dem Theme-Icon (Download-Kachel, Themenbereich) */
.ypd-loop-field--topic_area.ypd-loop-field--previewable {
	position: relative;
}

.ypd-preview-trigger {
	position: absolute;
	top: 0;
	right: 0;
	width: 22px;
	height: 22px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	z-index: 3;
	opacity: 0;
}

@media (max-width: 781px) {
	.ypd-preview-trigger {
		width: 16px;
		height: 16px;
	}
}

.ypd-preview-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(45, 69, 148, 0.45);
	box-sizing: border-box;
}

.ypd-preview-dialog {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: min(960px, 96vw);
	max-height: 92vh;
	background: #ede0d3;
	border-radius: var(--border-radius, 8px);
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.ypd-preview-dialog__header {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	flex-shrink: 0;
	padding: 0.35rem 0.5rem;
	background: rgba(255, 255, 255, 0.35);
}

.ypd-preview-dialog__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 1.75rem;
	line-height: 1;
	color: #2d4594;
	cursor: pointer;
	border-radius: 4px;
}

.ypd-preview-dialog__close:hover,
.ypd-preview-dialog__close:focus-visible {
	background: rgba(45, 69, 148, 0.12);
	outline: none;
}

.ypd-preview-dialog__body {
	flex: 1 1 auto;
	min-height: 200px;
	max-height: calc(92vh - 3rem);
	overflow: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1rem 1rem;
	box-sizing: border-box;
}

.ypd-preview-frame {
	width: 100%;
	height: min(80vh, 720px);
	border: 0;
	background: #fff;
}

.ypd-preview-dialog__body img {
	max-width: 100%;
	max-height: min(75vh, 680px);
	width: auto;
	height: auto;
	object-fit: contain;
}

.ypd-preview-dialog__body video {
	max-width: 100%;
	max-height: min(75vh, 680px);
}

.ypd-preview-fallback {
	margin: 1rem;
	font-size: 1rem;
}

.ypd-preview-fallback a {
	color: #2d4594;
}

body.ypd-preview-open {
	overflow: hidden;
}
