/* colors */
.bggray { color: #e8edf2; }
.yellow { color: #fac229; }
.dark-yellow { color: #e3801f; }
.red { color: #f54f4f; }
.dark-red { color: #a62633; }
.blue { color: #73abf2; }
.dark-blue { color: #323b93; }
.darker-blue { color: #334e4a; }

/* candidate colors */
.markey, .c1, .c1p { color:#9ecae1;}
.kennedy, .c2, .c2p { color:#3182bd;}
.twn.markey, .c1 {fill: #9ecae1; }
.twn.kennedy, .c2 {fill: #3182bd; }
.twn.tied { fill: #6d4b8a; }
.tied {color: #6d4b8a; }
.tied span { display: inline-block; width: 12px; height: 12px; background-color: #6d4b8a; }

.markey .cand-bar { background-color:#9ecae1; }
.kennedy .cand-bar { background-color:#3182bd; }

.graphic {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  font-size: 18px;
  font-family: 'metric', sans-serif;
  position: relative;
}
.wrap-head {
  padding:0 30px;
  margin:0 auto;
  max-width:760px;
}
.graphic-headline {
  margin-bottom: 8px;
}
.graphic-description {
  margin-bottom: 10px;
  line-height: 1.1;
}
.graphic-content {
  position:relative;
  display:flex;
  flex-flow:column;
}
.back {
  text-decoration: none;
  font-size:16px;
}
.footer {
  border-top:1px solid #ececed;
  display:flex;
  flex-direction:column;
  flex-wrap:nowrap;
  justify-content:space-between;
  align-content:space-between;
  font-size: 15px;
  color: #999fa5;
  line-height: 1;
  padding:5px 0;
  margin:10px auto 0 auto;
  max-width:700px;
}

.refresh {
  display:inline-block;
  margin:0 0 0 10px;
}

.refresh svg {
  fill:#999fa5;
  height:10px;
  width:10px;
}

.note {
  order:1;
}
.credit {
  order:2;
}

.graphic-content .infobox p.info-precinctsreporting {
  color: #999fa5;
  margin-bottom: 10px;
  font-size:16px;
}
* {
  box-sizing: border-box;
}

#show-state-total {
  cursor:pointer;
}

.infobox-wrap {
  z-index:200;
  order:2;
}

.infobox {
  padding:0 30px;
  margin:0 auto;
  max-width:500px;
}

.info-town-wrap {
  display:flex;
  flex-direction:row;
  align-items:center;
}

.info-town-clear {
  margin:0 0 0 10px;
  cursor:pointer;
  text-transform: uppercase;
  font-size:14px;
  color:#a62633;
}

/* responsive svg */
.map {
  z-index:100;
  order:1;
  margin: 0 auto;
  height: 0;
  width: 100%;
  overflow: hidden;
  padding-bottom: 62%;
  padding-top: 0;
  position: relative;
}
.map svg {
  height: 100%;
  position: absolute;
  top: 0;
  width: 100%;
  left: 0;
  max-width: 100%;
  background-color: transparent;
  z-index: 101;
}
.map svg path {
  z-index:150;
}

.twn {
  transition: fill .25s ease;
  fill: #eee;
  stroke: #000;
  stroke-width: 0.5;
  cursor: pointer;
  display: block;
}
.twn:hover,
.twn:focus {
  stroke: #000;
  stroke-width:3px;
  outline: none;
}

#tooltip {
  visibility: hidden;
  position: absolute;
  top: 400px;
  left: 300px;
  z-index: 100000;
  pointer-events: none;
  background: #fff;
  border-radius: 3px;
  font-size: 16px;
  padding: 1px 5px;
  box-shadow: 1px 1px 2px 1px #ccc;
}
#tooltip:after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 18px;
	width: 0;
	height: 0;
	border: 10px solid transparent;
	border-top-color: #fff;
	border-bottom: 0;
	border-right: 0;
	margin-left: -6.5px;
	margin-bottom: -9px;
}

.graphic-content .infobox h3 {
  margin-bottom: 0;
}

table caption {
  font-size: 14px;
  text-align: left;
  padding-bottom: 5px;
}

.cand-head {
  width:40px;
}
.cand-votes {
  font-size: 15px;
}
.win-badge {
  display: inline-block;
  width: 18px;
  margin-left: 5px;
  fill: #a62633;
}
.cand-bar {
  display: inline-block;
  height: 12px;
  margin-right: 5px;
}

@media (min-width: 560px) {

  .graphic-content {
    flex-direction: column;
    padding:0 0 50px 0;
  }

  .footer {
    flex-flow:row;
  }

  .infobox-wrap {
    position:absolute;
    bottom:20px;

  }

  #leaderboard {
    display: flex;
    flex-direction: column;
    max-height: 160px;
    flex-wrap: wrap;
  }
  #leaderboard .candidate {
    width: 50%;
  }
}

@media (min-width: 690px) {
  #leaderboard {
    max-height: 110px;
  }
  #leaderboard .candidate {
    width: 33%;
  }
}


@media (min-width: 800px) {
  .infobox-wrap {
    margin: 0 0 0 40px;
  }
}

@media (min-width: 850px) {
  .infobox-wrap {
    margin: 0 0 0 60px;
  }
}

@media (min-width: 900px) {
  .infobox-wrap {
    margin: 0 0 0 80px;
  }
}

@media (min-width: 950px) {
  .infobox-wrap {
    margin: 0 0 0 100px;
  }
}

@media (min-width: 970px) {
  #leaderboard {
    width: 600px;
    max-height: 160px;
  }
  #leaderboard .candidate {
    width: 50%;
  }

}

.graphic-content .infobox ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.graphic-content .infobox ul li {
  line-height: 1.2;
  white-space: nowrap;
  clear: left;
}
.graphic-content .infobox .cand-head {
  float: left;
  display: block;
  margin: 0 10px 10px 0;
}

.graphic-content .infobox .cand-results{
  white-space: nowrap;
  padding: 0 0 0.5em 0;
}
.graphic-content .infobox p {
  clear: left;
  margin: 0;
}

.button--small {
  margin: 3px 0 20px;
}
