:root {
  --font-body: "Century Gothic", Arial, sans-serif;
  --font-heading: "Balboa Condensed", "Century Gothic", Arial, sans-serif;
}

@font-face {
  font-family: "Balboa Condensed";
  src: url("./images/fonts/fonnts.com-Balboa_Condensed.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Century Gothic";
  src: url("./images/fonts/centurygothic.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #a41336;
  --orange: #f88807;
  --table-border: #D8D5D5;
  --table-row: #f4f1ec;
  --table-highlight: #F8880766;
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  font-synthesis: weight;
}

.main-container {
  max-width: 990px;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding-bottom: 32px;
}

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: var(--red);
  color: #fff;
  padding: 20px;
}

.heading {
  color: var(--orange);
  text-transform: uppercase;
  font-size: 60px;
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-heading);
}

.desc {
  margin-top: 20px;
  text-align: center;
}




.map-wrapper {
  position: relative;
}

#map {
  flex: 1;
  min-height:  720px;
  background: #f2f2f2;
}

#map svg {
  display: block;
}

#map path {
  cursor: pointer;
}

.map-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  background: #fff;
  border: 1.5px solid #73757b;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  padding: 8px 10px 10px;
  min-width: 138px;
  transition: opacity 120ms ease;
}

.map-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -34px;
  width: 2px;
  height: 34px;
  background: #ffffff;
  transform: translateX(-50%);
}

.map-tooltip .tooltip-rank {
  font-size: 18px;
  font-weight: 400;
  color: #A41336;
  line-height: 1;
}

.map-tooltip .tooltip-city {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  color: #3d3f45;
  line-height: 1.1;
}

.map-tooltip .tooltip-region {
  margin-top: 2px;
  font-size: 15px;
  color: #3d3f45;
  line-height: 1.1;
}

.map-legend {
  position: absolute;
  right: 50px;
  top: 40%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 12;
}

.legend-scale {
  width: 13px;
  height: 420px;
  border: 1px solid #5c464a;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: repeat(13, 1fr);
}

.legend-segment {
  border-bottom: 2px solid rgba(70, 34, 38, 0.45);
}

.legend-segment:last-child {
  border-bottom: 0;
}

.map-legend-label {
  position: absolute;
  right: 24px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 700;
  color: #3d3f45;
  line-height: 1;
  white-space: nowrap;
}

.map-legend-label.top {
  top: 0;
}

.map-legend-label.bottom {
  bottom: 0;
}

@media (max-width: 768px) {
  .map-wrapper {
    padding-bottom: 0;
  }

  .map-legend {
    left: 8px;
    right: 8px;
    bottom: 16px;
    top: auto;
    transform: none;
    display: block;
    padding-bottom: 30px;
  }

  .legend-scale {
    width: 100%;
    height: 18px;
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    grid-template-rows: none;
    border-radius: 7px;
  }

  .legend-segment {
    border-bottom: 0;
    border-right: 2px solid rgba(70, 34, 38, 0.45);
  }

  .legend-segment:last-child {
    border-right: 0;
  }

  .map-legend-label {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    bottom: 0;
    top: auto;
    right: auto;
    font-size: 14px;
  }

  .map-legend-label.bottom {
    left: 0;
    text-align: left;
    bottom: 0;
  }

  .map-legend-label.top {
    right: 0;
    left: auto;
    text-align: right;
    bottom: 0;
    top: auto;
  }

  .map-zoom-controls {
    bottom: 118px;
  }
}

.map-zoom-controls {
  position: absolute;
  right: 40px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 14;
}

.map-zoom-controls .zoom-btn {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 1px solid #a2a2a7;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.map-zoom-controls .zoom-btn::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 18px;
  height: 18px;
  border: 2px solid #5a5c63;
  border-radius: 50%;
}

.map-zoom-controls .zoom-btn::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 2px;
  background: #5a5c63;
  left: 28px;
  top: 29px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.map-zoom-controls .zoom-btn.zoom-in {
  background-image:
    linear-gradient(#5a5c63, #5a5c63),
    linear-gradient(#5a5c63, #5a5c63);
  background-repeat: no-repeat;
  background-size: 8px 2px, 2px 8px;
  background-position: 18px 20px, 21px 17px;
}

.map-zoom-controls .zoom-btn.zoom-out {
  background-image: linear-gradient(#5a5c63, #5a5c63);
  background-repeat: no-repeat;
  background-size: 8px 2px;
  background-position: 18px 20px;
}

.map-zoom-controls .zoom-btn:hover {
  background-color: #ffffff;
}

.map-controls {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  /* max-width: calc(100% - 120px); */
  z-index: 10;
  display: flex;
  align-items: center;
}

#region-select {
  width: 100%;
}

/* .map-controls::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  opacity: 0.8;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23696b72' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
} */

.map-controls .choices {
  margin: 0;
  width: 100%;
  position: relative;
}


.map-controls .choices__inner {
  background: #f5f5f5;
  border: 2px solid #7f8086;
  border-radius: 6px;
  min-height: 60px;
  padding: 0 56px 0 56px;
  box-shadow: none;
  display: flex;
  align-items: center;
}


.map-controls .choices__list--single {
  padding: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

.map-controls .choices__item--selectable {
  font-size: 20px;
  font-weight: 600;
  color: #4d4f56;
  line-height: 1;
}

.map-controls .choices[data-type*="select-one"]::after {
  border: 0;
  width: 20px;
  height: 20px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
  right: 24px;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234d4f56' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.map-controls .choices::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  height: 25px;
  opacity: 0.85;
  pointer-events: none;
  z-index: 2;
  background-repeat: no-repeat;
  background-size: 25px 25px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23696b72' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.map-controls .choices__list--dropdown {
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.choices[data-type*=select-one] .choices__inner {
  padding-bottom: 0px;
}

.map-controls .choices__input {
  font-size: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* .table-section {
  margin-top: 24px;
  border: 3px solid #2a9bd8;
  padding: 12px 12px 24px;
  overflow-x: auto;
} */

#table-container {
  max-height: 580px;
  overflow-y: auto;
  position: relative;
}

.rankings-table th:first-child,
.rankings-table td:first-child {
  width: 8px;
  padding: 0;
}

.rankings-table th:first-child {
  cursor: default;
}

.rankings-table td.row-color-cell {
  border-left: 0;
  border-right: 0;
}

.section-title {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 28px;
  text-transform: uppercase;
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.region-city {
  font-weight: 700;
}


.rankings-table th,
.rankings-table td {
  padding: 16px 10px;
  border-top: 0;
  border-bottom: 0;
  border-left: 1px solid var(--table-border);
  border-right: 1px solid var(--table-border);
  text-align: left;
}

.rankings-table th {
  border-left: 1px solid #741522;
  border-right: 1px solid #741522;
}

.rankings-table thead th {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
  cursor: pointer;
  user-select: none;
}

.rankings-table tbody tr:nth-child(even) {
  background: var(--table-row);
}

.rankings-table tbody tr.is-highlighted {
  background: var(--table-highlight);
}

.rankings-table tbody tr.is-selected-region {
  background: #ffe5c7;
  outline: 2px solid #f27e0b;
  outline-offset: -2px;
}

.rankings-table tbody tr.is-selected-region:nth-child(even) {
  background: #ffdcb5;
}

/* First column is the color strip; Rank is column 2 */
.rankings-table tbody td:nth-child(2) {
  color: var(--red);
  font-weight: 700;
}

.rankings-table td strong {
  font-weight: 700;
}

.rankings-table td .region-city {
  font-weight: 700;
}