:root {
  /* Matching leaflet styles */
  --color--body: rgb(51, 51, 51);
  --color--link: rgb(0, 120, 168);
  --font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;

  --color--district: rgba(0, 0, 0, 0.2);
  --color--district--active: rgba(0, 0, 0, 0.4);

  /* https://colorbrewer2.org/#type=qualitative&scheme=Dark2&n=3 */
  --color--sponsor: rgba(27, 158, 119, 0.6);
  --color--sponsor--active: rgba(27, 158, 119, 0.9);
  --color--committee: rgba(117, 112, 179, 0.6);
  --color--committee--active: rgba(117, 112, 179, 0.9);
  --color--sponsor-committee: rgba(217, 95, 2, 0.6);
  --color--sponsor-committee--active: rgba(217, 95, 2, 0.9);
}

body {
  color: var(--color--body);
  font-family: var(--font-family);
  margin: 1rem;
}

a {
  color: var(--color--link);
}

a[aria-current="page"] {
  color: var(--color--body);
  text-decoration: none;
}

.legend {
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 0 0.5rem;
}

.legend__item {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
}

.legend__item::before {
  background: var(--color--district);
  border-radius: 2px;
  content: '';
  display: block;
  margin-right: 0.5rem;
  height: 1rem;
  width: 1rem;
}

.legend__item--sponsor::before {
  background: var(--color--sponsor);
}

.legend__item--committee::before {
  background: var(--color--committee);
}

.legend__item--sponsor-committee::before {
  background: var(--color--sponsor-committee);
}

.district {
  fill: var(--color--district);
  fill-opacity: 1;
  stroke: var(--color--district);
  stroke-width: 1;
}

.district:hover {
  stroke-width: 4;
}

.district--active {
  fill: var(--color--district--active);
}

.district--sponsor {
  fill: var(--color--sponsor);
}

.district--sponsor.district--active {
  fill: var(--color--sponsor--active);
}

.district--committee {
  fill: var(--color--committee);
}

.district--committee.district--active {
  fill: var(--color--committee--active);
}

.district--sponsor.district--committee {
  fill: var(--color--sponsor-committee);
}

.district--sponsor.district--committee.district--active {
  fill: var(--color--sponsor-committee--active);
}

.leaflet-control-search .search-input {
  outline: none;
  width: 15rem;
}

.leaflet-control-search .search-tooltip {
  margin: 2px 0 0;
  width: 100%;
  border-radius: 4px;
}

.leaflet-control-search .search-tip {
  margin: 0;
  border-radius: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  font: inherit;
  width: 100%;
}

th,
td {
  text-align: left;
  vertical-align: baseline;
  white-space: nowrap;
}

details {
  margin: 1em 0;
}

/* Center the map with a constrained width and a responsive 64% aspect ratio (same as Massachusetts) */
/* https://css-tricks.com/aspect-ratio-boxes/ */

body > * {
  margin: 1rem auto;
  max-width: 800px;
}

.map-container {
  position: relative;
  overflow: hidden;
  padding-top: 64%;
}

.map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
