/**
 * Full-screen prototype modal — case study pages.
 * Trigger: .cs-prototype-launch[data-prototype-src]
 */

.studio-prototype-overlay {
	position: fixed;
	inset: 0;
	z-index: 100002;
	display: flex;
	flex-direction: column;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.28s ease,
		visibility 0.28s ease;
}

.studio-prototype-overlay.is-open {
	pointer-events: auto;
	opacity: 1;
	visibility: visible;
}

.studio-prototype-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 10, 0.92);
	border: 0;
	cursor: pointer;
}

.studio-prototype-overlay__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	margin: 0.75rem;
	border: 1px solid rgba(250, 249, 247, 0.12);
	border-radius: 6px;
	overflow: hidden;
	background: #0a0a0a;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
}

.studio-prototype-overlay__chrome {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.65rem 1rem;
	background: #141414;
	border-bottom: 1px solid rgba(250, 249, 247, 0.1);
}

.studio-prototype-overlay__label {
	font-family: var(--wp--preset--font-family--sans, 'Source Sans 3', sans-serif);
	font-size: 0.88rem;
	font-weight: 500;
	color: #faf9f7;
	margin: 0;
}

.studio-prototype-overlay__close {
	flex-shrink: 0;
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid rgba(250, 249, 247, 0.2);
	border-radius: 4px;
	background: transparent;
	color: #faf9f7;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.studio-prototype-overlay__close:hover,
.studio-prototype-overlay__close:focus-visible {
	background: var(--studio-teal, #2c5f6e);
	border-color: rgba(250, 249, 247, 0.35);
	outline: none;
}

.studio-prototype-overlay__viewport {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: #0a0a0a;
}

.studio-prototype-overlay__scaled {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.studio-prototype-overlay__frame {
	flex: 1;
	width: 100%;
	min-height: 0;
	border: 0;
	background: #fff;
}

/* Fit entire prototype canvas in panel — no iframe scroll (see data-prototype-fit) */
.studio-prototype-overlay.is-fit-viewport .studio-prototype-overlay__viewport {
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.studio-prototype-overlay.is-fit-viewport .studio-prototype-overlay__scaled {
	flex: none;
	transform-origin: center center;
}

.studio-prototype-overlay.is-fit-viewport .studio-prototype-overlay__frame {
	flex: none;
}

body.studio-prototype-overlay-open {
	overflow: hidden;
}

.studio-case__body .cs-prototype-launch-wrap {
	margin-top: var(--wp--preset--spacing--40, 1.5rem);
}

.studio-case__body .cs-prototype-launch {
	display: inline-flex;
	align-items: center;
	padding: 0.7rem 1.15rem;
	border: 0;
	border-radius: 4px;
	background: var(--studio-teal, #2c5f6e);
	color: #faf9f7;
	font-family: var(--wp--preset--font-family--sans, 'Source Sans 3', sans-serif);
	font-size: 0.92rem;
	font-weight: 500;
	line-height: 1.3;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.studio-case__body .cs-prototype-launch:hover,
.studio-case__body .cs-prototype-launch:focus-visible {
	background: var(--studio-teal-light, #3d7a8c);
	outline: none;
	transform: translateY(-1px);
}

/* Poster preview — image above button (sits in a column) */
.cs-prototype-launch-wrap.has-poster .cs-prototype-poster {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
	border: 1px solid rgba(26, 26, 26, 0.1);
	box-shadow:
		0 1px 2px rgba(26, 26, 26, 0.06),
		0 8px 32px rgba(44, 95, 110, 0.14);
	margin-bottom: 1rem;
	cursor: pointer;
	transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.studio-prototype-overlay {
		transition: none;
	}

	.studio-case__body .cs-prototype-launch:hover {
		transform: none;
	}
}

@media (max-width: 640px) {
	.studio-prototype-overlay__panel {
		margin: 0;
		border-radius: 0;
	}
}
