/* ==========================================================================
   CPS · Wrapper de SPOKE transversal (CPT: cps_spoke) — estilos
   --------------------------------------------------------------------------
   Sitio nuevo en desarrollo. Da forma al wrapper single-spoke.php y al cuerpo
   editorial de cada spoke (7401-seo.php, 7402.php, …) SIN tocar su markup.

   REGLAS DE LA CASA (idénticas a máquina/silo):
   · Prohibido !important. Conflictos resueltos por ESPECIFICIDAD: TODO cuelga
     de .cps-tpl-spoke, igual que la ficha cuelga de .cps-tpl-machine y el hub
     de .cps-tpl-silo. Scopes disjuntos → cero guerra de cascada entre ellos.
   · Mismo sistema de tokens que single-product-machine.css para consistencia
     1:1 con el resto de la web (marca, tipografía fluida, radios, sombras).
   · Sin build: CSS plano, editable a mano.

   BEM:
   · Bloque wrapper:  cps-tpl-spoke (chrome: header, subheader, layout, aside…).
   · Bloque cuerpo:   seo-* / rag-* / highlight-* / process-* / mid-cta / cta
     son los nombres que YA EMITE el contenido del spoke; aquí se les da estilo
     bajo el scope .cps-tpl-spoke (no se renombra nada del 7401).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens — mismos valores que .cps-tpl-machine / .cps-tpl-silo.
   Redeclarados aquí para que el spoke sea autónomo aunque se cargue solo.
   -------------------------------------------------------------------------- */
.cps-tpl-spoke {
	/* Marca (amarillo CPS + tinta cálida del sistema) */
	--green:       #f4d300;
	--green-hover: #e3d44a;
	--green-deep:  #c9ad00;
	--green-soft:  #fdfce9;
	--green-light: #fbf49a;
	--green-dark:  #3f3c13;

	--blue:        #6366f1;
	--blue-cyan:   #8b5cf6;

	--black:       #0d0c0a;
	--ink:         #181715;
	--ink-2:       #2e2c29;
	--ink-3:       #4d4a46;
	--muted:       #73706a;
	--muted-2:     #a19e98;
	--line:        #e8e6e1;
	--tint:        #f7f6f2;
	--tint-2:      #fcfcfa;
	--white:       #fff;

	--feat-bg-1:  #141310;
	--feat-bg-2:  #080806;

	--white-22: rgba(255,255,255,.22);
	--white-12: rgba(255,255,255,.12);
	--white-08: rgba(255,255,255,.08);
	--green-25: rgba(244,211,0,.25);
	--green-18: rgba(244,211,0,.18);
	--green-10: rgba(244,211,0,.1);
	--green-08: rgba(244,211,0,.08);
	--green-06: rgba(244,211,0,.06);
	--blue-18:  rgba(99,102,241,.18);
	--blue-10:  rgba(99,102,241,.1);
	--blue-08:  rgba(99,102,241,.08);
	--ink-sh-04: rgba(24,23,21,.04);
	--ink-sh-06: rgba(24,23,21,.06);
	--ink-sh-10: rgba(24,23,21,.1);
	--ink-sh-18: rgba(24,23,21,.18);

	/* Acentos semánticos para las cajas de prosa (info / alerta) */
	--info:      #2563eb;
	--info-bg:   #eff4ff;
	--info-line: #bcd0ff;
	--alert:     #c2410c;
	--alert-bg:  #fff5ed;
	--alert-line:#fcd3b4;

	--text-2xs: clamp(.625rem, .6rem + .15vw, .75rem);
	--text-xs:  clamp(.75rem, .71rem + .18vw, .875rem);
	--text-sm:  clamp(.875rem, .84rem + .18vw, 1rem);
	--text-base:clamp(1rem, .96rem + .18vw, 1.125rem);
	--text-md:  clamp(1.125rem, 1.05rem + .36vw, 1.375rem);
	--text-lg:  clamp(1.25rem, 1.11rem + .71vw, 1.75rem);
	--text-xl:  clamp(1.5rem, 1.29rem + 1.07vw, 2.25rem);
	--text-2xl: clamp(2rem, 1.2rem + 1.43vw, 3rem);
	--text-3xl: clamp(2.5rem, 2.07rem + 2.14vw, 4rem);

	--r-xs: 4px;  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 24px;  --r-pill: 999px;
	--sh-1: 0 1px 2px var(--ink-sh-04);
	--sh-2: 0 4px 16px var(--ink-sh-06);
	--sh-3: 0 10px 30px var(--ink-sh-10);
	--sh-4: 0 20px 50px var(--ink-sh-18);

	--ease: cubic-bezier(.22, 1, .36, 1);
	--max: 1280px;
	--measure: 72ch;     /* ancho de lectura confortable del cuerpo editorial */
	--pad-x: 32px;

	color: var(--ink);
	font-size: var(--text-base);
	line-height: 1.7;
}
@media (max-width: 768px) { .cps-tpl-spoke { --pad-x: 20px; } }

/* Reset acotado (solo dentro del spoke; no global). */
.cps-tpl-spoke *, .cps-tpl-spoke *::before, .cps-tpl-spoke *::after { box-sizing: border-box; }
.cps-tpl-spoke img, .cps-tpl-spoke svg { display: block; max-width: 100%; }
.cps-tpl-spoke figure { margin: 0; }

/* --------------------------------------------------------------------------
   Componentes base reutilizados (eyebrow / fade) — redeclarados en scope spoke
   para que el wrapper sea autónomo. Misma especificidad que máquina/silo.
   -------------------------------------------------------------------------- */
.cps-tpl-spoke .cps-eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: var(--text-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
	color: var(--green-deep); padding: 6px 14px;
	border: 1px solid var(--green-25); border-radius: var(--r-pill);
	background: var(--green-06); margin-bottom: 20px;
	transition: border-color .15s ease, background .15s ease, color .15s ease;
}
a.cps-eyebrow.cps-tpl-spoke__silo:hover { border-color: var(--green); background: var(--green-10); color: var(--ink); }
.cps-tpl-spoke .cps-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-18); }

.cps-tpl-spoke .cps-fade { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.cps-tpl-spoke .cps-fade.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.cps-tpl-spoke .cps-fade { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   WRAPPER · chrome del artículo (header, subheader, layout, aside, footer)
   ========================================================================== */

/* Caja-artículo centrada con ancho máximo del tema. El wrapper externo
   (.page-wrapper / .l-container.envoltura) lo aporta el tema; aquí solo
   acotamos el bloque del spoke. */
.cps-tpl-spoke {
	width: 100%;
	max-width: var(--max);
	margin-inline: auto;
	padding-inline: var(--pad-x);
}

/* ----------------------------- Header / H1 ----------------------------- */
.cps-tpl-spoke__header { padding: 64px 0 28px; }
.cps-tpl-spoke__header-inner { max-width: var(--measure); }
.cps-tpl-spoke__title {
	font-size: var(--text-2xl); font-weight: 800; line-height: 1.08;
	letter-spacing: -.035em; color: var(--ink); margin: 0;
	text-wrap: balance;
}
@media (max-width: 768px) { .cps-tpl-spoke__header { padding: 40px 0 20px; } }

/* ----------------------------- Subheader ------------------------------- */
.cps-tpl-spoke__subheader {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; flex-wrap: wrap;
	padding: 14px 0; margin-bottom: 8px;
	border-block: 1px solid var(--line);
	font-size: var(--text-xs); color: var(--muted);
}
.cps-tpl-spoke__subheader a { color: var(--ink-3); font-weight: 500; text-decoration: none; }
.cps-tpl-spoke__subheader a:hover { color: var(--green-deep); }
.cps-tpl-spoke__subheader .wpsge-breadcrumbs,
.cps-tpl-spoke__subheader nav { font-size: var(--text-xs); }

/* ------------------------------ Layout --------------------------------- */
/* 1 columna por defecto; si hay aside con widgets, pasa a 2 columnas. */
.cps-tpl-spoke__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 48px;
	padding-block: 40px 16px;
	align-items: start;
}
.cps-tpl-spoke__layout:has(.cps-tpl-spoke__aside) {
	grid-template-columns: minmax(0, 1fr) 300px;
}
@media (max-width: 1024px) {
	.cps-tpl-spoke__layout:has(.cps-tpl-spoke__aside) { grid-template-columns: minmax(0, 1fr); }
}

.cps-tpl-spoke__main { min-width: 0; }

.cps-tpl-spoke__aside {
	position: sticky; top: 96px;
	align-self: start;
	font-size: var(--text-sm);
}
@media (max-width: 1024px) { .cps-tpl-spoke__aside { position: static; top: auto; } }

/* ------------------------------ Footer --------------------------------- */
.cps-tpl-spoke__author {
	margin-top: 56px; padding-top: 32px;
	border-top: 1px solid var(--line);
	max-width: var(--measure);
}

/* ==========================================================================
   CUERPO EDITORIAL · estilos de las clases que YA EMITE 7401-seo.php
   (seo-content / seo-section / h2.first / rag-definition / highlight-box /
    code-block / math-block / process-list / mid-cta / cta / silo-bridge)
   --------------------------------------------------------------------------
   Se acota el ancho de lectura a --measure y se aplica ritmo vertical fluido.
   ========================================================================== */

.cps-tpl-spoke .seo-content { max-width: var(--measure); }

/* Cada bloque temático (intro / diagnóstico / solución / faq) = una "sección".
   Sirve también como contenedor de chunk RAG (data-rag-layer). */
.cps-tpl-spoke .seo-section { margin: 0 0 56px; }
.cps-tpl-spoke .seo-section:last-child { margin-bottom: 0; }
@media (max-width: 768px) { .cps-tpl-spoke .seo-section { margin-bottom: 40px; } }

/* ------------------------------ Titulares ------------------------------ */
.cps-tpl-spoke .seo-section h2 {
	font-size: var(--text-xl); font-weight: 800; line-height: 1.15;
	letter-spacing: -.03em; color: var(--ink);
	margin: 48px 0 18px; scroll-margin-top: 96px;
	text-wrap: balance;
}
.cps-tpl-spoke .seo-section h2.first { margin-top: 8px; }

.cps-tpl-spoke .seo-section h3 {
	font-size: var(--text-md); font-weight: 800; line-height: 1.25;
	letter-spacing: -.02em; color: var(--ink-2);
	margin: 36px 0 14px; scroll-margin-top: 96px;
}

/* Acento de marca para énfasis dentro de titulares (si llegara a usarse <em>). */
.cps-tpl-spoke .seo-section h2 em,
.cps-tpl-spoke .seo-section h3 em {
	font-style: normal; font-weight: 800;
	background: linear-gradient(120deg, var(--green-deep) 0%, var(--green) 100%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ------------------------------ Párrafos ------------------------------- */
.cps-tpl-spoke .seo-section p {
	font-size: var(--text-base); color: var(--ink-3); line-height: 1.75;
	margin: 0 0 20px;
}
.cps-tpl-spoke .seo-section strong { color: var(--ink); font-weight: 700; }

/* <code> en línea (force, blade_offset…) coherente con el bloque de código. */
.cps-tpl-spoke .seo-section :not(pre) > code {
	font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
	font-size: .875em;
	background: var(--tint); color: var(--ink-2);
	border: 1px solid var(--line); border-radius: var(--r-xs);
	padding: .12em .4em;
}

/* Enlaces del cuerpo: subrayado discreto con realce de marca al hover. */
.cps-tpl-spoke .seo-section a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--green);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: color .15s ease, background .15s ease;
}
.cps-tpl-spoke .seo-section a:hover { color: var(--green-deep); }

/* ----------------------- PUENTE DE SILO (silo-bridge) ------------------- */
/* Enlace trans-silo unidireccional. Marcado visual sobrio que lo distingue
   del enlace intra-silo normal: chip con flecha y color azul "cruce". */
.cps-tpl-spoke .seo-section a.silo-bridge {
	color: var(--blue);
	text-decoration-color: var(--blue-18);
	font-weight: 700;
}
.cps-tpl-spoke .seo-section a.silo-bridge:hover {
	color: var(--white);
	background: var(--blue);
	text-decoration-color: transparent;
	border-radius: var(--r-xs);
	padding: .04em .18em;
	margin: 0 -.18em;
}

/* ----------------------- Listas de proceso ----------------------------- */
.cps-tpl-spoke .process-list {
	list-style: none; margin: 24px 0; padding: 0;
	display: grid; gap: 12px;
	counter-reset: cps-step;
}
.cps-tpl-spoke .process-list__item {
	position: relative;
	padding: 16px 18px 16px 56px;
	background: var(--tint-2);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	font-size: var(--text-sm); color: var(--ink-2); line-height: 1.6;
	counter-increment: cps-step;
}
.cps-tpl-spoke .process-list__item::before {
	content: counter(cps-step);
	position: absolute; left: 16px; top: 14px;
	width: 28px; height: 28px;
	display: grid; place-items: center;
	background: var(--green); color: var(--ink);
	font-size: var(--text-xs); font-weight: 800;
	border-radius: 50%;
}

/* ----------------------- Definición RAG (glosario) --------------------- */
.cps-tpl-spoke .rag-definition {
	margin: 28px 0;
	padding: 20px 24px;
	background: var(--green-06);
	border: 1px solid var(--green-18);
	border-left: 3px solid var(--green);
	border-radius: var(--r-md);
}
.cps-tpl-spoke .rag-definition p { margin: 0; font-size: var(--text-sm); color: var(--ink-2); line-height: 1.65; }
.cps-tpl-spoke .rag-definition strong { color: var(--green-dark); }

/* ----------------------- Cajas de realce ------------------------------- */
.cps-tpl-spoke .highlight-box {
	margin: 28px 0;
	padding: 22px 26px;
	border-radius: var(--r-md);
	border: 1px solid var(--line);
	background: var(--tint-2);
	position: relative;
}
.cps-tpl-spoke .highlight-box p { margin: 0; font-size: var(--text-sm); color: var(--ink-2); line-height: 1.7; }
.cps-tpl-spoke .highlight-box p + p { margin-top: 12px; }

/* Variante informativa (azul). */
.cps-tpl-spoke .highlight-box--info {
	background: var(--info-bg);
	border-color: var(--info-line);
	border-left: 3px solid var(--info);
}
.cps-tpl-spoke .highlight-box--info strong { color: var(--info); }

/* Variante alerta / coste oculto (ámbar). */
.cps-tpl-spoke .highlight-box--alert {
	background: var(--alert-bg);
	border-color: var(--alert-line);
	border-left: 3px solid var(--alert);
}
.cps-tpl-spoke .highlight-box--alert strong { color: var(--alert); }

/* ----------------------- Bloque de código ------------------------------ */
.cps-tpl-spoke .code-block {
	margin: 28px 0;
	background: linear-gradient(165deg, var(--feat-bg-1) 0%, var(--feat-bg-2) 100%);
	border: 1px solid var(--white-12);
	border-radius: var(--r-lg);
	overflow: hidden;
	box-shadow: var(--sh-3);
}
.cps-tpl-spoke .code-block pre {
	margin: 0;
	padding: 22px 24px;
	overflow-x: auto;
	font-size: var(--text-xs);
	line-height: 1.7;
}
.cps-tpl-spoke .code-block code {
	font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
	color: var(--white-92, rgba(255,255,255,.92));
	background: none; border: 0; padding: 0;
	white-space: pre;
}
/* Tinte de comentarios .ini (líneas que empiezan por ';') para legibilidad.
   Sin resaltador externo: solo color base claro sobre fondo oscuro. */
.cps-tpl-spoke .code-block code .language-ini { color: rgba(255,255,255,.92); }

/* ----------------------- Bloque matemático ----------------------------- */
.cps-tpl-spoke .math-block {
	margin: 28px 0;
	padding: 24px;
	background: var(--tint-2);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	text-align: center;
	overflow-x: auto;
	font-size: var(--text-md);
	color: var(--ink);
}

/* ----------------------- Figuras / media ------------------------------- */
.cps-tpl-spoke figure,
.cps-tpl-spoke .smk-content-break {
	margin: 32px 0;
}
.cps-tpl-spoke figure img,
.cps-tpl-spoke .smk-content-break img {
	width: 100%; height: auto;
	border-radius: var(--r-lg);
	box-shadow: var(--sh-2);
}
.cps-tpl-spoke figure figcaption {
	margin-top: 12px;
	font-size: var(--text-xs); color: var(--muted);
	text-align: center; line-height: 1.5;
}

/* ----------------------- CTA intermedia (mid-cta) ---------------------- */
.cps-tpl-spoke .mid-cta {
	display: flex; align-items: center; justify-content: space-between;
	gap: 24px; flex-wrap: wrap;
	margin: 36px 0;
	padding: 28px 32px;
	background: linear-gradient(160deg, var(--feat-bg-1) 0%, var(--feat-bg-2) 100%);
	border-radius: var(--r-xl);
	color: var(--white);
	box-shadow: var(--sh-3);
}
.cps-tpl-spoke .mid-cta__text {
	font-size: var(--text-md); font-weight: 700; line-height: 1.3;
	letter-spacing: -.02em; color: var(--white);
	flex: 1 1 280px;
}
.cps-tpl-spoke .mid-cta__button {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	flex: none;
	font-weight: 700; font-size: var(--text-sm); letter-spacing: -.005em;
	padding: 14px 26px; border-radius: var(--r-pill);
	background: var(--green); color: var(--ink);
	text-decoration: none;
	transition: background .15s ease, transform .15s ease;
}
.cps-tpl-spoke .mid-cta__button:hover { background: var(--green-hover); }
.cps-tpl-spoke .mid-cta__button:active { transform: translateY(1px); }
@media (max-width: 600px) {
	.cps-tpl-spoke .mid-cta { padding: 24px; }
	.cps-tpl-spoke .mid-cta__button { width: 100%; }
}

/* ----------------------- CTA final (.cta) ------------------------------ */
.cps-tpl-spoke .cta {
	max-width: var(--measure);
	margin: 48px auto 0;
	padding: 40px 32px;
	text-align: center;
	background: var(--green-soft);
	border: 1px solid var(--green-18);
	border-radius: var(--r-xl);
}
.cps-tpl-spoke .cta__button {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font-weight: 800; font-size: var(--text-base); letter-spacing: -.01em;
	padding: 16px 32px; border-radius: var(--r-pill);
	background: var(--ink); color: var(--white);
	text-decoration: none;
	transition: background .15s ease, transform .15s ease;
}
.cps-tpl-spoke .cta__button:hover { background: var(--ink-2); transform: translateY(-2px); }
.cps-tpl-spoke .cta__button:active { transform: translateY(0); }

/* ----------------------- TOC móvil (mtoc) ------------------------------ */
/* El shortcode [mtoc_mobile] del 7401 inyecta su propio markup; le damos un
   marco coherente sin imponer estructura interna. */
.cps-tpl-spoke .mtoc,
.cps-tpl-spoke .mtoc-mobile {
	margin: 24px 0;
	padding: 18px 20px;
	background: var(--tint-2);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	font-size: var(--text-sm);
}

/* Utilidad accesible (paridad con máquina/silo). */
.cps-tpl-spoke .screen-reader-text {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
