/* STUDIOMV Popup Builder – Frontend */
.smvp[hidden] { display: none !important; }

html.smvp-lock,
html.smvp-lock body { overflow: hidden; }

.smvp {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.smvp__overlay {
	position: absolute;
	inset: 0;
	background: var(--smvp-overlay, rgba(0, 0, 0, .6));
	opacity: 0;
	transition: opacity .22s ease;
}

.smvp__dialog {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--smvp-width, 600px);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--smvp-bg, #fff);
	color: var(--smvp-text, inherit);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	opacity: 0;
	transform: translateY(12px) scale(.98);
	transition: opacity .22s ease, transform .22s ease;
	outline: none;
}

.smvp--open .smvp__overlay { opacity: 1; }
.smvp--open .smvp__dialog { opacity: 1; transform: none; }

.smvp__content {
	padding: 40px 32px 32px;
}
.smvp__content > :first-child { margin-top: 0; }
.smvp__content > :last-child { margin-bottom: 0; }
.smvp__content img { max-width: 100%; height: auto; }

/* Bild ganz oben randlos, wenn es der erste Block ist */
.smvp__content > figure.wp-block-image:first-child.alignfull,
.smvp__content > figure.wp-block-image:first-child.alignwide {
	margin: -40px -32px 24px;
	max-width: none;
}

.smvp__close {
	position: sticky;
	top: 10px;
	float: right;
	margin: 10px 10px -46px 0;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #1d2327;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
	font: 400 26px/36px system-ui, sans-serif;
	text-align: center;
	cursor: pointer;
	transition: transform .15s ease;
}
.smvp__close:hover { transform: scale(1.08); }
.smvp__close:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }

@media (max-width: 600px) {
	.smvp { padding: 12px; }
	.smvp__content { padding: 36px 20px 24px; }
	.smvp__content > figure.wp-block-image:first-child.alignfull,
	.smvp__content > figure.wp-block-image:first-child.alignwide { margin: -36px -20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.smvp__overlay,
	.smvp__dialog { transition: none; }
}
