/* The choropleth example's legend, which every version links: page, script, vanilla and React, on
   either map. It sits in Maplace.js's panel on the map, which gives it a background and padding. */
.choropleth-legend {
  display: grid;
  gap: 0.375rem;
  min-width: 11rem;
}

.choropleth-legend-title {
  margin: 0;
  font-weight: 600;
}

.choropleth-classes {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choropleth-classes li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Each class's colour, set from the same table the map's fills come from, at the map's opacity. */
.choropleth-swatch {
  opacity: 0.75;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 0.125rem;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15);
}

.choropleth-legend select {
  max-width: 11rem;
}

/* On a phone, a smaller legend, so it leaves most of the map in view. */
@media (max-width: 40rem) {
  .choropleth-legend {
    gap: 0.25rem;
    min-width: 0;
    font-size: 0.6875rem;
  }

  .choropleth-swatch {
    width: 0.625rem;
    height: 0.625rem;
  }

  .choropleth-legend select {
    max-width: 8rem;
    font-size: 0.75rem;
  }
}
