/* Mapa de la Red (assets/js/mapa-c.js). Banda de tinta con trama de medio tono.
   Prefijo cm-. Usa los tokens tipográficos de rdn.css. */
.cm {
  --cm-bg: #1D1D1B;
  --cm-bg-2: #282725;
  --cm-fg: #FFFFFF;
  --cm-mute: #BDB6AF;         /* 8.6:1 sobre la tinta */
  --cm-rule: #45423E;
  --cm-red: #DB0632;
  --cm-yellow: #FFC928;
  --cm-ht: #6E685D;
  --cm-d0: #5E5A52; --cm-d1: #8E877A; --cm-d2: #BDB4A3; --cm-d3: #E2D9C7; --cm-d4: #FFF7E6;
  --focus: #FFFFFF;
  container-type: inline-size;
  position: relative;
  background: var(--cm-bg);
  color: var(--cm-fg);
  font-family: var(--font-ui, system-ui, sans-serif);
}
.cm *, .cm *::before, .cm *::after { box-sizing: border-box; }
.cm :focus-visible { outline: 3px solid var(--cm-fg); outline-offset: 3px; }
.cm a { color: var(--cm-fg); }
.cm-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cm-cuerpo { position: relative; display: grid; gap: 20px; }
.cm-lienzo { position: relative; min-width: 0; }
.cm-mapa { position: relative; }
.cm-cargando { margin: 0; padding: 48px 0; color: var(--cm-mute); }
.cm-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.cm-guia { display: none; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.cm-guia line { stroke: var(--cm-fg); stroke-width: 1; stroke-dasharray: 1 3; }
.cm-guia circle { fill: var(--cm-fg); }

/* Estados y trama */
.cm-e { fill: transparent; stroke: #55514A; stroke-width: .6; stroke-linejoin: round; cursor: pointer; transition: stroke 140ms, fill 140ms; }
.cm-ht { fill: var(--cm-ht); }
.cm .cm-mapa .cm-e:hover { stroke: var(--cm-mute); }
.cm .cm-mapa .cm-e.cm-on { stroke: var(--cm-fg); stroke-width: 1.4; fill: rgba(219, 6, 50, .1); }
.cm .cm-mapa .cm-e.cm-sel { stroke: var(--cm-red); stroke-width: 2.2; fill: rgba(219, 6, 50, .22); }
.cm .cm-mapa .cm-e:focus { outline: none; }
.cm .cm-mapa .cm-e:focus-visible { outline: none; stroke: var(--cm-fg); stroke-width: 3; fill: rgba(219, 6, 50, .2); }

/* Puntos: uno por municipio */
.cm-puntos circle { fill: var(--cm-d0); r: 1.15px; }
.cm-g.cm-l1 circle { fill: var(--cm-d1); r: 1.5px; }
.cm-g.cm-l2 circle { fill: var(--cm-d2); r: 1.85px; }
.cm-g.cm-l3 circle { fill: var(--cm-d3); r: 2.2px; }
.cm-g.cm-l4 circle { fill: var(--cm-d4); r: 2.55px; }
.cm-g.cm-on circle, .cm-g.cm-sel circle { fill: var(--cm-red); }
.cm-respira .cm-puntos circle { animation: cm-brota 700ms cubic-bezier(.2, .7, .2, 1) both; }
@keyframes cm-brota { from { opacity: 0; r: 0; } 55% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cm-respira .cm-puntos circle { animation: none; } .cm-e { transition: none; } }
.cm-ret-c { fill: none; stroke: var(--cm-red); stroke-width: 1.8; }
.cm-ret-p { fill: var(--cm-red); }
.cm-ret-t { fill: var(--cm-fg); font: 700 13px var(--font-ui, sans-serif); letter-spacing: .06em; paint-order: stroke; stroke: var(--cm-bg); stroke-width: 4px; }

/* Panel */
.cm-panel { position: relative; z-index: 3; min-width: 0; }
.cm-kicker { margin: 0 0 4px; font: 700 .8125rem/1.2 var(--font-head, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--cm-mute); }
.cm-nombre { margin: 0 0 4px; font: 400 clamp(2.25rem, 1.6rem + 1.6vw, 3.25rem)/.95 var(--font-display, Impact, sans-serif); text-transform: uppercase; color: var(--cm-fg); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cm-n { margin: 0 0 12px; color: var(--cm-mute); font-size: 1rem; }
.cm-n b { color: var(--cm-fg); }
.cm-perfiles { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--cm-rule); }
.cm-perfiles li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--cm-rule); }
.cm-perfiles a { font: 700 1.0625rem/1.2 var(--font-ui, sans-serif); text-decoration: none; }
.cm-perfiles a:hover { text-decoration: underline; }
.cm-meta { grid-column: 1 / -1; font-size: .875rem; color: var(--cm-mute); }
.cm-cal { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cm-tag { display: inline-block; padding: 2px 6px 1px; border: 1.5px solid var(--cm-red); font: 700 .6875rem/1.2 var(--font-ui, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--cm-fg); vertical-align: 1px; }
.cm-tag--tuyo { border-color: var(--cm-yellow); }
.cm-tag--sel { background: var(--cm-red); font-family: var(--font-ui, sans-serif); font-size: .75rem; }
.cm-vacio { margin: 0 0 12px; font: italic 400 1.0625rem/1.45 var(--font-text, Georgia, serif); color: var(--cm-mute); }
.cm-vacio a { color: var(--cm-fg); }
.cm-link { display: inline-flex; align-items: center; min-height: 44px; margin-right: 16px; padding: 0; background: none; border: 0; color: var(--cm-fg); font: 700 .9375rem/1.2 var(--font-head, sans-serif); letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-decoration-color: var(--cm-red); text-decoration-thickness: 2px; text-underline-offset: 5px; cursor: pointer; }
.cm-link::after { content: " →"; white-space: pre; }
.cm-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 14px; }
.cm-leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; padding: 0; list-style: none; font-size: .8125rem; font-weight: 600; color: var(--cm-mute); }
.cm-leyenda li { display: flex; align-items: center; gap: 6px; }
.cm-leyenda i { display: block; border-radius: 50%; }
.cm-l0 { width: 4px; height: 4px; background: var(--cm-d0); }
.cm-l1 { width: 5px; height: 5px; background: var(--cm-d1); }
.cm-l2 { width: 7px; height: 7px; background: var(--cm-d2); }
.cm-l3 { width: 8px; height: 8px; background: var(--cm-d3); }
.cm-l4 { width: 10px; height: 10px; background: var(--cm-d4); }
.cm-btn { min-height: 44px; padding: 0 16px; background: transparent; border: 2px solid var(--cm-fg); color: var(--cm-fg); font: 700 .875rem/1 var(--font-head, sans-serif); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.cm-btn:hover { background: var(--cm-fg); color: var(--cm-bg); }
.cm-nota { margin: 14px 0 0; font-size: .8125rem; line-height: 1.45; color: var(--cm-mute); max-width: 52ch; }

/* Estrellas sobre tinta */
.cm-est { position: relative; display: inline-block; line-height: 0; }
.cm-est-b, .cm-est-v { display: flex; gap: 2px; }
.cm-est svg { width: 14px; height: 14px; flex: none; }
.cm-est-b svg { fill: none; stroke: var(--cm-yellow); stroke-width: 1.3; }
.cm-est-v { position: absolute; inset: 0 auto 0 0; overflow: hidden; }
.cm-est-v svg { fill: var(--cm-yellow); stroke: var(--cm-yellow); stroke-width: 1.3; }
.cm-est-n { font-size: .875rem; }
.cm-sincal { font-size: .8125rem; color: var(--cm-mute); }

/* Lista de estados */
.cm-lista { margin-top: 24px; border-top: 1px solid var(--cm-rule); }
.cm-lista ol { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 32px; }
.cm-lista ol > li { break-inside: avoid; border-bottom: 1px solid var(--cm-rule); }
.cm-fila { display: grid; grid-template-columns: minmax(0, 1fr) auto 1.2ch; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 0; background: none; border: 0; color: var(--cm-fg); text-align: left; font: 700 1.0625rem/1.15 var(--font-ui, sans-serif); cursor: pointer; }
.cm-fila:hover .cm-fn { text-decoration: underline; }
.cm-fc { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--cm-mute); }
.cm-pips { display: inline-flex; gap: 3px; }
.cm-pips i { width: 7px; height: 7px; border-radius: 50%; background: var(--cm-d0); }
.cm-pips i.cm-si { background: var(--cm-fg); }
.cm-fx { font-weight: 800; color: var(--cm-mute); text-align: center; }
.cm-fila[aria-expanded="true"] .cm-fx { color: var(--cm-red); }
.cm-det { padding: 0 0 12px; }
.cm-det .cm-perfiles { border-top: 0; }

/* Panel a un lado cuando hay espacio (portada); debajo en columnas angostas (directorio) */
@container (min-width: 820px) {
  .cm-cuerpo { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 40px; align-items: start; }
  .cm-guia { display: block; }
  .cm-panel { padding-top: 24px; }
}

/* Celular: el mapa se vuelve lista */
@media (max-width: 640px) {
  .cm-lienzo, .cm-btn { display: none !important; }
  .cm-lista[hidden] { display: block !important; }
  .cm-lista { margin-top: 16px; }
  .cm-lista ol { columns: 1; }
}
