/* Atlas Studio V6 — módulos de sociedad y biogeografía (población, demográfico, ecosistemas) */

/* ---------- Mapa: círculos proporcionales ---------- */
.soc-city circle {
  fill: #ff8a4c;
  fill-opacity: .42;
  stroke: rgba(255, 238, 220, .85);
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill-opacity .15s ease, stroke .15s ease;
}
.soc-city.capital circle { fill: #ff6a3d; }
.soc-city:hover circle, .soc-city.hl circle { fill-opacity: .78; stroke: #fff; stroke-width: 1.6; }

.soc-city-labels { pointer-events: none; }
.soc-city-label {
  fill: #fff6ec;
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(6, 15, 24, .92);
  stroke-width: 3px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.soc-city-label .pop { fill: #ffc08f; font-weight: 600; }
.soc-city-label.hl { fill: #fff; }
.soc-city-label.hl .pop { fill: #ffd9a6; }

/* El módulo dibuja sus propias etiquetas con población: se ocultan las del núcleo */
svg.soc-own-labels #placesLayer .place-label { display: none !important; }
svg[data-maptype="population"] #placesLayer .place-halo { fill: rgba(5, 19, 30, .35); }

/* Demográfico: regiones sin dato en gris neutro */
svg[data-maptype="demographic"] path.region:not([fill]) { fill: #46545e; fill-opacity: .55; }

/* ---------- Panel lateral ---------- */
.soc-panel {
  margin-top: 16px;
  padding: 13px 13px 14px;
  border: 1px solid rgba(73, 214, 197, .18);
  border-radius: 13px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(242, 184, 75, .08), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(73, 214, 197, .06), transparent 60%),
    rgba(255, 255, 255, .02);
}
.soc-panel > label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin: 12px 0 7px; }
.soc-head { display: flex; align-items: center; gap: 10px; }
.soc-icon {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  color: var(--gold, #f2b84b);
  background: radial-gradient(circle at 35% 30%, rgba(242, 184, 75, .26), rgba(242, 184, 75, .06) 70%);
  border: 1px solid rgba(242, 184, 75, .3);
}
.soc-icon.leaf { color: #7fdc8a; background: radial-gradient(circle at 35% 30%, rgba(127, 220, 138, .24), rgba(127, 220, 138, .05) 70%); border-color: rgba(127, 220, 138, .3); }
.soc-icon svg { width: 18px; height: 18px; }
.soc-title { display: grid; gap: 1px; min-width: 0; }
.soc-title strong { font-size: 13px; }
.soc-title small { color: var(--muted-2, #617887); font-size: 10.5px; }

.soc-two { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.soc-two label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin: 12px 0 7px; }
.soc-two select:disabled, .soc-panel select:disabled { opacity: .5; cursor: not-allowed; }

.soc-card {
  margin-top: 12px; padding: 10px 11px;
  border: 1px solid var(--line, rgba(157, 190, 205, .14));
  border-radius: 10px;
  background: rgba(0, 0, 0, .16);
  font-size: 11.5px; line-height: 1.5; color: #c7d6dd;
}
.soc-card p { margin: 0 0 7px; }
.soc-card p:last-child { margin-bottom: 0; }
.soc-card b { color: var(--ink); }
.soc-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; margin-bottom: 7px; }
.soc-card-head strong { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); }
.soc-card-head strong svg { width: 14px; height: 14px; color: var(--aqua); }
.soc-card-head small { margin-left: auto; color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.soc-foot { margin: 7px 0 0 !important; color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.soc-empty { margin: 4px 0; color: var(--muted); font-style: italic; }

.soc-help summary {
  display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-weight: 700; color: var(--ink); font-size: 11.5px;
}
.soc-help summary::-webkit-details-marker { display: none; }
.soc-help summary svg { width: 14px; height: 14px; color: var(--gold); }
.soc-help[open] summary { margin-bottom: 7px; }

/* barras horizontales (ranking) */
.soc-rank-chart svg, .soc-top-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.soc-bar { fill: #ff8a4c; }
.soc-top-chart .soc-bar { stroke: rgba(255, 255, 255, .28); stroke-width: .6; }
.soc-bar-hit { fill: transparent; }
.soc-bar-row { cursor: default; outline: none; }
.soc-bar-row.clickable, .soc-rank-chart .soc-bar-row { cursor: pointer; }
.soc-bar-row:hover .soc-bar-hit, .soc-bar-row.hl .soc-bar-hit, .soc-bar-row:focus-visible .soc-bar-hit { fill: rgba(73, 214, 197, .09); }
.soc-bar-row:focus-visible .soc-bar-hit { stroke: var(--aqua); stroke-width: 1; }
.soc-bar-row:hover .soc-bar, .soc-bar-row.hl .soc-bar { filter: brightness(1.18); }
.soc-bar-label { fill: #c9d7de; font: 600 10px "DM Sans", sans-serif; }
.soc-bar-value { fill: var(--gold, #f2b84b); font: 700 9.5px Manrope, sans-serif; }

/* estadísticas */
.soc-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.soc-stat-grid > div { padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .035); display: grid; gap: 1px; min-width: 0; }
.soc-stat-grid span { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.soc-stat-grid strong { color: var(--aqua); font: 800 13px Manrope, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-extreme { display: grid; grid-template-columns: 52px 1fr auto; align-items: baseline; gap: 6px; margin-top: 6px; font-size: 11px; }
.soc-extreme span { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.soc-extreme b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-extreme em { font-style: normal; color: var(--gold); font-weight: 700; }

.soc-view-note, .soc-status {
  display: flex; gap: 7px; align-items: flex-start;
  margin: 10px 0 0; padding: 8px 9px; border-radius: 9px;
  font-size: 11px; line-height: 1.45; color: #f5dca6;
  background: rgba(242, 184, 75, .08); border: 1px solid rgba(242, 184, 75, .22);
}
.soc-view-note[hidden], .soc-status[hidden] { display: none; }
.soc-view-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--gold); }
.soc-status { color: var(--aqua); background: rgba(73, 214, 197, .07); border-color: rgba(73, 214, 197, .2); }

/* ficha de la región seleccionada */
.soc-extra { margin-top: 10px; padding: 9px 10px; border-radius: 9px; background: rgba(73, 214, 197, .05); border: 1px solid rgba(73, 214, 197, .16); }
.soc-extra-title { display: block; margin-bottom: 5px; color: var(--aqua); font: 800 9.5px Manrope, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.soc-extra > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 11.5px; border-bottom: 1px dashed rgba(157, 190, 205, .1); }
.soc-extra > div:last-of-type { border-bottom: 0; }
.soc-extra > div span { color: var(--muted); }
.soc-extra > div b { color: var(--ink); text-align: right; }
.soc-extra small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 9.5px; }

/* ficha emergente */
.tooltip small.soc-tip { color: #c7d6dd; margin-top: 3px; }

/* ecosistemas y NDVI */
.soc-class-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: igbp; }
.soc-class-list li { display: flex; gap: 8px; align-items: flex-start; counter-increment: igbp; }
.soc-class-list li::before { content: counter(igbp); min-width: 14px; color: var(--muted-2); font: 700 9.5px Manrope, sans-serif; text-align: right; padding-top: 2px; }
.soc-class-list i.sw { width: 13px; height: 11px; flex: none; border-radius: 2.5px; margin-top: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.soc-class-list span { display: grid; font-size: 11px; line-height: 1.3; color: var(--ink); }
.soc-class-list small { color: var(--muted-2); font-size: 9.5px; }
.soc-ndvi-bar { height: 11px; margin: 9px 0 3px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); background: linear-gradient(90deg, #e1e1e1, #dfcec2, #965a47, #8fb716, #3e8a01, #005401); }
.soc-ndvi-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 9.5px; margin-bottom: 7px; }
.soc-read { margin: 0 0 7px; padding-left: 16px; }
.soc-read li { margin: 2px 0; }
