.city-subnav-container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
}

.city-subnav-link {
  display: flex;
  /* flex-basis:auto (not 0) so each tab is sized by its own label: with equal
     basis the longest label ("Sunrise & Sunset Tomorrow") wrapped to 2-3 lines
     and stretched the whole bar. nowrap keeps every tab a single line. */
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  /* containing block for the visually-hidden .city-subnav-where span: without
     it that span resolves against the page, so the off-screen tabs of the
     mobile scroll strip gave the whole page a horizontal scrollbar. */
  position: relative;
  min-width: 0;
  min-height: 43px;
  padding: 2px 10px;
  white-space: nowrap;
  box-sizing: border-box;
  border-bottom: 1px solid #d1d5db;
  border-left: 1px solid #d1d5db;
  background: #f9fafb;
  color: #1f2937;
  font-size: .85em;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s ease-in-out, color .2s ease-in-out;
}

.city-subnav-link:first-child {
  border-left: 0;
}

.city-subnav-link:hover {
  background: #f3f4f6;
  color: #111827;
}

.city-subnav-link.active,
.city-subnav-link.active:hover {
  border-color: #2563eb;
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
}

.city-subnav-link.active:first-child {
  border-left-color: transparent;
}

.city-subnav-icon {
  flex: 0 0 auto;
  margin-right: 8px;
  font-size: 1.3em;
  line-height: 1;
}

/* "in <City>" repeats on every tab and duplicates the H1: keep it for screen
   readers, hide it visually. */
.city-subnav-where {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Desktop squeeze tiers: body is capped at 1100px, so the tabs fit one row on
   any viewport >=1024px. Between 769px and 1023px the row would wrap onto a
   second line, so step the type down instead of wrapping. */
@media (min-width: 769px) and (max-width: 1023px) {
  .city-subnav-link {
    padding: 2px 6px;
    font-size: .78em;
  }

  .city-subnav-icon {
    margin-right: 5px;
    font-size: 1.1em;
  }
}

@media (min-width: 769px) and (max-width: 880px) {
  .city-subnav-link {
    padding: 2px 4px;
    font-size: .72em;
  }

  .city-subnav-icon {
    margin-right: 4px;
    font-size: 1em;
  }
}

@media (max-width: 768px) {
  .city-subnav-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 38px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .city-subnav-container::-webkit-scrollbar {
    display: none;
  }

  .city-subnav-link {
    flex: 0 0 110px;
    min-width: 110px;
    min-height: 40px;
    padding: 8px 12px;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid #d1d5db;
    border-left: 1px solid #d1d5db;
    font-size: .8em;
    white-space: nowrap;
  }

  .city-subnav-link > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .city-subnav-icon {
    margin-right: 8px;
    color: inherit;
    font-size: 1.1em;
  }
}

@media (max-width: 576px) {
  .city-subnav-link {
    flex-basis: 100px;
    min-width: 100px;
    min-height: 38px;
    padding: 6px 10px;
    font-size: .75em;
  }

  .city-subnav-icon {
    margin-right: 6px;
    font-size: 1em;
  }
}

@media (max-width: 420px) {
  .city-subnav-link {
    flex-basis: 95px;
    min-width: 95px;
    min-height: 36px;
    padding: 5px 8px;
    font-size: .7em;
  }

  .city-subnav-icon {
    margin-right: 5px;
    font-size: .95em;
  }
}
