/**
 * Pastor Video Creator — final cascade layer (inlined in wp_footer via pastor-video-creator.php).
 * Loads after body-injected stylesheets (e.g. Stripe upe-blocks) so rules actually win the cascade.
 */

/* Final cascade pass stays unlayered (see wizard-theme-isolation.css comment). */

/* Modal covers viewport; negate theme transforms/margins that break position:fixed */
html body.wizard-modal-open .wizard-modal-overlay.active,
html body.pvc-wizard-present .wizard-modal-overlay.active,
html body .wizard-modal-overlay.active {
	position: fixed !important;
	inset: 0 !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	transform: none !important;
	z-index: 2147483647 !important;
	box-sizing: border-box !important;
	pointer-events: auto !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

/* Mobile: optional bottom-sheet alignment (desktop/tablet stay centered above) */
@media (max-width: 575.98px) {
	html body.wizard-modal-open .wizard-modal-overlay.active,
	html body.pvc-wizard-present .wizard-modal-overlay.active,
	html body .wizard-modal-overlay.active {
		align-items: flex-end !important;
	}
}

html body .wizard-modal-overlay.active > .wizard-modal-container {
	width: 100% !important;
	max-width: none !important;
	flex: 0 0 auto !important;
	/* Reinforce flex scroll chain when overlay is centered (base rules in wizard.css) */
	max-height: 100vh !important;
	min-height: 0 !important;
	overflow-x: hidden !important;
	overflow-y: hidden !important;
}

/* Step 1 — beat theme flex/column rules that collapse the grid to one column visually */
html body .wizard-modal-overlay .wizard-new-step[data-step="1"] .wizard-new-option-grid {
	display: grid !important;
	grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
	gap: 20px !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	align-items: start !important;
	justify-items: stretch !important;
}

@media (min-width: 576px) {
	html body .wizard-modal-overlay .wizard-new-step[data-step="1"] .wizard-new-option-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (min-width: 992px) {
	html body .wizard-modal-overlay .wizard-new-step[data-step="1"] .wizard-new-option-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}
}

html body .wizard-modal-overlay .wizard-new-carousel-track {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
}

html body .wizard-modal-overlay .wizard-new-step {
	flex-shrink: 0 !important;
	min-width: 100% !important;
	width: 100% !important;
}

/* Dashboard row */
html body .wizard-modal-overlay .wizard-modal-content {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	/* flex-basis 0% keeps the row/column height-bounded so .dashboard-content can scroll */
	flex: 1 1 0% !important;
	overflow: hidden !important;
}

html body .wizard-modal-overlay .dashboard-content {
	flex: 1 1 0% !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	overflow-x: clip !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* Sidebar chrome: only nav scrolls */
html body .wizard-modal-overlay .dashboard-sidebar {
	overflow-x: hidden !important;
	overflow-y: hidden !important;
	min-height: 0 !important;
	display: flex !important;
	flex-direction: column !important;
}

html body .wizard-modal-overlay .dashboard-sidebar .sidebar-nav {
	flex: 1 1 auto !important;
	min-height: 0 !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
}

/* Shortcode host — block wrapper reduces stray <p> splits in some theme/widget pipelines */
.pvc-wizard-shortcode-root {
	display: block;
	max-width: 100%;
	box-sizing: border-box;
}

/*
 * wizard-new.css uses .wizard-modal-content:not(.fade-in){opacity:0!important} which wins over weaker
 * inline enqueue rules. When the overlay is open, the panel must never stay invisible.
 */
html body .wizard-modal-overlay.active .wizard-modal-content {
	opacity: 1 !important;
	visibility: visible !important;
}

/*
 * Fallback only: PHP sanitizer strips autop <p> under .wizard-modal-container.
 * Do not use `contain` here — it skews flex/gap/margin behavior inside the modal.
 * Do not hide `.wizard-modal-content > p` — some layouts / filters can place real copy there;
 * hiding it zeroes spacing and text.
 */
html body .wizard-modal-overlay .wizard-modal-container > p:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Dark: thicker main pane scrollbar — WebKit width only; thumb/track unchanged (native gray) */
html body .wizard-modal-overlay[data-theme="dark"] .dashboard-content {
	scrollbar-width: auto !important;
}

html body .wizard-modal-overlay[data-theme="dark"] .dashboard-content::-webkit-scrollbar {
	width: 22px !important;
}

