html {
  font-size: 10px;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-size: 16px;
  background: #f7f7f2;
  color: #333;
  font-family: "Calibri", arial, sans-serif;
}
@media screen and (max-width: 767px) {
  body {
    font-size: 1.4rem;
  }
}

/* Generic Element Styles */
a {
  text-decoration: none;
  color: #365d98;
}
a:hover, a:active {
  color: #7592bd;
}

a.external:after,
.external a:after {
  content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);
}

/* Top-Level Layout */
#canvas {
  display: grid;
  column-gap: 0;
  row-gap: 0;
  grid-template-columns: 320px auto;
  height: 100%;
}
@media screen and (max-width: 767px) {
  #canvas {
    display: block;
    grid-template-columns: auto 40vh;
  }
}

#controlsContainer {
  position: relative;
  grid-column-start: 1;
  grid-column-end: 2;
  z-index: 100;
}

#mapContainer {
  position: relative;
  grid-column-start: 2;
  grid-column-end: 3;
  overflow: hidden;
}
#mapContainer #map {
  width: 100%;
  height: 100%;
}

/*  Generic Classes */
.screenreader-only {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* transitions */
.tstandard {
  -webkit-transition: all 300ms ease-in-out;
  transition: all 300ms ease-in-out;
}

.tlong {
  -webkit-transition: all 600ms ease-in-out;
  transition: all 600ms ease-in-out;
}

/* control box container */
#controlsContainer {
  box-shadow: 3px 0px 5px -2px #555;
  overflow-y: auto;
}

/* Jurisdiction Toggle Button Bar */
.button-bar {
  display: flex;
  border: 2px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-left: 8px;
  margin-right: 8px;
  margin-top: 12px;
}
.button-bar .button {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: #fff;
  color: #333;
  cursor: auto;
  font-size: 1em;
  text-transform: uppercase;
  transition: background-color 0.3s, color 0.3s;
}
.button-bar .button.active {
  background-color: #f05c2d;
  color: #fff;
}
.button-bar .button:not(.active) {
  cursor: pointer;
}
.button-bar .button:not(.active):hover {
  background-color: #ddd;
  /* TODO: make this a little more interesting */
}

/* House Level (map data layer) Selector Buttons */
#layerControls {
  width: 90%;
  margin: 0 auto;
  background: #f7f7f2;
}
#layerControls .layer-controls-label {
  margin-top: 1.2rem;
  font-weight: 700;
  padding-bottom: 4px;
  text-align: center;
}
#layerControls #layersList {
  display: flex;
  flex-wrap: wrap;
}
#layerControls #layersList .layer-toggle-item {
  text-align: center;
  width: 50%;
  margin: 12px 0;
}
#layerControls .btnLayerToggle {
  text-align: center;
  border: 1px solid #999;
  background-color: #fff;
  box-shadow: 0 3px 5px -2px;
  font-size: 1.2rem;
  color: #333;
  padding: 8px 16px;
  border-radius: 100px;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}
#layerControls .btnLayerToggle.active {
  background-color: #f05c2d;
  border-color: #333;
  color: #fff;
  box-shadow: 0 3px 5px -2px #333;
}
#layerControls .btnLayerToggle.active:hover {
  cursor: default;
}
#layerControls .btnLayerToggle:not(.active):hover {
  background: #ddd;
  color: #333;
}

/* Bill Selection Menu */
.bills-list-container {
  margin-top: 1.6rem;
}
.bills-list-container .bills-list-label {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  text-align: center;
}
.bills-list-container .bills-list-caption {
  color: #8d8293;
  font-size: 1.2rem;
  font-weight: 400;
  text-align: center;
  padding-bottom: 0.6rem;
  margin: 0;
}

#billsList {
  list-style-type: none;
  padding-left: 0;
  margin-top: 0;
}
#billsList .billCategoryLabel,
#billsList .bill-label {
  all: unset;
  cursor: pointer;
}
#billsList .billCategoryList {
  border-top: 2px solid #a9bbd6;
}
#billsList .billCategoryList:last-child {
  border-bottom: 2px solid #a9bbd6;
}
#billsList .billCategoryList .billCategoryLabel {
  padding: 6px;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 300ms;
}
#billsList .billCategoryList .billCategoryLabel:hover {
  background: #dde4ef;
  color: inherit;
}
#billsList .billCategoryList .billCategoryLabel > span {
  margin-left: 10px;
}
#billsList .billCategoryList .billCategoryLabel img {
  flex: 0 0 auto;
  width: 1.5em;
  height: 1.5em;
  transition: transform 300ms ease-in-out;
}
#billsList .billCategoryList.active .billCategoryLabel {
  border-bottom: 2px solid #a9bbd6;
}
#billsList .billCategoryList.active .billCategoryLabel img {
  transform: rotate(-180deg);
}
#billsList .bills-sublist {
  border-style: solid;
  border-color: #b6b6b6;
  border-width: 0 1px;
  background: #e9e9ed;
  padding-left: 0;
}
#billsList .bills-sublist .bill-item {
  list-style: none;
  padding: 8px 10px 8px 30px;
  transition: background-color 300ms;
}
#billsList .bills-sublist .bill-item:not(:last-child) {
  border-bottom: 1px solid #b6b6b6;
}
#billsList .bills-sublist .bill-item.active {
  background: #ff916f;
  font-weight: 700;
  pointer-events: none;
}
#billsList .bills-sublist .bill-item:not(.active):hover {
  cursor: pointer;
  background: #ffdfd6;
}
#billsList .bills-sublist .bill-label {
  font-size: 1.4rem;
}
#billsList .bills-sublist .bill-label:hover {
  color: inherit;
}

/* Special mini map controls */
#canvas.mini {
  display: block;
}
#canvas.mini #controlsContainer {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(247, 247, 242, 0.5);
  backdrop-filter: blur(2px);
  box-shadow: 3px 3px 5px -2px #555;
}
@media screen and (max-width: 767px) {
  #canvas.mini #controlsContainer {
    top: 0;
    bottom: auto;
    backdrop-filter: none;
  }
}
#canvas.mini #controlsContainer #layerControls.active {
  width: auto;
  margin: 10px;
  background: transparent;
}
#canvas.mini #controlsContainer #layerControls.active #layersList {
  flex-direction: column;
  flex-wrap: nowrap;
}
@media screen and (max-width: 767px) {
  #canvas.mini #controlsContainer #layerControls.active #layersList {
    flex-direction: row;
  }
}
#canvas.mini #controlsContainer #layerControls .layer-toggle-item {
  width: 100%;
  margin: 16px 0;
}
#canvas.mini #controlsContainer .bills-list-container {
  display: none;
}

/* MOBILE Drawer Activator */
#mobileControlsActivator {
  display: none;
}
@media screen and (max-width: 767px) {
  #mobileControlsActivator {
    pointer-events: none;
    display: block;
    position: absolute;
    top: 100%;
    width: 100vw;
    height: 40px;
    margin: 0;
    padding-bottom: 8px;
  }
  #mobileControlsActivator.active {
    pointer-events: auto;
  }
  #mobileControlsActivator .drawerHandle {
    display: block;
    width: 75px;
    height: 40px;
    margin: 0 auto;
    text-align: center;
    border-radius: 0 0 50% 50%;
    background: rgba(247, 247, 242, 0.85);
    pointer-events: auto;
  }
  #mobileControlsActivator .drawerHandle .drawerIcon {
    width: 100%;
    height: 100%;
    transition: transform 600ms ease-in-out;
    -webkit-transition: -webkit-transform 600ms ease-in-out;
    -moz-transition: -moz-transform 600ms ease-in-out;
  }
  #mobileControlsActivator .drawerHandle.active .drawerIcon {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
  }
}

@media screen and (max-width: 767px) {
  #controlsContainer {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    width: 100vw;
    transition: all 600ms ease-in-out;
    overflow-y: visible;
  }
  #controlsContainer.active {
    transform: translateY(0);
  }
  #controlsContainer .controls-content {
    position: relative;
  }
  #controls.drawer {
    background-color: rgba(247, 247, 242, 0.85);
    z-index: 100;
    width: 100vw;
    height: auto;
    max-height: 60vh;
    overflow-y: auto;
  }
}
/* Tally Popup Styles - Desktop */
.tally-popup .mapboxgl-popup-content {
  background: #f7f7f2;
  color: #333;
}
.tally-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
  border-bottom-color: #f7f7f2;
}
.tally-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
  border-top-color: #f7f7f2;
}
.tally-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
  border-right-color: #f7f7f2;
}
.tally-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
  border-left-color: #f7f7f2;
}
@media screen and (max-width: 1279px) {
  .tally-popup {
    display: none;
  }
}

/* Tally Drawer Styles - Mobile */
#detailsOverlay {
  display: none;
}
@media screen and (max-width: 1279px) {
  #detailsOverlay {
    position: absolute;
    left: 0;
    bottom: -75vh;
    max-height: 75vh;
    height: auto;
    overflow-y: auto;
    width: 100%;
    z-index: 101;
    display: block;
    background: rgba(44, 44, 44, 0.9);
    color: #f7f7f2;
    transition: all 600ms ease-in-out;
  }
  #detailsOverlay.active {
    bottom: 0;
  }
}
#detailsOverlay .details-close {
  position: absolute;
  top: 1.2rem;
  right: 1.6rem;
}
#detailsOverlay .details-close .close-icon {
  -webkit-mask-image: url("../img/close.svg");
  mask-image: url("../img/close.svg");
  background-color: #fff;
  height: 2.4rem;
  width: 2.4rem;
  transition: transform 300ms ease-in-out;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-size: contain;
  mask-repeat: no-repeat;
}
#detailsOverlay .details-close .close-icon:hover {
  background-color: #f05c2d;
}

/* Tally Details Internal Content */
.details {
  font-size: 1.6rem;
  margin: 0;
}
.details .detailsContent {
  padding: 0 8px;
}
.details .detailsContent .billTitle {
  font-size: 2rem;
  margin: 4px 12px 8px 0;
}
.details .detailsContent .billDescription {
  clear: both;
  font-size: 1.3rem;
  margin: 0 8px 8px 0;
}
.details .detailsContent .billLinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.details .detailsContent .billLinks a {
  display: block;
  text-align: center;
  margin: 0.75rem 1rem;
  font-size: 1.4rem;
  line-height: 22px;
  padding: 0.5rem;
  min-width: 225px;
  background: #f05c2d;
  color: #f7f7f2;
  border: 1px solid #929292;
  border-radius: 30px;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}
.details .detailsContent .billLinks a:hover {
  background: rgb(218.4, 64.48, 15.6);
  border-color: #333;
  color: #f7f7f2;
}
.details .detailsContent .billLinks a:active, .details .detailsContent .billLinks a:focus {
  border: 1px solid #333;
}
.details .detailsContent .billLinks a img,
.details .detailsContent .billLinks a span {
  display: inline-block;
  vertical-align: middle;
}
.details .detailsContent .billLinks a img {
  width: 1.6rem;
  height: 1.6rem;
}
.details .detailsContent a {
  text-decoration: none;
  color: #f05c2d;
}
.details .detailsContent a:hover, .details .detailsContent a:active {
  color: rgb(218.4, 64.48, 15.6);
}
@media screen and (max-width: 1279px) {
  .details .detailsContent {
    padding: 1.5rem;
  }
  .details .detailsContent .billTitle {
    padding-right: 1.2rem;
  }
  .details .detailsContent .billDescription {
    margin: 1rem;
  }
  .details .detailsContent a:hover, .details .detailsContent a:focus, .details .detailsContent a:active {
    color: hsl(14, 87%, 76%);
  }
  .details .detailsContent .billLinks a:hover, .details .detailsContent .billLinks a:active, .details .detailsContent .billLinks a:focus {
    border-color: #929292;
    color: #f7f7f2;
  }
}

.tallies {
  display: flex;
  flex-flow: row wrap;
}

/* Tally Counts Table - one per jurisdiction */
.talliesCounts {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: auto;
  width: 250px;
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding: 0 1.6rem;
}
@media screen and (max-width: 1279px) {
  .talliesCounts {
    color: #f7f7f2;
  }
}
.talliesCounts .district-name {
  font-size: 1.6rem;
  padding-bottom: 2px;
}
.talliesCounts .tally-stats {
  display: flex;
  align-items: center;
}
.talliesCounts .tally-stats .tally-chart {
  flex: 0 0 auto;
  height: 5rem;
  width: 5rem;
  border-radius: 50%;
  border: 1px solid #89a2a6;
}
.talliesCounts .tally-stats .stats-grid {
  display: grid;
  grid-template-columns: 1fr 5rem 5rem;
  column-gap: 12px;
  margin-left: 16px;
  flex: 1 1 auto;
}
.talliesCounts .tally-stats .stats-grid .stats-col {
  text-align: right;
  line-height: 2rem;
}
.talliesCounts .tally-stats .stats-grid .stats-col.heading {
  text-align: left;
  font-weight: 700;
}

/* MISC STYLES */
/* Loading Overlay */
#shield {
  display: none;
  position: absolute;
  z-index: 1000;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: #f7f7f2;
}
#shield.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
#shield .shieldMsg {
  margin: 1.8rem;
  text-align: center;
}

/* mapbox overrides */
.mapboxgl-canvas-container {
  cursor: default !important;
}

.mapboxgl-ctrl-logo {
  display: none !important;
}

.mapboxgl-ctrl-top-right {
  top: 30px;
}

/* tally stats box on top right of map */
#tallyStats {
  display: none;
  font-size: 10px;
  color: #f7f7f2;
  background: #333;
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 0 0 0 5px;
  padding: 4px;
}
#tallyStats .tallyStatsItemLabel::after {
  content: ":";
}

/* expandableText */
/* expanded/collapsed states */
.extExpanded {
  display: inline;
}
.extExpanded.extTrailer {
  display: none;
}

.extCollapsed {
  display: none;
}
.extCollapsed.extTrailer {
  display: inline;
}

.hidden {
  display: none;
}
