/**
 * Home: "Solucoes conectadas" (nova versao).
 * Desktop: 4 cards em subgrid (todas as partes alinhadas) + trilho 01-04.
 * Tablet: 2 colunas. Celular: 1 coluna.
 * Movimento: so transform/opacity; a entrada vem do motion.js.
 */

.zf-hcx {
	--hcx-gap: 1.25rem;
	--hcx-borda: #221e2c;
	--hcx-cartao: #121019;
	display: flex;
	flex-direction: column;
}

/* ---------- Cabecalho ---------- */

.zf-hcx-cabeca {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(1.5rem, 1rem + 3vw, 4rem);
	align-items: end;
	margin-bottom: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
}
.zf-hcx-cabeca__titulo { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.zf-hcx-selo {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.75rem;
	border-radius: 999px;
	background: rgba(122, 30, 246, 0.14);
	border: 1px solid #3b1d6e;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #d9bffc;
}
.zf-hcx-selo > span { width: 6px; height: 6px; border-radius: 50%; background: #c084fc; box-shadow: 0 0 8px #c084fc; }
.zf-hcx-cabeca h2 {
	margin: 0;
	font-size: clamp(2rem, 1.35rem + 2.3vw, 3.125rem);
	line-height: 1.08;
	font-weight: 800;
	letter-spacing: -0.035em;
	color: #ffffff;
	text-wrap: balance;
}
.zf-hcx-cabeca mark { background: none; color: var(--wp--custom--roxo--400, #bd8efa); }
.zf-hcx-lead {
	margin: 0 0 0.375rem;
	font-size: clamp(1rem, 0.92rem + 0.3vw, 1.125rem);
	line-height: 1.6;
	color: var(--wp--preset--color--cinza, #a1a1aa);
}

/* ---------- Trilho 01-04 ---------- */

.zf-hcx-trilho {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--hcx-gap);
	margin-bottom: 1.125rem;
}
.zf-hcx-trilho__linha {
	position: absolute;
	left: calc(12.5% - var(--hcx-gap) * 3 / 8);
	right: calc(12.5% - var(--hcx-gap) * 3 / 8);
	top: 16px;
	height: 2px;
	border-radius: 2px;
	overflow: hidden;
	background: linear-gradient(90deg, rgba(97, 9, 215, 0.25), #7a1ef6 20%, #c04df2 50%, #7a1ef6 80%, rgba(97, 9, 215, 0.25));
	transform-origin: left center;
}
.zf-hcx-trilho__luz {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent calc(100% - 110px), #f5d0fe calc(100% - 20px), transparent);
	opacity: 0;
}
.zf-hcx-no {
	position: relative;
	z-index: 1;
	justify-self: center;
	width: 34px;
	height: 34px;
	box-sizing: border-box;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #120227;
	border: 1px solid #6109d7;
	font-size: 0.75rem;
	font-weight: 800;
	color: #d9bffc;
	transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
/* O no acende junto com o card em foco. */
.zf-hcx:has(.zf-hcx-card:nth-child(1):is(:hover, :focus-within)) .zf-hcx-no:nth-child(2),
.zf-hcx:has(.zf-hcx-card:nth-child(2):is(:hover, :focus-within)) .zf-hcx-no:nth-child(3),
.zf-hcx:has(.zf-hcx-card:nth-child(3):is(:hover, :focus-within)) .zf-hcx-no:nth-child(4),
.zf-hcx:has(.zf-hcx-card:nth-child(4):is(:hover, :focus-within)) .zf-hcx-no:nth-child(5) {
	background: #7a1ef6;
	color: #ffffff;
	box-shadow: 0 0 0 6px rgba(122, 30, 246, 0.18), 0 0 24px rgba(122, 30, 246, 0.6);
}

/* ---------- Cards ---------- */

.zf-hcx-grade {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: repeat(6, auto);
	column-gap: var(--hcx-gap);
	row-gap: 0;
}
.zf-hcx-card {
	position: relative;
	grid-row: span 6;
	display: grid;
	grid-template-rows: subgrid;
	row-gap: 0.75rem;
	padding: 10px;
	border-radius: 22px;
	background-color: var(--hcx-cartao);
	border: 1px solid var(--hcx-borda);
	transition: translate 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.zf-hcx-card:is(:hover, :focus-within) {
	translate: 0 -4px;
	border-color: #6109d7;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 60px rgba(122, 30, 246, 0.18);
}
.zf-hcx-card > :not(.zf-hcx-card__img) { margin-inline: 12px; }

.zf-hcx-card__img {
	margin-bottom: 0.5rem;
	border-radius: 15px;
	overflow: hidden;
	background: #f5f1fc;
	border: 1px solid rgba(255, 255, 255, 0.06);
}
.zf-hcx-card__img img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }

.zf-hcx-card__cat {
	margin-block: 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #bd8efa;
}
.zf-hcx-card__n { display: none; color: #6b6478; }
.zf-hcx-card__n::after { content: ""; display: inline-block; width: 14px; height: 1px; margin-left: 0.5rem; vertical-align: middle; background: #4b3a6b; }

.zf-hcx-card__titulo {
	margin-block: 0;
	font-size: clamp(1.25rem, 1.15rem + 0.3vw, 1.375rem);
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #ffffff;
}
.zf-hcx-card__texto { margin-block: 0; font-size: 0.90625rem; line-height: 1.6; color: var(--wp--preset--color--cinza, #a1a1aa); }

.zf-hcx-card__tags {
	margin-block: 0;
	padding: 0;
	list-style: none;
	align-self: start;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.zf-hcx-card__tags li {
	margin: 0;
	padding: 5px 10px;
	border-radius: 999px;
	background: #16131f;
	border: 1px solid #2a2536;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	color: #d4d4d8;
}

.zf-hcx-card__link {
	align-self: end;
	margin-top: 0.25rem;
	margin-bottom: 2px;
	padding-top: 1rem;
	border-top: 1px solid var(--hcx-borda);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	font-size: 0.875rem;
	font-weight: 700;
	color: #ffffff;
	text-decoration: none;
}
.zf-hcx-card__link--vazio { border-top: 0; padding: 0; }
.zf-hcx-card__link:hover, .zf-hcx-card__link:focus-visible { color: #ffffff; }
/* O card inteiro e clicavel pelo link. */
.zf-hcx-card__link::after { content: ""; position: absolute; inset: 0; border-radius: 22px; }
.zf-hcx-card__link:focus-visible { outline: none; }
.zf-hcx-card:has(.zf-hcx-card__link:focus-visible) { outline: 2px solid #bd8efa; outline-offset: 3px; }
.zf-hcx-card__seta {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	box-sizing: border-box;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #6109d7;
	background: #120227;
	transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.zf-hcx-card:is(:hover, :focus-within) .zf-hcx-card__seta { background: #7a1ef6; border-color: #7a1ef6; transform: translateX(3px); }

/* ---------- Entrada (grupos do motion.js) ---------- */

html.zf-mo:not(.zf-mo-falhou) .zf-hcx-trilho[data-zf-mo-grupo] .zf-hcx-trilho__linha { transform: scaleX(0); }
html.zf-mo:not(.zf-mo-falhou) .zf-hcx-trilho.zf-mo-visivel .zf-hcx-trilho__linha {
	transform: none;
	transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}
html.zf-mo:not(.zf-mo-falhou) .zf-hcx-trilho.zf-mo-visivel .zf-hcx-trilho__luz {
	animation: zf-hcx-luz 1.4s cubic-bezier(0.45, 0, 0.2, 1) 1.1s 1 both;
}
@keyframes zf-hcx-luz {
	0% { transform: translateX(-100%); opacity: 0; }
	15% { opacity: 1; }
	85% { opacity: 1; }
	100% { transform: translateX(8%); opacity: 0; }
}

/* Depois de entrar, o hover do card volta a ser imediato (translate separado do transform da entrada). */
html.zf-mo:not(.zf-mo-falhou) .zf-hcx .zf-hcx-card[data-zf-mo].zf-mo-in {
	transition:
		opacity 0.8s var(--zf-mo-ease) var(--zf-atraso, 0ms),
		transform 0.9s var(--zf-mo-ease) var(--zf-atraso, 0ms),
		translate 0.3s ease,
		border-color 0.3s ease,
		box-shadow 0.3s ease;
}

/* ---------- Tablet e celular ---------- */

@media (max-width: 1180px) {
	.zf-hcx-trilho { display: none; }
	.zf-hcx-card__n { display: inline; }
	.zf-hcx-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; gap: var(--hcx-gap); }
	.zf-hcx-card { grid-row: auto; display: flex; flex-direction: column; gap: 0.75rem; }
	.zf-hcx-card__img { margin-bottom: 0.5rem; }
	.zf-hcx-card__link { margin-top: auto; align-self: stretch; }
	.zf-hcx-card__link--vazio { display: none; }
	.zf-hcx-card__tags { margin-bottom: 0.5rem; }
}
@media (max-width: 900px) {
	.zf-hcx-cabeca { grid-template-columns: 1fr; align-items: start; gap: 1rem; }
	.zf-hcx-lead { margin: 0; }
}
@media (max-width: 640px) {
	.zf-hcx-grade { grid-template-columns: 1fr; gap: 1rem; }
	.zf-hcx-card__titulo { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
	.zf-hcx-card, .zf-hcx-card__seta, .zf-hcx-no { transition: none; }
	.zf-hcx-card:is(:hover, :focus-within) { translate: none; }
	.zf-hcx-trilho__luz { display: none; }
}
