.demoTyleContainer {
	position: relative;
}

.demoTyleContainer .tiq-unit {
	width: 100%;
}

/*
 * Server-rendered tyle copy: same box constraints as the live unit so the
 * SSR→live swap causes no layout shift. Must stay visible until the live
 * unit renders (hidden-by-default content is devalued by crawlers).
 */
.tyleContent .tiq-ssr-content {
	width: 100%;
	flex: 0 0 100%;
}

/* CSS fallback: hide the SSR copy the instant the live unit exists (JS also removes it). */
.tyleContent:has(.tiq-unit) .tiq-ssr-content {
	display: none;
}

.homepage-tyle .demoTyleContainer {
	margin-left: -2rem;
}

@media (max-width: 820px) {
	.demoTyleContainer {
		position: relative !important;
        left: 51%;
        margin-left: -50vw !important;
        width: 98vw;
	}
}

.fadeDiv {
	position: relative;
	color: #ffffff;
	padding: 2rem 0;
	display: block !important;
	opacity: 1 !important;
	overflow: visible;
	width: 100%;
}

.tyleContent {
	position: relative;
	z-index: 1;
	padding: 0 2em;
	background: transparent;
	color: #ffffff;
	display: flex;
	align-items: center;
	width: 100%;
	pointer-events: auto;
}

.tyleContent p {
	font-size: var(--wp--preset--font-size--medium);
	padding: 0;
}

.tyleContent p:last-of-type {
	margin: 0;
}

/* ON state */
.fadeDiv.fade-on::before,
.fadeDiv.fade-on .caption,
.fadeDiv.fade-on .caption::before,
.fadeDiv.fade-on .live-badge {
	opacity: 1;
}

/* MID state (optional) */
.fadeDiv.fade-mid::before,
.fadeDiv.fade-mid .caption,
.fadeDiv.fade-mid .caption::before {
	opacity: 0.5;
}

/* Badge stays fully opaque in mid state to preserve solid background */
.fadeDiv.fade-mid .live-badge {
	opacity: 1;
}

/* OFF state (default) */
.fadeDiv.fade-off::before,
.fadeDiv.fade-off .caption,
.fadeDiv.fade-off .caption::before,
.fadeDiv.fade-off .live-badge {
	opacity: 0;
}

/* Mobile */
@media (max-width: 820px) {
	.fadeDiv {
		font-size: 1rem;
		padding: 1rem;
		margin-bottom: 1rem;
	}

	.tyleContent {
		padding: 0.4rem;
		font-size: 1rem;
	}

	.fadeDiv .caption {
		bottom: -30px;
		min-height: 0;
	}

	.fadeDiv .caption::before {
		left: 1%;
		top: 0;
		bottom: auto;
		transform: translateX(-50%) rotate(-35deg);
	}
}

@media (max-width: 480px) {
	.demoTyleContainer {
		padding-bottom: 0;
	}
	.tight-spacing-mobile .tyleContent {
		padding: 0;
	}
}

.fadeDiv.live-tyle-active::before {
	content: '';
	position: absolute;
	inset: 2px;
	border-radius: 16px;
	border: 1px solid rgba(52, 202, 147, 1);
	pointer-events: none;
	z-index: 1;
}

.live-badge {
	position: absolute;
	top: 0;
	left: 24px;
	transform: translateY(-50%);
	background: #131a22;
	border: 1px solid rgba(52, 211, 153, 0.3);
	padding: 3px 12px 3px 9px;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
	z-index: 2;
}

.live-badge span {
	font-size: 10px;
	font-weight: 600;
	color: #34d399;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.live-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #34d399;
	position: relative;
	flex-shrink: 0;
}

.live-dot::after {
	content: '';
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	background: #34d399;
	opacity: 0.4;
	animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
	0%, 100% { opacity: 0.4; transform: scale(1); }
	50% { opacity: 0; transform: scale(2.4); }
}

/* Editor always on */
body.block-editor-page .fadeDiv::before,
.block-editor-block-list__block .fadeDiv::before,
body.block-editor-page .fadeDiv .caption,
.block-editor-block-list__block .fadeDiv .caption,
body.block-editor-page .fadeDiv .caption::before,
.block-editor-block-list__block .fadeDiv .caption::before,
body.block-editor-page .fadeDiv .live-badge,
.block-editor-block-list__block .fadeDiv .live-badge {
	opacity: 1;
}
