*, *::before, *::after {
  box-sizing: inherit;
}

@at-root {
  @-moz-viewport      { width: device-width; }
  @-ms-viewport       { width: device-width; }
  @-o-viewport        { width: device-width; }
  @-webkit-viewport   { width: device-width; }
  @viewport           { width: device-width; }
}

[tabindex="-1"]:focus {
  outline: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

body {
  font-family: 'OpenSans', sans-serif;
  line-height: 1.4;
  color: #333;
  background-color: #fff;
}

a, a:visited {
  color: #666;
}

a:focus, a:hover, a:active {
  color: #333;
  transition: all ease .3s;
}

p {
  margin-bottom: .8rem;
}

.sidebar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 2;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4rem;
  border-bottom: 1px solid #ececec;
  background-color: #fff;
}

h1 {
  margin: 0;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.2;
}

.reported-cases {
  display: flex;
  align-items: center;
  margin: 0;
  padding: .75rem;
}

.reported-cases-num {
  padding: 0 .5rem 0 0;
  font-size: 2rem;
  font-weight: 600;
  color: #4998d6;
  color: #0060AA;
  line-height: 1;
}

.reported-cases-label {
  font-size: .9rem;
  font-weight: 200;
  line-height: 1.2;
  color: #454545;
  text-transform: uppercase;
}

.reported-cases-daterange {
  font-size: .9rem;
  font-weight: 400;
  text-transform: none;
}

#filter-form {
  display: flex;
  width: 100%;
  height: 5.5rem;
  align-items: flex-end;
  background: #fff;
  border-top: 1px solid #ececec;
}

.form-group {
  flex: 1;
  padding: 0 .5rem;
}

.form-group label {
  display: block;
  font-size: .8rem;
  padding-bottom: .25rem;
  text-transform: uppercase;
}

.map-desc {
  display: none;
}

.credit {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 2rem;
  font-size: .7rem;
}

.map-container {
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  bottom: 7.5rem;
  z-index: 1;
}

#map {
  height: 100%;
}

.small {
  font-size: .75rem;
  line-height: 2;
}

ul.list-unstyled {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  margin-bottom: .25rem;
}

/* styles for popups */

h2 {
  margin: 0 0 1rem 0;
  font-size: 1.8rem;
  color: #454545;
  font-weight: 200;
}

sup {
  display: inline-block;
  margin-left: .2rem;
}

.btn-round {
  position: relative;
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  font-family: 'OpenSans', sans-serif;
  font-size: .85rem;
  font-weight: bold;
  line-height: 1.9;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  outline: 0;
  background-color: #fff;
  border: 1px solid #ccc;;
  border-radius: 50%;
}

.btn-round:active, .btn-round:focus {
  color: #000;
  background-color: #f0f0f0;
  background-image: none;
  border-color: #999;
  outline: 0;
}

#download-data {
  position: absolute;
  right: .75rem;
  bottom: 6rem;
  padding: .5rem .75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 400;
  font-size: .8rem;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  border: 0;
  background-color: #0060AA;
  border-radius: .2rem;
  cursor: pointer;
  z-index: 1;
}

ul.legend {
  position: absolute;
  right: 0;
  bottom: 3rem;
  display: flex;
  justify-content: center;
  padding: .5rem 1rem;
  font-size: .8rem;
  z-index: 3;
  border: 1px solid #ececec;
  background-color: rgba(255,255,255,.8);
  user-select: none;
}

ul.legend li {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 .3rem;
}

ul.legend img {
  margin-right: .4rem;
}

/* cross browser select styling */
select {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  width: 100%;
  height: 2.75rem;
  padding: 0 .75rem;
  color: #666;
  border: 1px solid #ccc;
  border-radius: .2rem;
  /* reset browser specific styling */
  background-color: #fff;
  background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iNjEycHgiIGhlaWdodD0iNzkycHgiIHZpZXdCb3g9IjAgMCA2MTIgNzkyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA2MTIgNzkyIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjx0aXRsZT5hcnJvd3M8L3RpdGxlPg0KPHBhdGggZD0iTTIyMS42NTIsMzY5Ljg2NGw4NC43NDUtMTE4LjAwOGw4My45NTEsMTE4LjAwOEgyMjEuNjUyeiBNMzkwLjM0OCw0MjIuMTM2bC04My45NTEsMTE4LjAwOGwtODQuNzQ1LTExOC4wMDhIMzkwLjM0OHoiLz4NCjwvc3ZnPg0K');
  background-position: right 0px center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  outline: 0;
}

option {
  line-height: 1;
}


.pin1 {
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-image: url(../img/pin1.svg);
  opacity: .8;
  background-size: 16px 16px;
  background-position: center; 
  cursor: pointer;
  border-radius: 50%;
}

.pin1:hover, .pin2:hover, .pin3:hover {
  width: 50px;
  height: 50px;
}

.pin2 {
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  opacity: .8;
  background-image: url(../img/pin2.svg);
  background-size: 16px 16px;
  background-position: center; 
  border-radius: 50%;
 }

.pin3 {
  width: 20px;
  height: 20px;
  opacity: .8;
  background-repeat: no-repeat;
  background-image: url(../img/pin3.svg);
  background-size: 16px 16px;
  background-position: center; 
  border-radius: 50%;
}


/* mapbox infobox overrides */
.mapboxgl-map {
  font-family: 'OpenSans', sans-serif !important;
}

.mapboxgl-popup {
  min-width: 300px !important;
  border: 0;
  user-select: none;
}

.mapboxgl-popup-content {
  padding: 0;
 }

.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
  border-bottom-color: #0060AA !important;
}

.mapboxgl-popup-close-button {
  color: #fff;
  padding: .125rem .5rem 1rem 2rem;
  font-size: 1.3rem;
  font-weight: 200;
}

.mapboxgl-popup-close-button:hover {
  background-color: rgba(0, 0, 0, 0.0) !important;
  outline: 0 !important;
}

/* custom infobox */

.infobox-header {
  display: flex;
  align-items: stretch;
  background-color: #0060AA;
  color: #fff;
}

.infobox-location {
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.infobox-content-wrapper {
  max-height: 300px;
  padding: 1rem;
  overflow-y: scroll;
}

.infobox-content + .infobox-content {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid #ececec;
}
  
.marker {
  background-image: url('../img/pin1.svg');
  background-size: cover;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
}
 
.infobox-wrapper {
  font-family: 'OpenSans', sans-serif;
  display: flex;
  align-items: stretch;
}

.infobox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;

}

.infobox-content .location em {
  font-style: normal;
  font-size: .9rem;
  font-weight: normal;
  color: #787878;
}

.infobox-content .name {
  margin-top: .25rem;
  line-height: 1.5;
  font-size: 1rem;
}

.infobox-content .name a {
  color: #0060AA;
  text-decoration: none;
}

.infobox-content .name a:focus, .infobox-content .name a:hover, .infobox-content .name a:active {
  color: #4998d6;
}

.infobox-content .description {
  padding-top: .2rem;
  padding-bottom: 1rem;
}

@media only screen and (max-height: 570px) {
  .infobox-content-wrapper {
    overflow-y: scroll;
    max-height: 180px;
  }  
}





/* modal */

#modal-wrapper {
  display: none;
  position: relative;
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 15;
}

#modal-wrapper.is-block {
  display: block;
}

#modal-wrapper.is-visible {
  opacity: 1;
}

#modal {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  bottom: 0;
  background-color: #fff;
  overflow: hidden;
  z-index: 17;
  user-select: none;
}

#modal.is-flex {
  display: flex;
}

#modal.is-visible {
  opacity: 1;
  margin-top: 0;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 16;
}

.modal-header {
  display: flex;
  align-items: center;
  height: 4rem;
  justify-content: space-between;
  border-bottom: 1px solid #dedede;
}

.modal-title {
  flex: 1;
  color: #333;
  padding: 0 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 200;
}

.modal-title strong {
  font-weight: 600;
  user-select: none;
}

.modal-cancel {
  position: relative;
  width: 4rem;
  height: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.modal-body {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 10rem;
  padding: 1.5rem 1rem;
  font-size: .8rem;
  line-height: 1.6;
  color: #454545;
  overflow: auto;
}

.modal-body h2 {
  margin: 1.25rem 0 .75rem 0;
  font-size: 1.3rem;
  font-weight: 200;
  color: #0060AA;
}

.modal-body ul {
  margin: 1rem 0 1.25rem 1rem;
  padding: 0;
}

.modal-body li {
  margin: 0 0 .8rem;
  padding: 0;
}

.modal-body p {
  margin: 1rem 0 1.25rem 0;
}

@media only screen and (min-width: 569px) and (min-height: 415px) {
  #modal {
    top: 50%;
    left: 50%;
    bottom: auto;
    width: 40rem;
    margin-top: -3rem;
    max-height: calc(100vh - 6rem);
    transform: translate(-50%, -50%);
    border-radius: .3rem;
    opacity: 0;
    box-shadow: 1px 1px 6px 0px rgba(0, 0, 0, 0.1);
    transition: all 400ms ease;
  }
}

@media only screen and (min-width: 569px) {
  .modal-title {
    padding-left: 3rem;
    font-size: 1.8rem;
  }
  .modal-body {
    padding: 1.5rem 5rem 1.5rem 3rem;
    font-size: .9rem;
  }
  .modal-body h2 {
    font-size: 1.5rem;
  }
}

@media only screen and (min-width: 800px) {
  .mapboxgl-popup {
    min-width: 400px !important;
  }
  .sidebar {
    display: block;
    top: 0;
    width: 20rem;
    height: auto;
    padding: 1.5rem;
    overflow: auto;
  }
  .sidebar-header {
    position: static;
    display: block;
    height: auto;
    padding: 0;
    border: 0;
  }
  h1 {
    font-size: 1.7rem;
  }
  .reported-cases {
    margin: 2rem 0 1.5rem 0;
    border-top: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
  }
  .reported-cases-num {
    font-size: 2.5rem;
  }
  .map-container {
    top: 0;
    left: 20rem;
    bottom: 0;
  }
  .map-desc {
    display: block;
    margin-bottom: .5rem;
    font-size: .8rem;
    line-height: 1.5;
  }
  .credit {
    display: block;
    width: 100%;
    color: #454545;
  }
  #filter-form {
    display: block;
    height: auto;
    padding: 0;
    border: 0;
  }
  .form-group {
    margin: 1.5rem 0;
    padding: 0;
  }
  ul.legend {
    right: auto;
    left: 1rem;
  }
  #download-data {
    right: 1rem;
    padding: .75rem 1rem;
    bottom: 3rem;
  }
}

