/* ========================================================================= */
/* FONTS */
/* ========================================================================= */

@font-face {
    font-family: 'Calibre Semibold';
    src: url('../fonts/CalibreWeb-Semibold.woff2') format('woff2'),
         url('../fonts/CalibreWeb-Semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Calibre';
    src: url('../fonts/CalibreWeb-Regular.woff2') format('woff2'),
         url('../fonts/CalibreWeb-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}


/* ========================================================================= */
/* MAIN */
/* ========================================================================= */

* {
  box-sizing: border-box;
}

body {
  background:#ffffff;
  color: #000;
  font-family: "Calibre Semibold", Helvetica, sans-serif;
  position: relative;
  margin: 0;
}


/* ========================================================================= */
/* HEADER */
/* ========================================================================= */

header {
  margin: 0;
  padding: 0 10px;
}

header h1 {
  margin: 10px 0;
  font-size: 24px;
}

header p {
  margin: 0 0 10px 0;
  font-family: "Calibre", Helvetica, sans-serif;
  font-size: 16px;
}


/* ========================================================================= */
/* SLIDER */
/* ========================================================================= */

#slider {
  border-bottom: 1px solid #bbb;
  touch-action: none;
  text-align: center;
  width: 100%;
}

.percentage-label,
.state-percentage-label {
  font-size: 16px;
}

/* ========================================================================= */
/* MAP */
/* ========================================================================= */

#map {
  position: relative;
}

.map-state {
  -webkit-transition: fill 0.25s ease;
  -moz-transition: fill 0.25s ease;
  -o-transition: fill 0.25s ease;
  transition: fill 0.25s ease;
}

@media (hover: hover) {
  .map-state:hover {
    cursor: pointer;
  }
}

.map-state.top {
  fill: #7084ff !important;
}

.map-state.bottom {
  fill: #e3d481 !important;
}

.map-state.active[data-info="{}"] {
  fill: #000 !important;
}

.map-state.top.active {
  fill: #1435ff !important;
}

.map-state.bottom.active {
  fill: #e4c51b !important;
}

.state-rankings {
  padding: 0;
  margin: 0;
  position: absolute;
  top: 20%;
  right: 20%;
  left: 50%;
  background-color: #fff;
  border: 1px solid #999;
  opacity: 0;
  box-shadow: 1px 1px 10px #555;
}

.state-rankings h1 {
  font-size: 20px;
  display: block;
  margin: 0;
  padding: 10px;
  color: #000;
  background-color: #eee;
}

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

.state-rankings .category {
  font-family: "Calibre", Helvetica, sans-serif;
  font-size: 18px;
  padding: 10px;
  margin: 0;
  color: #555 !important;
  border-top: 1px solid #999;
}

/* ========================================================================= */
/* MAP LABELS */
/* ========================================================================= */

.state-label-wrapper {
  position: absolute;
  border: 1px solid #555;
  background-color: #fff;
  margin: 0;
  padding: 0;
  /* opacity: 0; */
  border-collapse:collapse;
}

.state-label-wrapper.top {
  border: 1px solid #4b64ff;
}

.state-label-wrapper.bottom {
  border: 1px solid #d9a907;
}

.state-label-name,
.state-label-rank {
  margin: 0;
  padding: 2px 4px;
  font-size: 16px;
  display: table-cell;
  height: 100%;
  vertical-align: middle !important;
}

.state-label-name {
  color: #000;
}

.state-label-wrapper.top .state-label-rank {
  color: #fff;
  background-color: #4b64ff;
}

.state-label-wrapper.bottom .state-label-rank {
  color: #fff;
  background-color: #d9a907;
}

@media (hover: hover) {
  .state-label:hover {
    cursor: pointer;
  }
}


/* ========================================================================= */
/* FOOTER */
/* ========================================================================= */

footer {
  position: relative;
  border-top: 1px solid #bbb;
}

.footer-reset {
  display: inline-block;
  position: absolute;
  top: -50px;
  right: 20px;
}

.reset-button {
  text-transform: uppercase;
  background-color: #fff;
  border: 1px solid #aaa;
  border-radius: 0;
  padding: 10px;
  opacity: 1;

  -webkit-transition: color 0.5s ease;
  -moz-transition: color 0.5s ease;
  -o-transition: color 0.5s ease;
  transition: color 0.5s ease;
  -webkit-transition: background-color 0.5s ease;
  -moz-transition: background-color 0.5s ease;
  -o-transition: background-color 0.5s ease;
  transition: background-color 0.5s ease;
  -webkit-transition: box-shadow 0.75s ease;
  -moz-transition: box-shadow 0.75s ease;
  -o-transition: box-shadow 0.75s ease;
  transition: box-shadow 0.75s ease;
}

.reset-button.shadow {
  box-shadow: 1px 1px 10px #555;
}

@media (hover: hover) {
  .reset-button:hover {
    cursor: pointer;
    color: white;
    background-color: #000;
  }
}

.reset-button:focus {
  outline: 0;
}

.reset-button:active {
  background-color: #fff;
  color: #000;
}

.footer-content {
  width: 100%;
  padding: 20px;
}

.footer-left {
  display: inline-block;
  vertical-align: top;
  width: 60%;
}

.footer-right {
  display: inline-block;
  vertical-align: top;
  width: 40%;
  text-align: right;
}

.legend {
  padding-top: 3px;
}

.legend-field {
  display: inline-block;
  margin-right: 20px;
  font-family: "Calibre", Helvetica, sans-serif;
}

.legend span {
  display: inline-block;
  line-height: 20px;
  font-size: 16px;
  color: #000;
  vertical-align: middle;
}

.legend-top-five,
.legend-bottom-five {
  width: 30px;
  height: 20px;
}

@media (hover: hover) {
  .legend-top-five:hover,
  .legend-bottom-five:hover {
    cursor: pointer;
  }
}

.legend-top-five {
  background-color: #697ee9;
}

.legend-top-five.active,
.legend-top-five:hover {
  border: 2px solid #697ee9;
  background-color: #fff;
}

.legend-bottom-five {
  background-color: #e3d481;
}

.legend-bottom-five.active,
.legend-bottom-five:hover {
  border: 2px solid #e3d481;
  background-color: #fff;
}

.legend-logo img {
  height: 30px;
}

.footer-source p {
  color: #aaa;
  font-size: 10px;
  font-family: "Calibre", Helvetica, sans-serif;
}

.bankrate-link {
  text-decoration: none !important;
  color: inherit;
}

/* ========================================================================= */
/* MEDIA QUERIES */
/* ========================================================================= */

@media screen and (max-width: 1000px) {
  .state-rankings {
    top: 15%;
    right: 15%;
  }
}

@media screen and (max-width:800px) {
  header h1 {
    font-size: 22px;
  }

  header p {
    font-size: 14px;
  }

  .state-label-name,
  .state-label-rank {
    font-size: 14px;
  }

  .percentage-label,
  .state-percentage-label {
    font-size: 14px;
  }

  .state-rankings {
    top: 10%;
    right: 10%;
  }

  .state-rankings .category {
    font-size: 16px;
  }
}

@media screen and (max-width: 650px) {
  .state-rankings {
    top: 5%;
    right: 5%;
  }
}

@media screen and (max-width: 550px) {
  header h1 {
    font-size: 18px;
  }

  .state-label-name,
  .state-label-rank {
    font-size: 12px;
  }

  .state-percentage-label {
    font-size: 12px;
  }

  .legend {
    padding-top: 0;
  }

  .legend-field span {
    font-size: 14px;
  }

  .legend-logo img {
    height: 20px;
  }

  .footer-right {
    bottom: 20px;
  }

  .state-rankings {
    top: 10%;
    right: 5%;
  }

  .state-rankings h1 {
    font-size: 18px;
  }

  .state-rankings .category {
    font-size: 14px;
  }
}


@media screen and (max-width: 500px) {
  .state-rankings {
    top: 5%;
    right: 5%;
  }
  .state-rankings h1 {
    font-size: 16px;
  }

  .state-rankings .category {
    font-size: 13px;
  }
}

@media screen and (max-width: 450px) {
  .state-rankings h1,
  .state-rankings .category {
    padding: 8px;
  }
}

@media screen and (max-width: 400px) {
  .state-percentage-label {
    font-size: 10px;
  }

  .state-rankings h1,
  .state-rankings .category {
    padding: 6px;
  }
}

@media screen and (max-width: 350px) {
  .legend-field {
    margin-right: 10px;
  }

  .legend-field span {
    font-size: 12px;
  }

  .legend-top-five,
  .legend-bottom-five {
    width: 20px;
    height: 20px;
  }
}
