/* =============================================
   LEADERS MAP OF UZBEKISTAN (home page)
   ============================================= */
.region-map-section {
  padding: 72px 0 80px;
  position: relative;
}

.region-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.region-map-canvas {
  position: relative;
  padding: 18px 18px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 70% 40%, rgba(0, 166, 235, 0.10), transparent 60%),
    rgba(6, 12, 26, 0.82);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.region-map-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* One colour per activity level, shared by the map, its legend and the region list. */
.level-1 { --region-fill: #173a63; }
.level-2 { --region-fill: #1a5d97; }
.level-3 { --region-fill: #1787cc; }
.level-4 { --region-fill: #45c3f5; }

.region-shape path {
  fill: var(--region-fill);
  stroke: rgba(160, 210, 255, 0.4);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 700ms ease, opacity 700ms ease, filter 200ms ease, stroke 200ms ease;
  transition-delay: 0ms, 0ms, 0ms, 0ms;
}

.region-shape { cursor: default; outline: none; }

/* Lighting up: page-features.js dims the map, then lights it west to east on scroll. */
.region-map-section.is-waiting .region-shape path { fill: #0f1a30; opacity: 0.45; }
.region-map-section.is-lit .region-shape path {
  transition-delay: calc(var(--sweep) * 90ms), calc(var(--sweep) * 90ms), 0ms, 0ms;
}

.region-map-halo path { fill: var(--region-fill); opacity: 0; }
.region-map-section.is-lit .region-map-halo path {
  animation: region-halo 4.2s ease-in-out 1.4s infinite alternate;
}

@keyframes region-halo {
  from { opacity: 0.12; }
  to { opacity: 0.55; }
}

.region-map-section.is-waiting .region-rank-row { opacity: 0; transform: translateY(8px); }
.region-map-section.is-lit .region-rank-row {
  transition: opacity 500ms ease, transform 500ms ease, background 160ms ease;
  transition-delay: calc(var(--row) * 55ms), calc(var(--row) * 55ms), 0ms;
}

/* Hover keeps the region's own colour so the level stays readable. */
.region-shape:hover path,
.region-shape:focus-visible path,
.region-shape.is-active path {
  filter: brightness(1.3);
  stroke: var(--accent-gold);
  stroke-width: 2.2;
}

.region-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--region-fill);
  box-shadow: inset 0 0 0 1px rgba(160, 210, 255, 0.35);
}

.region-map-legend {
  list-style: none;
  margin: 12px 4px 2px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.region-map-legend li { display: inline-flex; align-items: center; gap: 7px; }

.region-map-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 170px;
  padding: 10px 14px;
  border: 1px solid rgba(125, 216, 255, 0.45);
  border-radius: 12px;
  background: rgba(5, 12, 24, 0.94);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.region-map-tooltip strong { display: block; font-size: 1rem; }
.region-map-tooltip span { color: #7dd8ff; font-weight: 600; }
.region-map-tooltip em { display: block; color: var(--accent-gold); font-style: normal; font-weight: 600; }

.region-map-panel {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: rgba(8, 16, 33, 0.82);
}

.region-map-panel-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.region-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.region-rank-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: default;
  transition: background 160ms ease;
}

.region-rank-row:hover,
.region-rank-row:focus-visible,
.region-rank-row.is-active {
  background: rgba(0, 166, 235, 0.14);
  color: #fff;
  outline: none;
}

.region-rank-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-rank-level {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  white-space: nowrap;
}

.region-rank-row.is-active .region-rank-level,
.region-rank-row:hover .region-rank-level { color: #7dd8ff; }

@media (max-width: 900px) {
  .region-map-layout { grid-template-columns: 1fr; }
  .region-map-canvas { padding: 10px 8px 8px; border-radius: 18px; }
}

@media (max-width: 520px) {
  .region-map-section { padding: 56px 0 64px; }
  .region-map-panel { padding: 16px; }
  .region-map-legend { gap: 6px 12px; font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .region-shape path, .region-rank-row { transition: none !important; }
  .region-map-section.is-lit .region-map-halo path { animation: none; opacity: 0.35; }
}
