/*
 * Marketing media lightbox + ONE expand affordance for images AND videos.
 *
 * Zoom trigger: any element with
 *   [data-lightbox-src] | [data-lightbox-video] | [data-lightbox-video-from]
 * Expand chrome: .pc-media-expand (bottom-right on the media stage)
 * Modal: #pc-lightbox-modal via lightbox.js
 *
 * Visual contract (restored toward pre-compliance polish):
 *   - Compact pill (not a large billboard)
 *   - Screenshots / charts: reveal on hover·focus (live look)
 *   - Videos: always-on so demos are clearly expandable
 *   - Never upscale past natural media size in the modal
 */

/* ── Modal ─────────────────────────────────────────────────────────────────── */

.pc-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(2, 6, 15, 0.92);
	z-index: var(--nllm-z-modal, 10000);
	display: grid;
	place-items: center;
	padding: 4vmin;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.pc-lightbox.is-open {
	opacity: 1;
}

.pc-lightbox[hidden] {
	display: none;
}

/* Size to media — JS also clamps to natural pixels (no soft upscale). */
.pc-lightbox__figure {
	max-width: min(1600px, 96vw);
	max-height: 92vh;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	width: max-content;
}

.pc-lightbox__img,
.pc-lightbox__video {
	width: auto;
	height: auto;
	max-width: min(1600px, 96vw);
	max-height: min(86vh, 100%);
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
	background: #070b16;
}

.pc-lightbox__caption {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.875rem;
	text-align: center;
	font-weight: 500;
}

.pc-lightbox__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	font-size: 1.85rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.pc-lightbox__close:hover,
.pc-lightbox__close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: 2px solid rgba(255, 255, 255, 0.45);
	outline-offset: 2px;
}

/* ── SSoT expand pill ───────────────────────────────────────────────────────
 * Compact pill (pre-compliance proportions). Canonical class is
 * pc-media-expand; registered legacy expand-hint aliases share styles. */

.pc-media-expand,
.pc-env-deck__expand-hint,
.pc-hero__expand-hint,
.pc-feature-tile__expand-hint,
.pc-proof-chart__expand-hint,
.pc-cost-of-manual__expand-hint {
	position: absolute;
	right: 0.65rem;
	bottom: 0.65rem;
	z-index: 8;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: 2.25rem;
	padding: 0.35rem 0.75rem;
	border: 1px solid rgba(124, 92, 255, 0.45);
	border-radius: 999px;
	background: rgba(7, 11, 22, 0.88);
	color: #eaf0fb;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.02em;
	line-height: 1;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(6px);
	pointer-events: none;
	transition:
		opacity 0.15s ease,
		transform 0.15s ease,
		background 0.15s ease,
		border-color 0.15s ease;
}

/* Interactive when the pill itself is the control (video stages). */
button.pc-media-expand {
	appearance: none;
	cursor: zoom-in;
	pointer-events: auto;
	margin: 0;
	opacity: 1;
	transform: none;
}

button.pc-media-expand:hover,
button.pc-media-expand:focus-visible {
	background: rgba(124, 92, 255, 0.35);
	border-color: rgba(167, 139, 250, 0.9);
	transform: translateY(-1px);
	outline: 2px solid rgba(56, 189, 248, 0.7);
	outline-offset: 2px;
}

.pc-media-expand__icon {
	font-size: 0.95rem;
	line-height: 1;
	flex: 0 0 auto;
}

.pc-media-expand__text,
.pc-media-expand__label {
	font-size: 0.68rem;
	font-weight: 650;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Hosts must contain the absolute pill.
 * Captioned figures (.pcv-section-video / install / aux) use an INNER
 * .pc-media-stage around video+expand only — do NOT position the outer
 * <figure> (figcaption would pull bottom: off the media). */
.pc-env-deck__trigger,
.pc-media-stage,
.pcsa__screen,
.pcvs__screen,
.pcv-spotlight__stage,
.pcv-feature-video,
.pcv-feature-video__frame,
.pc-hero__proof-link,
.pc-hero__proof,
.pc-feature-tile__screenshot-link,
.pc-proof-chart__svg-link,
.pc-proof-chart__svg-wrap,
.pc-cost-of-manual__screenshot-link,
.pc-cost-of-manual__media {
	position: relative;
}

/* Captioned video figures: stage is the only positioning host */
.pcv-section-video > .pc-media-stage,
.pcv-install-video > .pc-media-stage,
.pcv-aux-video > .pc-media-stage {
	position: relative;
	display: block;
	width: 100%;
}

/* Lazy-video shell: always show a surface (poster or dark plate), soft pulse while MP4 loads */
video[data-pcv-lazy] {
	background: #070b16;
	/* Avoid layout jump before poster intrinsic size settles */
	vertical-align: middle;
}

video[data-pcv-lazy].is-pcv-loading {
	animation: pcv-media-loading 1.1s ease-in-out infinite;
}

@keyframes pcv-media-loading {
	0%,
	100% {
		filter: brightness(1);
	}
	50% {
		filter: brightness(1.08);
	}
}

@media (prefers-reduced-motion: reduce) {
	video[data-pcv-lazy].is-pcv-loading {
		animation: none;
	}
}

/* ── Reveal rules ───────────────────────────────────────────────────────────
 * Screenshots / charts: hover·focus (matches live pre-compliance polish).
 * Video surfaces: always visible. */

.pc-hero__proof-link .pc-media-expand,
.pc-hero__proof-link .pc-hero__expand-hint,
.pc-proof-chart__svg-link .pc-media-expand,
.pc-proof-chart__svg-link .pc-proof-chart__expand-hint,
.pc-cost-of-manual__screenshot-link .pc-media-expand,
.pc-cost-of-manual__screenshot-link .pc-cost-of-manual__expand-hint,
.pc-feature-tile__screenshot-link .pc-media-expand,
.pc-env-deck__trigger[data-lightbox-src] .pc-media-expand,
.pc-env-deck__trigger[data-lightbox-src] .pc-env-deck__expand-hint {
	opacity: 0;
	transform: translateY(0.2rem);
}

.pc-hero__proof-link:hover .pc-media-expand,
.pc-hero__proof-link:focus-visible .pc-media-expand,
.pc-hero__proof-link:hover .pc-hero__expand-hint,
.pc-hero__proof-link:focus-visible .pc-hero__expand-hint,
.pc-proof-chart__svg-link:hover .pc-media-expand,
.pc-proof-chart__svg-link:focus-visible .pc-media-expand,
.pc-proof-chart__svg-link:hover .pc-proof-chart__expand-hint,
.pc-proof-chart__svg-link:focus-visible .pc-proof-chart__expand-hint,
.pc-cost-of-manual__screenshot-link:hover .pc-media-expand,
.pc-cost-of-manual__screenshot-link:focus-visible .pc-media-expand,
.pc-cost-of-manual__screenshot-link:hover .pc-cost-of-manual__expand-hint,
.pc-cost-of-manual__screenshot-link:focus-visible .pc-cost-of-manual__expand-hint,
.pc-feature-tile__screenshot-link:hover .pc-media-expand,
.pc-feature-tile__screenshot-link:focus-visible .pc-media-expand,
.pc-env-deck__card.is-active .pc-env-deck__trigger[data-lightbox-src]:hover .pc-media-expand,
.pc-env-deck__card.is-active .pc-env-deck__trigger[data-lightbox-src]:focus-visible .pc-media-expand,
.pc-env-deck__card.is-active .pc-env-deck__trigger[data-lightbox-src]:hover .pc-env-deck__expand-hint,
.pc-env-deck__card.is-active .pc-env-deck__trigger[data-lightbox-src]:focus-visible .pc-env-deck__expand-hint {
	opacity: 1;
	transform: none;
}

/* Video expand always on */
.pc-env-deck__trigger[data-lightbox-video] .pc-media-expand,
.pcsa__screen .pc-media-expand,
.pcvs__screen .pc-media-expand,
.pcv-spotlight__stage .pc-media-expand,
.pcv-section-video .pc-media-expand,
.pcv-aux-video .pc-media-expand,
.pcv-install-video .pc-media-expand,
.pcv-feature-video .pc-media-expand,
button.pc-media-expand {
	opacity: 1;
	transform: none;
}

/* Zoom cursor */
[data-lightbox-src],
[data-lightbox-video],
[data-lightbox-video-from],
.pc-feature-tile__screenshot-link {
	cursor: zoom-in;
}

.pc-feature-tile__screenshot-link {
	display: block;
	width: 100%;
	background: transparent;
	border: 0;
	padding: 0;
}

.pc-feature-tile__screenshot-link:focus-visible {
	outline: 2px solid var(--nllm-violet, #8b5cf6);
	outline-offset: 4px;
	border-radius: 8px;
}

@media (max-width: 600px) {
	.pc-lightbox {
		padding: 2vmin;
	}

	.pc-lightbox__close {
		top: 0.5rem;
		right: 0.5rem;
		width: 44px;
		height: 44px;
	}

	.pc-media-expand,
	.pc-env-deck__expand-hint,
	.pc-hero__expand-hint,
	.pc-feature-tile__expand-hint,
	.pc-proof-chart__expand-hint,
	.pc-cost-of-manual__expand-hint {
		min-height: 2.25rem;
		padding: 0.35rem 0.7rem;
		right: 0.5rem;
		bottom: 0.5rem;
	}

	/* Touch: keep image expand discoverable without hover */
	.pc-hero__proof-link .pc-media-expand,
	.pc-proof-chart__svg-link .pc-media-expand,
	.pc-cost-of-manual__screenshot-link .pc-media-expand,
	.pc-env-deck__trigger[data-lightbox-src] .pc-media-expand {
		opacity: 1;
		transform: none;
	}
}
