/**
 * Split View (VT).
 *
 * Structural styles only — colours, borders and spacing are Elementor
 * controls. The pane itself is position: sticky (set from the widget's
 * Sticky Top Offset control so the value stays editable).
 */

.vt-split-view {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-height: 200px;
}

.vt-sv-content {
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
	-webkit-overflow-scrolling: touch;
}

/* Empty + loading states */

.vt-sv-empty {
	display: none;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 40px 24px;
	color: #8b93a5;
}

.vt-split-view.is-empty .vt-sv-empty {
	display: flex;
}

.vt-split-view.is-empty .vt-sv-content {
	display: none;
}

.vt-split-view.is-loading .vt-sv-content {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.vt-sv-error {
	padding: 32px 24px;
	text-align: center;
	color: #b32d2e;
}

/* Selected card affordance — deliberately minimal so it composes with any
   card template; sites can restyle via this class. */

.ts-preview.vt-sv-selected {
	/* Defaults only — every property here is overridable from the widget's
	   "Selected Card" style section. */
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Close button — only shown in drawer mode */

.vt-sv-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

/* Drawer mode (below the configured breakpoint) */

.vt-split-view.is-drawer {
	position: fixed !important;
	/* !important: overrides the sticky positioning the widget's style controls
	   write as inline-adjacent CSS; the drawer must win while open. */
	inset: auto 0 0 0;
	top: 8vh;
	z-index: 9999;
	max-height: none !important;
	background: #fff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
	transform: translateY(100%);
	transition: transform 0.25s ease;
}

.vt-split-view.is-drawer.is-open {
	transform: translateY(0);
}

.vt-sv-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, 0.45);
}

body.vt-sv-lock-scroll {
	overflow: hidden;
}

/* Editor placeholder */

.vt-split-view.is-editor-placeholder {
	border: 2px dashed #c3c8d4;
	border-radius: 10px;
	min-height: 260px;
}

.vt-split-view.is-editor-placeholder .vt-sv-empty {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.vt-sv-empty-icon {
	font-size: 34px;
	opacity: 0.6;
}

.vt-sv-hint {
	font-size: 0.9em;
	opacity: 0.75;
}

/* Loading indicators — .is-first-load is set by JS when the pane has no
   previous listing to keep on screen; later loads keep the old content
   dimmed instead (see .is-loading .vt-sv-content above). */

.vt-sv-skeleton,
.vt-sv-spinner {
	display: none;
}

.vt-split-view.vt-sv-loader-skeleton.is-loading.is-first-load .vt-sv-skeleton,
.vt-split-view.vt-sv-loader-skeleton.vt-sv-loader-every.is-loading .vt-sv-skeleton {
	display: block;
	padding: 0 0 24px;
}

/* With the loader on every change, the outgoing listing is hidden rather
   than dimmed so the skeleton isn't drawn on top of it. */

.vt-split-view.vt-sv-loader-skeleton.vt-sv-loader-every.is-loading .vt-sv-content {
	display: none;
}

.vt-sv-skel-media,
.vt-sv-skel-line {
	background: linear-gradient(
		100deg,
		var(--vt-sv-skel-base, #e9edf3) 40%,
		var(--vt-sv-skel-glow, #f7f9fc) 50%,
		var(--vt-sv-skel-base, #e9edf3) 60%
	);
	background-size: 200% 100%;
	animation: vt-sv-shimmer 1.4s linear infinite;
	border-radius: 6px;
}

.vt-sv-skel-media {
	height: 220px;
	border-radius: 0;
}

.vt-sv-skel-body {
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.vt-sv-skel-line {
	height: 14px;
}

.vt-sv-skel-line.is-title {
	height: 26px;
	width: 60%;
	margin-bottom: 4px;
}

.vt-sv-skel-line.is-meta {
	width: 38%;
	margin-bottom: 10px;
}

.vt-sv-skel-line.is-short {
	width: 72%;
}

@keyframes vt-sv-shimmer {
	from { background-position: 100% 0; }
	to   { background-position: -100% 0; }
}

.vt-split-view.vt-sv-loader-spinner.is-loading .vt-sv-spinner {
	display: block;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border: 3px solid var(--vt-sv-spinner, #1d307c);
	border-top-color: transparent;
	border-radius: 50%;
	animation: vt-sv-spin 0.7s linear infinite;
	z-index: 2;
}

@keyframes vt-sv-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.vt-sv-skel-media,
	.vt-sv-skel-line {
		animation: none;
	}
	.vt-split-view.vt-sv-loader-spinner.is-loading .vt-sv-spinner {
		animation-duration: 1.6s;
	}
}
