/* Iniciativa Nacional: México: Ciudades Modernas y Digitalizadas (/ciudades/)
   Estética editorial y cartográfica propia sobre el sistema de diseño Torsion Local. */

.cw-nav-active {
  color: #6ee7b7 !important;
  font-weight: 700 !important;
}

/* HERO EDITORIAL */
.cw-hero {
  position: relative;
  padding: clamp(56px, 7vw, 96px) 0 clamp(44px, 5vw, 72px);
  background:
    radial-gradient(900px 460px at 82% -10%, rgba(16, 185, 129, 0.16), transparent 65%),
    radial-gradient(760px 420px at 12% 10%, rgba(56, 189, 248, 0.14), transparent 60%),
    var(--bg-dark);
  border-bottom: 1px solid var(--border-dark);
  overflow: hidden;
}
.cw-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.cw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.cw-hero h1 {
  font-size: clamp(2.35rem, 4.9vw, 4.1rem);
  line-height: 1.03;
  color: #fff;
  margin-bottom: 20px;
}
.cw-hero h1 em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: #6ee7b7;
}
.cw-hero-lead {
  font-size: clamp(1.03rem, 1.35vw, 1.22rem);
  color: var(--muted-light);
  max-width: 60ch;
  margin: 0 0 26px;
}
.cw-hero-lead strong { color: #fff; }
.cw-hero-note {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: #94a3b8;
}

/* TARJETA VISUAL / VIDEO DERECHA EN HERO */
.cw-hero-card {
  background: linear-gradient(160deg, rgba(19, 33, 58, 0.92), rgba(7, 13, 25, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.cw-hero-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0b1324;
  overflow: hidden;
}
.cw-hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cw-hero-media-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(7, 13, 25, 0.82);
  border: 1px solid rgba(110, 231, 183, 0.4);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.cw-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(148, 163, 184, 0.16);
}
.cw-stat {
  background: #0d1729;
  padding: 16px 18px;
}
.cw-stat b {
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  color: #fff;
  line-height: 1.1;
}
.cw-stat b.accent { color: #6ee7b7; }
.cw-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.35;
}

/* SECCIONES CLARAS Y OSCURAS */
.cw-sec-light {
  background: var(--bg-light);
  color: var(--ink-dark);
  padding: clamp(54px, 6.5vw, 88px) 0;
}
.cw-sec-white {
  background: #fff;
  color: var(--ink-dark);
  padding: clamp(54px, 6.5vw, 88px) 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.cw-sec-dark {
  background: var(--bg-dark-2);
  color: var(--ink-light);
  padding: clamp(54px, 6.5vw, 88px) 0;
  border-top: 1px solid var(--border-dark);
}

.cw-head {
  max-width: 760px;
  margin-bottom: clamp(28px, 3.6vw, 44px);
}
.cw-head .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wa);
  margin-bottom: 10px;
}
.cw-sec-dark .cw-head .eyebrow { color: #6ee7b7; }
.cw-head h2 {
  font-size: clamp(1.8rem, 3.3vw, 2.75rem);
  margin-bottom: 12px;
}
.cw-head p {
  margin: 0;
  color: var(--muted-dark);
  font-size: 1.04rem;
}
.cw-sec-dark .cw-head p { color: var(--muted-light); }

/* 3 PILARES / 3 CARRILES */
.cw-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.cw-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.cw-card-dark {
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
}
.cw-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--wa);
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.cw-card-dark .cw-num {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}
.cw-card h3, .cw-card-dark h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  line-height: 1.22;
}
.cw-card p {
  margin: 0 0 14px;
  color: var(--muted-dark);
  font-size: 0.96rem;
}
.cw-card-dark p {
  margin: 0 0 14px;
  color: var(--muted-light);
  font-size: 0.95rem;
}
.cw-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 9px;
  font-size: 0.93rem;
}
.cw-list li {
  position: relative;
  padding-left: 20px;
}
.cw-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--emerald);
  font-weight: 800;
}
.cw-card-cta {
  margin-top: auto;
  padding-top: 8px;
}

/* ARQUITECTURA DE CAPAS (SISTEMA OPERATIVO + ALIADOS) */
.cw-stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.cw-stack-item {
  background: rgba(19, 33, 58, 0.72);
  border: 1px solid var(--border-dark);
  border-radius: 16px;
  padding: 20px;
}
.cw-stack-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  margin-bottom: 8px;
}
.cw-stack-item h3 {
  font-size: 1.08rem;
  color: #fff;
  margin-bottom: 8px;
}
.cw-stack-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-light);
}

/* DIRECTORIO INTERACTIVO 20 CIUDADES */
.cw-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.cw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cw-tab {
  appearance: none;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--ink-dark);
  padding: 9px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.cw-tab:hover {
  border-color: var(--wa);
  color: var(--wa);
}
.cw-tab[aria-pressed="true"] {
  background: var(--ink-dark);
  border-color: var(--ink-dark);
  color: #fff;
}
.cw-search {
  min-width: 240px;
  flex: 0 1 300px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--ink-dark);
  font-family: inherit;
  font-size: 0.92rem;
}
.cw-search:focus {
  outline: 2px solid var(--sky);
  border-color: var(--sky);
}
.cw-count-line {
  font-size: 0.9rem;
  color: var(--muted-dark);
  margin: 0 0 18px;
}

/* MAPA TERRITORIAL DE MÉXICO (DISEÑO CARTOGRÁFICO PROPIO TORSION LOCAL) */
.cw-map-stage {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  margin-bottom: 24px;
}
.cw-map-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 22px;
  background: #ffffff;
  border-bottom: 1px solid #e6edf5;
}
.cw-map-bar-title strong {
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: 0.98rem;
  color: var(--ink-dark);
}
.cw-map-bar-title span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted-dark);
}
.cw-map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}
.cw-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.cw-leg-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #0e6f3c;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}
.cw-leg-diamond {
  width: 9px;
  height: 9px;
  background: #0f172a;
  border: 1.5px solid #10b981;
  border-radius: 2px;
  transform: rotate(45deg);
}
.cw-leg-swatch {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: #c7ecd9;
  border: 1px solid #86dfba;
}

.cw-map-canvas {
  position: relative;
  background:
    radial-gradient(circle, rgba(148, 163, 184, 0.26) 1px, transparent 1px),
    linear-gradient(155deg, #f8fbff 0%, #f2f7fa 56%, #ecf5f1 100%);
  background-size: 22px 22px, 100% 100%;
  padding: 12px 16px 14px;
}
.cw-map-svg {
  display: block;
  width: 100%;
  max-height: 560px;
  height: auto;
  user-select: none;
}

/* Estados de México */
.cw-mx-state {
  fill: #e7edf4;
  stroke: #ffffff;
  stroke-width: 1.25;
  stroke-linejoin: round;
  transition: fill 0.18s ease, opacity 0.18s ease;
}
.cw-mx-state.is-covered {
  fill: #c7ecd9;
  cursor: pointer;
}
.cw-mx-state.is-covered:hover {
  fill: #8de0bc;
}
.cw-mx-state.is-base {
  fill: #0e6f3c;
  cursor: pointer;
}
.cw-mx-state.is-selected {
  fill: #059669;
}
.cw-mx-state.is-dimmed {
  fill: #e2e8f0;
  opacity: 0.65;
  cursor: default;
}

/* Arcos territoriales desde Querétaro Base #01 */
.cw-mx-arc {
  fill: none;
  stroke: #0e6f3c;
  stroke-width: 1.15;
  stroke-opacity: 0.18;
  stroke-dasharray: 3.5 4;
  pointer-events: none;
  transition: stroke-opacity 0.2s ease, stroke-width 0.2s ease;
}
.cw-mx-arc.is-selected {
  stroke: #059669;
  stroke-width: 2.2;
  stroke-opacity: 0.85;
  stroke-dasharray: none;
}
.cw-mx-arc.is-dimmed {
  stroke-opacity: 0.03;
}

/* Nodos de precisión Torsion (rombos + faro de Querétaro) */
.cw-mx-node {
  cursor: pointer;
  outline: none;
  transition: opacity 0.18s ease;
}
.cw-mx-node.is-dimmed {
  opacity: 0.22;
  pointer-events: none;
}
.cw-mx-diamond {
  fill: #0f172a;
  stroke: #ffffff;
  stroke-width: 2;
  transition: fill 0.16s ease, transform 0.16s ease;
}
.cw-mx-diamond-core {
  fill: #34d399;
  pointer-events: none;
}
.cw-mx-node:hover .cw-mx-diamond,
.cw-mx-node:focus-visible .cw-mx-diamond,
.cw-mx-node.is-selected .cw-mx-diamond {
  fill: #059669;
}
.cw-mx-ring-selected {
  fill: none;
  stroke: #059669;
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.cw-mx-node.is-selected .cw-mx-ring-selected,
.cw-mx-node:hover .cw-mx-ring-selected {
  opacity: 0.9;
}

/* Faro pulsante de Querétaro Base #01 */
.cw-mx-base-core {
  fill: #0e6f3c;
  stroke: #ffffff;
  stroke-width: 2.6;
}
.cw-mx-base-pulse {
  fill: none;
  stroke: #10b981;
  stroke-width: 2.2;
  transform-box: fill-box;
  transform-origin: center;
  animation: cwBeacon 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes cwBeacon {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(2.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cw-mx-base-pulse { animation: none; opacity: 0.45; }
}

/* Etiqueta flotante del nodo activo en el SVG */
.cw-mx-callout rect {
  fill: #0f172a;
  stroke: rgba(110, 231, 183, 0.55);
  stroke-width: 1;
}
.cw-mx-callout text {
  fill: #ffffff;
  font-family: "Archivo", "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

/* Ficha flotante sobre el Océano Pacífico (izquierda abajo en escritorio) */
.cw-map-spotlight {
  position: absolute;
  left: 22px;
  bottom: 22px;
  width: min(330px, 36%);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid #d4e3dc;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}
.cw-spot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cw-spot-region {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
}
.cw-map-spotlight h3 {
  font-size: 1.2rem;
  color: var(--ink-dark);
  margin: 0 0 2px;
}
.cw-spot-state {
  display: block;
  font-size: 0.82rem;
  color: var(--muted-dark);
  margin-bottom: 8px;
}
.cw-map-spotlight p {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.48;
}
.cw-spot-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #0e6f3c;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
}
.cw-spot-link:hover { text-decoration: underline; }

.cw-cities-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.cw-city-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.cw-city-card:hover {
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}
.cw-city-card.is-active {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.12);
}
.cw-city-card.is-selected {
  border-color: #0e6f3c;
  box-shadow: 0 0 0 2px rgba(14, 111, 60, 0.18), 0 12px 28px rgba(15, 23, 42, 0.08);
}
.cw-city-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cw-city-title h3 {
  font-size: 1.15rem;
  color: var(--ink-dark);
}
.cw-city-title span {
  display: block;
  font-size: 0.83rem;
  color: var(--muted-dark);
  margin-top: 2px;
}
.cw-ola-badge {
  flex: none;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.cw-ola-activa { background: #d1fae5; color: #065f46; }
.cw-ola-ola1 { background: #e0f2fe; color: #075985; }
.cw-ola-ola2 { background: #fef3c7; color: #92400e; }
.cw-ola-ola3 { background: #ede9fe; color: #5b21b6; }
.cw-ola-ola4 { background: #f1f5f9; color: #334155; }

.cw-city-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
}
.cw-city-kpis div b {
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: 0.98rem;
  color: var(--ink-dark);
}
.cw-city-kpis div b.gap { color: #b45309; }
.cw-city-kpis div span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted-dark);
}
.cw-city-meta {
  font-size: 0.84rem;
  color: var(--muted-dark);
  display: grid;
  gap: 6px;
}
.cw-city-meta strong { color: var(--ink-dark); }
.cw-city-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: #475569;
}

/* TABLA ESCALA GLOBAL */
.cw-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-dark);
  border-radius: 18px;
  background: rgba(13, 23, 41, 0.85);
}
.cw-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 0.92rem;
}
.cw-table th, .cw-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-dark);
}
.cw-table th {
  font-family: "Archivo", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  background: rgba(7, 13, 25, 0.7);
}
.cw-table tr:last-child td { border-bottom: none; }
.cw-table tr.is-total td {
  font-weight: 800;
  color: #fff;
  background: rgba(16, 185, 129, 0.12);
}
.cw-gap-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  font-weight: 700;
  font-size: 0.84rem;
}

/* BLOQUE DE TRANSPARENCIA Y ZERO-PII */
.cw-trust-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.cw-trust-item {
  background: rgba(19, 33, 58, 0.6);
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 18px;
}
.cw-trust-item b {
  display: block;
  color: #6ee7b7;
  margin-bottom: 6px;
  font-size: 0.96rem;
}
.cw-trust-item p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted-light);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .cw-hero-grid { grid-template-columns: 1fr; }
  .cw-grid-3, .cw-cities-grid, .cw-trust-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cw-stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .cw-map-spotlight {
    position: static;
    width: 100%;
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
  }
}
@media (max-width: 680px) {
  .cw-grid-3, .cw-cities-grid, .cw-stack-grid, .cw-trust-bar { grid-template-columns: 1fr; }
  .cw-search { width: 100%; flex: 1 1 100%; }
  .cw-map-bar { padding: 14px 16px; }
  .cw-map-canvas { padding: 10px 10px 14px; }
}
