* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: "helvetica neue", sans-serif;
  font-size: 1.3rem;
  background: #fafafa;
  color: #333;
  line-height: 1.5;
}

header,
footer,
main > section {
  max-width: 60rem;
  margin: 0 auto;
}

header {
  padding: 1rem;
}

.tagline {
  margin: 0 0 3em 0;
}

h1 {
  margin: 2em 0 0 0;
}

main {
  padding: 1rem;
}

.map-panel {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
}

#map-wrap {
  position: relative;
  overflow: hidden;
  width: 70vw;
  height: 70vh;
  flex-shrink: 0;
  border: 1px solid;
}

#map {
  width: 100%;
  height: 100%;
}

.side-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 70vh;
  overflow: hidden;
}

#table-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#legend {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  border: 1px solid;
  padding: 0.5rem 1rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2px 0;
}

.legend-row .dot {
  width: 1.5rem;
  height: 4px;
}

#cross-section-panel {
}

.map-panel h2 {
  font-size: 1.2rem;
  margin: 0;
}

#cross-section-panel.hidden {
  display: none;
}

.xs-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.xs-header > div {
  flex: 1;
}

#xs-close {
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

#xs-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

#xs-svg {
  width: 100%;
  height: 14rem;
  display: block;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid;
}

#routes-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

#routes-table th,
#routes-table td {
  padding: 0.5rem 1rem;
  text-align: left;
  border-bottom: 1px solid;
}

#routes-table th {
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
}

#routes-table th.sorted-asc::after {
  content: " ▲";
}

#routes-table th.sorted-desc::after {
  content: " ▼";
}

#routes-table th.num,
#routes-table td.num {
  text-align: right;
}

#routes-table tbody tr {
  cursor: pointer;
}

footer {
  border-top: 1px solid;
  padding-top: 1rem;
  margin-top: 5rem;
  font-size: smaller;
  opacity: 0.5;
}

#comparisons {
  border-top: 1px solid;
  padding-top: 1rem;
}

.comp-group {
  margin-bottom: 2rem;
}

.comp-images {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.comp-images img {
  width: 300px;
  height: 167px;
  object-fit: cover;
  display: block;
}

.comp-images--wide {
  flex-wrap: nowrap;
}

.comp-images--wide figure {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.comp-images--wide img {
  width: 100%;
  height: 16rem;
}

.maplibregl-popup-tip {
  display: none !important;
}

/* on mobile do vertical */

@media (max-width: 768px) {
  .map-panel {
    flex-direction: column;
  }
  #map-wrap {
    width: 100%;
    height: 50vh;
  }
  .table-wrap {
    max-height: 50vh;
  }
  #legend {
    font-size: x-small;
    line-height: 1;
  }
  th {
    font-size: x-small;
  }
}
