/* ==========================================================================
   Cintas de Texto Animadas — frontend
   ========================================================================== */

.ctm {
	--ctm-bg: #1d2129;
	--ctm-pad: 24px;
	--ctm-row-gap: 14px;

	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--ctm-row-gap);
	width: 100%;
	padding: var(--ctm-pad) 0;
	background: var(--ctm-bg);
	overflow: hidden;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
}
.ctm *, .ctm *::before, .ctm *::after { box-sizing: border-box; }
.ctm--font { font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

.ctm.ctm--bleed {
	--ctm-vw: calc(100vw - var(--ctm-sbw, 0px));
	position: relative;
	left: calc(50% - var(--ctm-vw) / 2);
	width: var(--ctm-vw);
	max-width: var(--ctm-vw) !important;
	margin-left: 0;
	margin-right: 0;
}
.ctm-block:has(.ctm--bleed) { max-width: none; }

/* --------------------------------------------------------------------------
   Fila
   -------------------------------------------------------------------------- */
.ctm__row {
	--ctm-color: #fff;
	--ctm-opacity: 1;
	--ctm-icon: #fff;
	--ctm-tilt: 0deg;
	--ctm-fs: 32px;
	--ctm-icon-size: 1em;
	--ctm-space: .55em;

	position: relative;
	overflow: hidden;
	color: var(--ctm-color);
	font-size: var(--ctm-fs);
	line-height: 1;
	touch-action: pan-y;
}
.ctm--fade .ctm__row {
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.ctm__row--tilt {
	width: 110%;
	margin-left: -5%;
	transform: rotate(var(--ctm-tilt));
}

/* Tamaños */
.ctm__row--xs { --ctm-fs: clamp(12px, .85vw, 14px); --ctm-icon-size: 1.15em; }
.ctm__row--s  { --ctm-fs: clamp(14px, 1.15vw, 20px); --ctm-icon-size: 1.15em; }
.ctm__row--m  { --ctm-fs: clamp(18px, 1.6vw, 26px); }
.ctm__row--l  { --ctm-fs: clamp(22px, 2.15vw, 34px); }
.ctm__row--xl { --ctm-fs: clamp(32px, 4.4vw, 72px); --ctm-icon-size: .85em; }

/* Franja tipo cinta (vidrio) */
.ctm__row--band {
	padding: .55em 0;
	background: rgba(255, 255, 255, .07);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), inset 0 -1px 0 rgba(255, 255, 255, .13);
}

/* Pista */
.ctm__track {
	display: flex;
	width: max-content;
	will-change: transform;
}
.ctm .ctm__run {
	display: flex;
	align-items: center;
	flex: none;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ctm .ctm__item {
	margin: 0;
	padding: 0 var(--ctm-space);
	list-style: none;
	white-space: nowrap;
	font-weight: 800;
	letter-spacing: -.01em;
	opacity: var(--ctm-opacity);
}
.ctm--upper .ctm__item { text-transform: uppercase; }
.ctm--italic .ctm__item { font-style: italic; }
.ctm .ctm__item a { color: inherit; text-decoration: none; transition: color .2s ease; }
.ctm .ctm__item a:hover { color: var(--ctm-icon); }

.ctm .ctm__sep {
	display: grid;
	place-items: center;
	flex: none;
	margin: 0;
	padding: 0 calc(var(--ctm-space) * .25);
	list-style: none;
	color: var(--ctm-icon);
	line-height: 0;
}
.ctm__sep svg,
.ctm__sep img {
	width: var(--ctm-icon-size);
	height: var(--ctm-icon-size);
	display: block;
	object-fit: contain;
}
.ctm__row--l .ctm__sep svg, .ctm__row--l .ctm__sep img,
.ctm__row--xl .ctm__sep svg, .ctm__row--xl .ctm__sep img { opacity: .85; }
.ctm__char { font-size: .9em; line-height: 1; font-style: normal; }

/* Arrastre */
.ctm[data-drag="1"] .ctm__row { cursor: grab; }
.ctm.is-dragging .ctm__row { cursor: grabbing; user-select: none; }

/* Sin JavaScript: animación CSS simple como respaldo */
.ctm:not(.is-ready) .ctm__track { animation: ctm-fallback 40s linear infinite; }
.ctm:not(.is-ready) .ctm__row[data-dir="1"] .ctm__track { animation-direction: reverse; }
@keyframes ctm-fallback { to { transform: translate3d(-50%, 0, 0); } }

@media (max-width: 767px) {
	.ctm__row--band { padding: .6em 0; }
	.ctm .ctm__item { --ctm-space: .5em; }
}

@media (prefers-reduced-motion: reduce) {
	.ctm:not(.is-ready) .ctm__track { animation: none; }
}

.ctm-notice { padding: 16px; border: 1px dashed #c3c4c7; background: #f6f7f7; color: #50575e; font-size: 14px; }
