html, body, .leaflet-container {
  font: 14px/1.2 'din-2014', sans-serif;
  color: #333;
}
body {
  margin: 0;
}
h1, h2, h3, p {
  margin: 0 0 0.5rem;
}
svg {
  shape-rendering: geometricPrecision;
}
a {
  color: inherit;
}
#factors {
  padding: 1rem;
  box-sizing: border-box;
}
#factors h1 {
  font-size: 2em;
  line-height: 1;
}
#factors p {
  max-width: 60em;
  font-size: 1.2em;
  color: #666;
}
#factors .help {
  color: #999;
  text-transform: uppercase;
  font-size: 0.9em;
}

#factors .environmental {
  color: #706db8;
}

#factors .socioeconomic {
  color: #ce6340;
}

.select {
  display: inline-block;
  line-height: 1.2;
}
.select select {
  font: inherit;
  font-size: .9em;
  text-transform: uppercase;
  background: #f9f7f6 url(../images/dd.svg) no-repeat right center;
  background-size: 0.8em;
  padding: 0 1.7rem 0 .2rem;
  border: 1px solid #e8e8e8;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.select.environmental select {
  color: #706db8;
}
.select.socioeconomic select {
  color: #ce6340;
}

.viz {
  position: absolute;
  top: 15rem;
  left: 0;
  bottom: 0;
  right: 0;
}
#map {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 1;
}
#sidebar {
  width: 20rem;
  background: white;
  padding: 1rem;
  box-sizing: border-box;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
}
#sidebar .hover {
  display: none;
}
#sidebar.active .hover {
  display: block;
}
#sidebar.active .help {
  display: none;
}
.heading {
  position: relative;
  line-height: 1;
  height: 3rem;
}
.heading h2 {
  font-size: 1.5em;
  line-height: 1.5;
}
.county {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 1em;
}
.tract {
  position: absolute;
  top: 1rem;
  right: 0;
  font-size: 0.75em;
}
.population h3,
.population span {
  width: 49%;
  display: inline-block;
}
.population span {
  text-align: right;
}
.legend {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
.colors {
  width: 6rem;
  line-height: 0;
  border: 1px solid #eee;
  margin: 0 auto;
  z-index: 1;
  position: relative;
}
.color {
  display: inline-block;
  width: 2rem;
  height: 2rem;
}
.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1px solid #333;
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.8);
  transition: all .2s ease-in-out;
  display: none;
}
#sidebar.active .dot {
  display: block;
}
.axis {
  clear: both;
  line-height: 2;
  height: 1rem;
  width: 6rem;
  font-size: .75em;
  background: url(../images/arrow.svg) no-repeat -0.8rem 0.2rem;
}
.axis .low {
  float: left;
  background: white;
  padding-right: 0.2rem;
}
.axis .high {
  float: right;
}
.x.axis {
  margin: 0 auto;
}
.y.axis {
  position: absolute;
  left: 50%;
  top: 0;
  transform: rotate(-90deg) translate(-5.5rem, -4rem);
  transform-origin: 0;
}
.factor {
  font-weight: bold;
  font-size: .75em;
}
.factor.environmental {
  width: 4rem;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}
.factor.environmental > .value {
  color: #706db8;
  position: absolute;
  left: 0;
  bottom: 100%;
}
.factor.socioeconomic {
  position: relative;
  width: 6rem;
  text-align: left;
  margin: .5rem auto;
}
.factor.socioeconomic > .value {
  color: #ce6340;
  position: absolute;
  left: 0;
  top: 100%;
  width: 6rem;
}
.factor > .value {
  display: none;
}
#sidebar.active .factor > .value {
  display: block;
}
.no-data {
  position: absolute;
  top: 0;
  right: 0;
  text-align: right;
  font-size: 0.75em;
  width: 5rem;
}
.no-data > .color {
  width: 1rem;
  height: 1rem;
  background-color: #999;
  vertical-align: middle;
}
.no-data > span {
  display: inline-block;
}
.ethnic-comp-bar {
  white-space: nowrap;
  margin-bottom: 2rem;
}
.ethnic-comp-bar div {
  display: inline-block;
  height: 1rem;
  transition: width 0.2s ease-in-out;
  vertical-align: top;
  position: relative;
}
.ethnic-comp-bar .percentage {
  color: white;
  font-size: .75em;
  padding: .2rem;
}
.ethnic-comp-bar .cat {
  color: gray;
  font-size: .75em;
  white-space: normal;
  line-height: 1;
  position: absolute;
  top: 1.2rem;
  left: .2rem;
}
#logo {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 3;
}
@media (max-width: 800px) {
  #sidebar {
    position: relative;
    top: 100%;
    margin: 1rem auto;
  }
}
@media (max-width: 720px) {
  #factors h1 { font-size: 1.6em; }
  #factors p { font-size: 1em; }
}
@media (max-width: 420px) {
  #factors h1 { font-size: 1.28em; }
}
