/* Hero map of the states served: Osun (home), Ondo and Oyo. It sits straight on the adire backdrop, no card. */

.hero-map {
  margin: 0;
  display: grid;
  gap: var(--sp-3);
  justify-items: center;
  min-width: 0;
}

/* Phones: full content width under the text, capped so it stays a supporting picture. */
.state-map {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
}

.state-map .st {
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.state-map .served {
  fill: var(--map-served-fill);
  stroke: var(--map-line);
  stroke-width: 1.25;
}

.state-map .home {
  fill: var(--map-home-fill);
  stroke: var(--map-home-line);
  stroke-width: 2;
}

/* Sizes are in map units (the viewBox is about 235 wide). Served states share one label style. */
.state-map .lbl {
  text-anchor: middle;
  letter-spacing: 0.14em;
}

.state-map .served-l {
  font: 700 6.4px var(--font-body);
  fill: var(--map-label);
}

.state-map .pin-halo {
  fill: var(--map-halo);
  stroke: var(--map-pin);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.state-map .pin-dot {
  fill: var(--map-pin);
}

/* Ipetu-Ijesha: a gold tag beside the pin. */
.state-map .town-tag rect {
  fill: var(--map-pin);
}

.state-map .town-tag text {
  font: 700 6.6px var(--font-display);
  fill: var(--on-gold);
  text-anchor: middle;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2) var(--sp-4);
  max-width: 18rem; /* wraps to two centred rows on phones instead of running edge to edge */
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--text-soft);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.swatch.home {
  background: var(--map-home-fill);
}

.swatch.served {
  background: var(--map-served-fill);
  box-shadow: inset 0 0 0 1.5px var(--map-line);
}

.swatch.pin {
  border-radius: var(--r-pill);
  background: var(--map-pin);
  box-shadow:
    0 0 0 2px var(--map-halo),
    0 0 0 3px var(--map-pin);
}

/* --bp-md: beside the heading on the right of the hero. */
@media (min-width: 900px) {
  .hero-map {
    justify-items: end;
  }

  .state-map {
    max-width: 480px;
  }

  .legend {
    max-width: none;
  }
}
