.cst-ticker {
	--cst-bg: transparent;
	--cst-color: inherit;
	--cst-hl: #ff2e8b;
	--cst-icon: #ff2e8b;
	--cst-radius: 0px;
	--cst-pad: 10px;
	--cst-fs: 14px;
	--cst-fs-m: 12px;
	--cst-ls: 0.5px;
	--cst-weight: 700;
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	background: var(--cst-bg);
	color: var(--cst-color);
	--cst-fit: 1;
	border-radius: var(--cst-radius);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

.cst-ticker.cst-full {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0;
}

.cst-viewport {
	position: relative;
	display: block;
	width: 100%;
	box-sizing: border-box;
	transition: height 0.35s ease;
}

.cst-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	padding: var(--cst-pad) clamp(10px, 2vw, 20px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* first slide occupies the flow, others are stacked absolutely */
.cst-slide:not(:first-child) {
	position: absolute;
	inset: 0;
}

.cst-slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.cst-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	color: inherit;
	text-decoration: none;
	font-size: calc(var(--cst-fs) * var(--cst-fit));
	font-weight: var(--cst-weight);
	letter-spacing: var(--cst-ls);
	line-height: 1.35;
	text-align: center;
}

a.cst-inner:hover {
	text-decoration: none;
	opacity: 0.9;
}

.cst-icon {
	flex: 0 0 auto;
	color: var(--cst-icon);
	font-size: 1.15em;
	line-height: 1;
}

.cst-text {
	min-width: 0;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
	hyphens: auto;
}

/* Desktop / laptop: una sola riga che sfrutta il 100% del container */
@media (min-width: 783px) {
	.cst-slide {
		padding-left: 0;
		padding-right: 0;
	}

	.cst-inner {
		flex-wrap: nowrap;
	}

	.cst-text {
		white-space: nowrap;
	}

	.cst-ticker.cst-wrap .cst-text {
		white-space: normal;
	}
}

.cst-ticker.cst-upper .cst-inner {
	text-transform: uppercase;
}

.cst-hl {
	color: var(--cst-hl);
}

/* --- effects --- */
.cst-fx-fade .cst-slide {
	transition: opacity 0.45s ease, visibility 0.45s ease;
}

.cst-fx-slide .cst-slide {
	transform: translateY(100%);
	transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s ease;
}

.cst-fx-slide .cst-slide.is-active {
	transform: translateY(0);
}

.cst-fx-slide .cst-slide.is-leaving {
	opacity: 0;
	visibility: visible;
	transform: translateY(-100%);
}

/* --- dots --- */
.cst-dots {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	gap: 6px;
}

.cst-dot {
	width: 6px;
	height: 6px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.35;
	cursor: pointer;
}

.cst-dot.is-active {
	opacity: 1;
	background: var(--cst-hl);
}

/* Mobile: il testo si riduce e va a capo, mai fuori schermo */
@media (max-width: 782px) {
	.cst-inner {
		font-size: calc(var(--cst-fs-m) * var(--cst-fit));
		letter-spacing: 0;
		flex-wrap: nowrap;
		align-items: center;
		text-align: center;
	}

	.cst-text {
		white-space: normal;
		text-wrap: balance;
	}

	.cst-slide {
		padding: calc(var(--cst-pad) * 0.9) 10px;
	}

	.cst-dots {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cst-slide,
	.cst-viewport {
		transition: none !important;
	}
}
