/* =====================================================================
   ilia-card-hover  (prefijo .ilch)
   Todo escala con la card (container query units: cqw). Las posiciones
   verticales son % del alto, así que un alto personalizado mantiene
   las proporciones.
   ===================================================================== */
.ilch {
	--ilch-block: #f72d00;
	--ilch-bg: #ffeaea;
	--ilch-title: #fff;
	--ilch-text: #fff;
	--ilch-rule: #fff;
	--ilch-btn: #fff;
	--ilch-arrow: #f72d00;
	--ilch-ar: 1360/794;
	--ilch-h: auto;
	--ilch-bw: 70.6;
	--ilch-rn: 87%;
	--ilch-rh: 58.6%;
	--ilch-tl: 1;
	--ilch-ts: max(2rem, 8.6cqw);
	--ilch-fh: 91%;
	--ilch-fx: 85.3%;
	--ilch-dur: .7s;
	--ilch-radius: 0px;
	--ilch-ease: cubic-bezier(.65, 0, .2, 1);
	--ilch-rt: max(var(--ilch-rh), calc(8.3% + var(--ilch-tl) * var(--ilch-ts) * 1.05 + 5cqw));

	container-type: inline-size;
	position: relative;
	display: block;
	width: 100%;
	height: var(--ilch-h);
	aspect-ratio: var(--ilch-ar);
	overflow: hidden;
	background: var(--ilch-bg);
	border-radius: var(--ilch-radius);
	text-decoration: none;
	color: inherit;
	box-sizing: border-box;
	isolation: isolate;
	-webkit-tap-highlight-color: transparent;
}
.ilch *, .ilch *::before, .ilch *::after { box-sizing: border-box; }
.ilch:hover, .ilch:focus { text-decoration: none; }

/* Rejilla de cards */
.ilch-grid {
	--ilch-cols: 2; --ilch-gx: 24px; --ilch-gy: 24px;
	display: grid;
	grid-template-columns: repeat(var(--ilch-cols), minmax(0, 1fr));
	column-gap: var(--ilch-gx);
	row-gap: var(--ilch-gy);
	width: 100%;
}
@media (max-width: 767px) { .ilch-grid { --ilch-cols: 1; } }

/* Figura (queda detrás del bloque; se descubre al encogerse) */
.ilch .ilch__figure {
	position: absolute;
	z-index: 0;
	top: 4.4%;
	left: var(--ilch-fx);
	height: var(--ilch-fh);
	transform: translateX(-50%) scale(.96);
	transform-origin: center;
	opacity: 0;
	transition: opacity calc(var(--ilch-dur) * .8) ease calc(var(--ilch-dur) * .25),
	            transform var(--ilch-dur) var(--ilch-ease);
	pointer-events: none;
}
.ilch .ilch__figure img {
	display: block;
	height: 100%;
	width: auto;
	max-width: none;
	margin: 0;
	border-radius: 0;
}

/* Bloque de color */
.ilch .ilch__block {
	position: absolute;
	z-index: 1;
	top: 0; left: 0; bottom: 0;
	width: 100%;
	overflow: hidden;
	background: var(--ilch-block);
	transition: width var(--ilch-dur) var(--ilch-ease);
	will-change: width;
}

/* Título */
.ilch .ilch__title {
	position: absolute;
	top: 8.3%;
	left: 6.6cqw;
	right: 22cqw;
	margin: 0;
	padding: 0;
	color: var(--ilch-title);
	font-size: var(--ilch-ts);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -.02em;
	min-height: calc(var(--ilch-tl) * 1.05em);
	overflow-wrap: break-word;
}

/* Botón: anclado al borde derecho del bloque, lo acompaña al encogerse */
.ilch .ilch__btn {
	position: absolute;
	top: 8.3%;
	right: 8.2cqw;
	width: 8.8cqw;
	height: 8.8cqw;
	min-width: 36px; min-height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ilch-btn);
	color: var(--ilch-arrow);
	border-radius: 1.2cqw;
	transition: right var(--ilch-dur) var(--ilch-ease);
}
.ilch .ilch__btn svg { width: 55%; height: 55%; display: block; }

/* Línea */
.ilch .ilch__rule {
	position: absolute;
	left: 6.6cqw;
	right: 6.5cqw;
	top: var(--ilch-rn);
	height: max(2px, .3cqw);
	background: var(--ilch-rule);
	transition: top var(--ilch-dur) var(--ilch-ease), right var(--ilch-dur) var(--ilch-ease);
}

/* Texto: ancho fijo (no reflujo mientras el bloque se encoge) */
.ilch .ilch__text {
	position: absolute;
	left: 6.6cqw;
	top: calc(var(--ilch-rt) + 8.8%);
	width: calc(var(--ilch-bw) * 1cqw - 13.8cqw);
	margin: 0;
	color: var(--ilch-text);
	font-size: max(.875rem, 1.95cqw);
	font-weight: 400;
	line-height: 1.3;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity calc(var(--ilch-dur) * .6) ease, transform calc(var(--ilch-dur) * .6) var(--ilch-ease);
}

/* ----- Estado hover ----- */
.ilch:hover .ilch__block,
.ilch:focus-visible .ilch__block { width: calc(var(--ilch-bw) * 1%); }
.ilch:hover .ilch__btn,
.ilch:focus-visible .ilch__btn { right: 7.2cqw; }
.ilch:hover .ilch__rule,
.ilch:focus-visible .ilch__rule {
	top: var(--ilch-rt);
	right: 7.2cqw;
}
.ilch:hover .ilch__text,
.ilch:focus-visible .ilch__text {
	opacity: 1;
	transform: none;
	transition-delay: calc(var(--ilch-dur) * .45);
}
.ilch:hover .ilch__figure,
.ilch:focus-visible .ilch__figure { opacity: 1; transform: translateX(-50%) scale(1); }

.ilch:focus-visible { outline: 3px solid var(--ilch-block); outline-offset: 3px; }

/* Táctil: sin hover real, la card se muestra abierta (si está activado) */
@media (hover: none) {
	.ilch.ilch--touch-open .ilch__block { width: calc(var(--ilch-bw) * 1%); }
	.ilch.ilch--touch-open .ilch__btn { right: 7.2cqw; }
	.ilch.ilch--touch-open .ilch__rule { top: var(--ilch-rt); right: 7.2cqw; }
	.ilch.ilch--touch-open .ilch__text { opacity: 1; transform: none; }
	.ilch.ilch--touch-open .ilch__figure { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ----- Entrada opcional ----- */
.ilch.ilch--anim { animation: ilch-in .8s var(--ilch-ease) both; }
@keyframes ilch-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ----- Móvil: card más cuadrada (editable) ----- */
@media (max-width: 767px) {
	.ilch { --ilch-ar: 1/1; --ilch-ts: max(1.8rem, 11cqw); }
	.ilch .ilch__title { top: 7%; left: 7cqw; right: 26cqw; }
	.ilch .ilch__btn { top: 7%; width: 14cqw; height: 14cqw; right: 7cqw; border-radius: 2.4cqw; }
	.ilch:hover .ilch__btn, .ilch:focus-visible .ilch__btn { right: 6cqw; }
	.ilch .ilch__rule { left: 7cqw; right: 7cqw; }
	.ilch .ilch__text { left: 7cqw; font-size: max(.8rem, 3.3cqw); width: calc(var(--ilch-bw) * 1cqw - 14cqw); }
}

@media (prefers-reduced-motion: reduce) {
	.ilch, .ilch * { transition-duration: .01s !important; transition-delay: 0s !important; animation: none !important; }
}

/* Fix de alto: dentro de un contenedor flex en columna Elementor puede calcular el widget con ancho 0 y reservar solo el gap */
.elementor-widget-iliacardhover { width: 100%; }
