/* Cofatuc Hero Slider — v1.2.0 */

.cths {
	--cths-min-h: 460px;
	--cths-photo: 330px;
	--cths-pad-x: clamp(24px, 5.6vw, 96px);
	--cths-speed: 750ms;
	--cths-blur: 28px;
	--cths-veil: .62;
	--cths-bg-sat: .55;
	--cths-ease: cubic-bezier(.2, .7, .2, 1);
	--cths-font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--cths-font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	/* Paletas verdes (se pueden cambiar desde Elementor › Estilo › Colores) */
	--cths-s1-bg: #1E4D3B; --cths-s1-shape: #2A6150; --cths-s1-fg: #F3F7F4;
	--cths-s2-bg: #D3E3D7; --cths-s2-shape: #BCD3C2; --cths-s2-fg: #173A2E;
	--cths-s3-bg: #2D5C53; --cths-s3-shape: #3A6E64; --cths-s3-fg: #F3F7F4;
	--cths-s4-bg: #93B69E; --cths-s4-shape: #A8C6B1; --cths-s4-fg: #12322A;

	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--cths-font-body);
	transition: background-color var(--cths-speed) ease, color var(--cths-speed) ease;
}

.cths *,
.cths *::before,
.cths *::after { box-sizing: border-box; }

.cths[data-scheme="1"], .cths [data-scheme="1"] { --bg: var(--cths-s1-bg); --shape: var(--cths-s1-shape); --fg: var(--cths-s1-fg); }
.cths[data-scheme="2"], .cths [data-scheme="2"] { --bg: var(--cths-s2-bg); --shape: var(--cths-s2-shape); --fg: var(--cths-s2-fg); }
.cths[data-scheme="3"], .cths [data-scheme="3"] { --bg: var(--cths-s3-bg); --shape: var(--cths-s3-shape); --fg: var(--cths-s3-fg); }
.cths[data-scheme="4"], .cths [data-scheme="4"] { --bg: var(--cths-s4-bg); --shape: var(--cths-s4-shape); --fg: var(--cths-s4-fg); }

/* ---------- Diapositivas (apiladas en la misma celda: el alto lo marca la más alta) ---------- */

.cths__stage {
	display: grid;
	touch-action: pan-y;
}

.cths__slide {
	grid-area: 1 / 1;
	position: relative;
	z-index: 0;
	overflow: hidden;
	min-height: var(--cths-min-h);
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
	align-items: center;
	column-gap: clamp(24px, 4vw, 80px);
	padding: 40px var(--cths-pad-x) 112px;
	background: var(--bg);
	color: var(--fg);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--cths-speed) ease, visibility 0s linear var(--cths-speed);
}

.cths:not(:has(.cths__nav)) .cths__slide { padding-bottom: 40px; }

.cths__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity var(--cths-speed) ease, visibility 0s;
}

/* Imagen destacada difuminada de fondo */
.cths__bg {
	position: absolute;
	z-index: -2;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	background: var(--bg);
}
.cths__bg-img {
	position: absolute;
	inset: calc(var(--cths-blur) * -2.5);
	background-color: var(--bg);
	background-size: cover;
	background-position: center;
	filter: blur(var(--cths-blur)) saturate(var(--cths-bg-sat));
	transform: scale(1.04);
}
.cths.has-bg-motion .cths__bg-img {
	transform: scale(1.14);
	transition: transform calc(var(--cths-speed) * 12) linear;
}
.cths.has-bg-motion .cths__slide.is-active .cths__bg-img { transform: scale(1.04); }

/* Velo parejo del color de la paleta */
.cths__veil {
	position: absolute;
	inset: 0;
	background: var(--bg);
	opacity: var(--cths-veil);
}
/* Degradado del lado del texto, para que se lea siempre */
.cths__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, var(--bg) 0%, var(--bg) 18%, transparent 68%);
	opacity: .9;
}
/* Textura fina para que el difuminado no se vea plano */
.cths__bg::before {
	content: "";
	position: absolute;
	z-index: 1;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
	background-size: 3px 3px;
	mix-blend-mode: overlay;
}

/* Círculo grande de fondo */
.cths__blob {
	position: absolute;
	z-index: -1;
	right: -9%;
	top: -16%;
	width: min(62vw, 780px);
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--shape);
	transform: translateX(90px);
	transition: transform calc(var(--cths-speed) * 1.5) var(--cths-ease);
	pointer-events: none;
}
.cths__slide.is-active .cths__blob { transform: none; }
.cths__slide.has-bg .cths__blob {
	background: transparent;
	border: 1.5px solid var(--fg);
	opacity: .14;
}

/* ---------- Texto ---------- */

.cths__content {
	position: relative;
	min-width: 0;
	max-width: 660px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
}

.cths__content > * {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity calc(var(--cths-speed) * .8) ease, transform var(--cths-speed) var(--cths-ease);
}
.cths__slide.is-active .cths__content > * { opacity: 1; transform: none; }
.cths__slide.is-active .cths__content > :nth-child(2) { transition-delay: 80ms; }
.cths__slide.is-active .cths__content > :nth-child(3) { transition-delay: 160ms; }
.cths__slide.is-active .cths__content > :nth-child(4) { transition-delay: 240ms; }

.cths__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
}

.cths__cat {
	display: inline-block;
	padding: 7px 14px;
	border: 1.5px solid currentColor;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.cths__date {
	font-size: 14px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.cths .cths__title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: var(--cths-font-display);
	font-weight: 800;
	font-size: clamp(30px, 3.7vw, 54px);
	line-height: 1.04;
	letter-spacing: -.022em;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.cths .cths__excerpt {
	margin: 0;
	max-width: 34em;
	color: inherit;
	font-size: clamp(16px, 1.25vw, 18px);
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cths .cths__btn,
.cths .cths__btn:hover,
.cths .cths__btn:focus,
.cths .cths__btn:visited {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--fg);
	color: var(--bg);
	font-family: var(--cths-font-body);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: none;
	transition: gap .25s var(--cths-ease), transform .25s var(--cths-ease);
}
.cths .cths__btn:hover { gap: 16px; }
.cths .cths__btn:active { transform: scale(.98); }
.cths .cths__btn svg { flex: none; }

.cths__sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Foto en círculo ---------- */

.cths__media {
	position: relative;
	isolation: isolate;
	justify-self: center;
	width: var(--cths-photo);
	max-width: 100%;
	opacity: 0;
	transform: translateX(60px) scale(.94);
	transition: opacity var(--cths-speed) ease, transform calc(var(--cths-speed) * 1.3) var(--cths-ease);
}
.cths__slide.is-active .cths__media {
	opacity: 1;
	transform: none;
	transition-delay: 90ms;
}

.cths .cths__photo {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 50%;
	overflow: hidden;
	background: var(--shape);
	border: clamp(5px, .7vw, 10px) solid var(--bg);
	text-decoration: none;
}
.cths .cths__photo img,
.cths .cths__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	transform: scale(1.06);
	transition: transform calc(var(--cths-speed) * 6) linear;
}
.cths__slide.is-active .cths__photo img { transform: scale(1); }

.cths__ring {
	position: absolute;
	z-index: -1;
	inset: -20px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	opacity: .35;
	pointer-events: none;
}

.cths__num {
	position: absolute;
	z-index: -2;
	right: -16%;
	top: -14%;
	font-family: var(--cths-font-display);
	font-weight: 800;
	font-size: calc(var(--cths-photo) * .5);
	line-height: .8;
	letter-spacing: -.04em;
	color: transparent;
	-webkit-text-stroke: 2px var(--fg);
	opacity: .5;
	pointer-events: none;
	user-select: none;
}

/* ---------- Navegación ---------- */

.cths__nav {
	position: absolute;
	z-index: 5;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 20px 32px;
	padding: 0 var(--cths-pad-x) 24px;
	color: var(--fg);
	transition: color var(--cths-speed) ease;
}

.cths__tabs {
	flex: 1 1 320px;
	min-width: 0;
	display: flex;
	gap: 12px;
}

.cths button.cths__tab,
.cths button.cths__tab:hover,
.cths button.cths__tab:focus {
	flex: 1 1 0;
	min-width: 0;
	min-height: 44px;
	margin: 0;
	padding: 12px 0 6px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 10px;
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.cths__tab-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .1em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: .72;
	transition: opacity .3s ease;
}
.cths__tab[aria-current="true"] .cths__tab-label,
.cths__tab:hover .cths__tab-label { opacity: 1; }

.cths__track {
	position: relative;
	display: block;
	height: 4px;
	border-radius: 2px;
	overflow: hidden;
}
.cths__track::before {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	opacity: .28;
}
.cths__fill {
	position: absolute;
	inset: 0;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left center;
}
.cths__tab[aria-current="true"] .cths__fill { transform: scaleX(1); }
.cths.is-autoplay .cths__tab[aria-current="true"] .cths__fill { transform: scaleX(0); }
.cths__tab.is-done .cths__fill { transform: scaleX(1); opacity: .6; }

.cths__ctrl {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cths__counter {
	margin-right: 4px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .04em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cths button.cths__btn-round,
.cths button.cths__btn-round:hover,
.cths button.cths__btn-round:focus {
	width: 48px;
	height: 48px;
	min-height: 0;
	margin: 0;
	padding: 0;
	display: grid;
	place-items: center;
	appearance: none;
	background: transparent;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.cths button.cths__btn-round:hover {
	background: var(--fg);
	color: var(--bg);
}

.cths__toggle .cths__i-play { display: none; }
.cths.is-paused .cths__toggle .cths__i-play { display: block; }
.cths.is-paused .cths__toggle .cths__i-pause { display: none; }

.cths a:focus-visible,
.cths button:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 4px;
}
.cths .cths__btn:focus-visible { outline-color: var(--fg); }

/* Vacío (solo en el editor) */
.cths-empty {
	padding: 32px;
	border: 1px dashed #93B69E;
	background: #EEF4EF;
	color: #1E4D3B;
	font: 500 15px/1.5 system-ui, sans-serif;
	text-align: center;
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
	.cths { --cths-photo: 250px; --cths-min-h: 440px; }
	.cths__slide {
		grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
		padding-top: 36px;
		padding-bottom: 108px;
	}
	.cths__ring { inset: -18px; }
}

/* ---------- Celular ---------- */

@media (max-width: 767px) {
	.cths { --cths-photo: 160px; --cths-min-h: 0px; }
	.cths__slide {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
		align-content: start;
		row-gap: 26px;
		padding-top: 32px;
		padding-bottom: 108px;
	}
	.cths:not(:has(.cths__nav)) .cths__slide { padding-bottom: 32px; }

	.cths__media {
		order: -1;
		justify-self: start;
		margin-left: 18px;
		transform: translateY(24px) scale(.94);
	}
	.cths__ring { inset: -14px; }
	.cths__num { right: -70%; top: 10%; font-size: calc(var(--cths-photo) * .62); }

	.cths__bg::after {
		background: linear-gradient(0deg, var(--bg) 0%, var(--bg) 40%, transparent 90%);
	}
	.cths__blob {
		width: 125vw;
		right: -62%;
		top: -10%;
	}

	.cths__content { gap: 14px; }
	.cths .cths__excerpt { -webkit-line-clamp: 3; }
	.cths .cths__excerpt { font-size: 16px; }

	.cths__nav {
		gap: 14px 16px;
		padding-bottom: 22px;
	}
	.cths__tabs { flex-basis: 100%; gap: 8px; }
	.cths__tab-label { display: none; }
	.cths button.cths__tab,
	.cths button.cths__tab:hover,
	.cths button.cths__tab:focus { min-height: 28px; padding: 12px 0; }

	.cths__ctrl { width: 100%; gap: 10px; }
	.cths__counter { margin-right: auto; }
	.cths button.cths__btn-round,
	.cths button.cths__btn-round:hover,
	.cths button.cths__btn-round:focus { width: 46px; height: 46px; }
}

/* ---------- Menos movimiento ---------- */

@media (prefers-reduced-motion: reduce) {
	.cths__blob,
	.cths__media,
	.cths__content > *,
	.cths .cths__photo img,
	.cths .cths__img,
	.cths__bg-img {
		transform: none !important;
		transition-property: opacity !important;
	}
}
