/* CNI - Bloque «Conecta con CNI» y fichas de redes (compartido por la portada y /contacto/).
   Autocontenido: usa solo tokens del CNI Design System, con prefijo cx-.
   Logos: assets/img/redes-logos.svg (Simple Icons 13.21.0, CC0, trazados sin modificar).
   Regla: el logo de cada plataforma se pinta con su color oficial de marca y NO se reinterpreta;
   lo único «CNI» es el contenedor (ficha, borde, tipografía, espaciado). */

.cx {
  --cx-bg: #2A0C19; --cx-raised: #3A1424; --cx-sunken: #1E0811; --cx-line: #5A2A3C;
  --cx-ink: #FBF6EC; --cx-muted: #D9C9B8; --cx-orange: #E6CFA2; --cx-orange-deep: #F2E2BC;
  --cx-gold: #E6CFA2; --cx-blue: #B98396; --cx-wa: #25d366; --cx-on: #2A0C19; --cx-focus: #E6CFA2;
  --cx-display: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --cx-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --cx-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --cx-panal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23ff6600' stroke-opacity='.1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%23ff6600' stroke-opacity='.1'/%3E%3C/svg%3E");
}
.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx :focus-visible { outline: 3px solid var(--cx-focus); outline-offset: 3px; }
.cx .cx-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Botones ---------- */
.cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 14px 26px;
  border-radius: 12px; border: 2px solid transparent; font: 700 1rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  text-align: center; text-decoration: none; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, transform 0.16s var(--cx-ease); }
.cx-btn:active { transform: scale(0.97); }
.cx-btn svg { flex: none; width: 22px; height: 22px; }
.cx-btn--wa { background: var(--cx-wa); color: var(--cx-on); }
.cx-btn--wa:hover { box-shadow: inset 0 0 0 3px var(--cx-on); }
.cx-btn--primary { background: var(--cx-orange); color: var(--cx-on); box-shadow: 0 8px 24px rgba(230,207,162, 0.35); }
.cx-btn--primary:hover { background: var(--cx-orange-deep); }
.cx-btn--ghost { background: transparent; color: var(--cx-ink); border-color: var(--cx-ink); }
.cx-btn--ghost:hover { background: #4A1326; border-color: var(--cx-orange); }

/* ---------- Ficha de red: logo oficial + nombre + usuario ---------- */
.cx-tiles { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.cx-tiles > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cx-tile { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  min-height: 88px; padding: 16px 18px; background: var(--cx-raised); border: 1px solid var(--cx-line); border-radius: 16px;
  color: var(--cx-ink); text-decoration: none; transition: border-color 0.2s ease, transform 0.16s var(--cx-ease); }
.cx-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.25s ease;
  background: radial-gradient(240px circle at 12% 50%, rgba(230,207,162, 0.14), transparent 70%); }
.cx-tile:active { transform: scale(0.985); }
.cx-name { display: block; font-family: var(--cx-display); font-weight: 700; font-size: 1.15rem; line-height: 1.2; color: var(--cx-ink); }
.cx-user { display: block; margin-top: 3px; font-family: var(--cx-mono); font-weight: 700; font-size: 0.78rem; line-height: 1.3; color: var(--cx-muted); overflow-wrap: anywhere; }
.cx-go { width: 22px; height: 22px; color: var(--cx-orange); transition: transform 0.25s var(--cx-ease); }

/* Logo: la marca va con su color oficial. Los trazados salen en blanco sobre el color de la plataforma
   (versión inversa que cada plataforma publica en sus guías), sin redibujarlos. */
.cx-logo { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 12px; color: #fff; border: 1px solid rgba(255, 255, 255, 0.16); transition: transform 0.25s var(--cx-ease); }
.cx-logo svg { width: 28px; height: 28px; fill: currentColor; }
.cx-logo--facebook { background: #0866ff; }
.cx-logo--instagram { background: #ff0069; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.cx-logo--tiktok { background: #000; }
.cx-logo--youtube { background: #ff0000; }
.cx-logo--linkedin { background: #0a66c2; }
.cx-logo--x { background: #000; }
.cx-logo--telegram { background: #26a5e4; }
.cx-logo--pinterest { background: #e60023; }
.cx-logo--whatsapp { background: #25d366; }

@media (hover: hover) and (pointer: fine) {
  .cx-tile:hover { border-color: rgba(230,207,162, 0.55); }
  .cx-tile:hover::before { opacity: 1; }
  .cx-tile:hover .cx-go { transform: translate(3px, -3px); }
  .cx-tile:hover .cx-logo { transform: scale(1.05); }
}

/* ---------- Bloque de la portada ---------- */
.cx-section { position: relative; isolation: isolate; overflow: hidden; padding: 112px 0;
  background: radial-gradient(60% 80% at 88% 8%, rgba(230,207,162, 0.14), transparent 62%), radial-gradient(50% 60% at 0% 100%, rgba(185,131,150, 0.12), transparent 66%), var(--cx-bg);
  border-top: 1px solid var(--cx-line); }
.cx-section::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--cx-panal); background-size: 70px 125px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 80% 30%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 70% 80% at 80% 30%, #000 10%, transparent 75%); }
.cx-wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.cx-grid { display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); gap: clamp(36px, 6vw, 88px); align-items: center; }
.cx-title { font-family: var(--cx-display); font-weight: 800; font-size: clamp(2.3rem, 4.8vw, 3.7rem); line-height: 1.03; letter-spacing: -0.02em; color: var(--cx-ink); text-wrap: balance; margin: 0; }
.cx-title::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 2px; background: var(--cx-orange); margin-top: 22px; }
.cx-strong { margin: 26px 0 0; font-family: var(--cx-display); font-weight: 700; font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.3; color: var(--cx-ink); text-wrap: balance; }
.cx-lead { margin: 14px 0 0; font-size: 1.08rem; line-height: 1.65; color: var(--cx-muted); max-width: 46ch; }
.cx-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

@media (max-width: 960px) {
  .cx-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .cx-section { padding: 80px 0; }
}
@media (max-width: 560px) {
  .cx-section { padding: 64px 0; }
  .cx-tiles { grid-template-columns: minmax(0, 1fr); }
  .cx-cta { flex-direction: column; }
  .cx-cta .cx-btn { width: 100%; }
  .cx-tile { min-height: 84px; padding: 14px 16px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-btn, .cx-tile, .cx-logo, .cx-go, .cx-tile::before { transition: none; }
  .cx-btn:active, .cx-tile:active { transform: none; }
}
