.city-directory {
  margin-bottom: 3rem;
}

.city-directory-tools {
  margin: 1.25rem 0 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid #d8e2e8;
  background: #f6fafb;
}

.page .entry-content .city-directory-tools h2,
.post-type-archive-city .city-directory-tools h2 {
  margin: 0 0 .75rem;
  padding: .65rem .85rem;
  border: 0;
  background: #000;
  color: #fff;
  font-size: 21px;
}

.city-directory-tools > p {
  margin: 0;
  color: #60717c;
}

.city-directory-tools__form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(210px, 1fr) auto;
  align-items: end;
  gap: 1rem;
  margin-top: 1.25rem;
}

.city-directory-tools label > span {
  display: block;
  margin-bottom: .45rem;
  color: #334650;
  font-size: .9rem;
  font-weight: 700;
}

.city-directory-tools input,
.city-directory-tools select {
  width: 100%;
  min-height: 50px;
  padding: .75rem 1rem;
  border: 1px solid #b9c8d0;
  border-radius: 6px;
  background: #fff;
  color: #17212b;
  font: inherit;
}

.city-directory-tools select {
  padding-right: 2.5rem;
}

.city-directory-tools button {
  min-height: 50px;
  padding: .75rem 1.4rem;
  border: 1px solid #126e68;
  border-radius: 6px;
  background: #126e68;
  color: #fff;
  font: inherit;
  font-weight: 700;
}

.city-directory-tools__reset {
  grid-column: 1 / -1;
  justify-self: end;
  color: #1769aa;
  font-size: .9rem;
  font-weight: 700;
}

.city-directory-popular {
  margin-bottom: 2.25rem;
}

.post-type-archive-city .city-directory-popular h2,
.post-type-archive-city .city-directory-results__heading h2 {
  margin: 0 0 .85rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #18252d;
  font-size: 21px;
}

.city-directory-popular ul {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.city-directory-popular a {
  display: block;
  padding: .55rem .85rem;
  border: 1px solid #c9d6de;
  border-radius: 999px;
  background: #fff;
  color: #1769aa;
  font-weight: 700;
  text-decoration: none;
}

.city-directory-popular a:hover {
  border-color: #1769aa;
  background: #f2f8fc;
}

.city-directory-results__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 3px solid #18252d;
}

.post-type-archive-city .city-directory-results__heading h2 {
  margin-bottom: 0;
}

.city-directory-results__heading p {
  margin: 0;
  padding: .35rem .7rem;
  border-radius: 4px;
  background: #edf2f4;
  color: #334650;
  font-weight: 700;
}

.city-directory-table {
  overflow: visible;
  margin: 0;
}

.city-directory-table table {
  table-layout: fixed;
}

.city-directory-table thead th {
  padding: .9rem 1rem;
  border: 0;
  background: #126e68;
  color: #fff;
  text-align: left;
}

.city-directory-table thead th:nth-child(1) { width: 24%; }
.city-directory-table thead th:nth-child(2) { width: 20%; }
.city-directory-table thead th:nth-child(3) { width: 22%; }
.city-directory-table thead th:nth-child(4) { width: 34%; }

.cpt-table-frame.city-directory-table td {
  padding: 1rem !important;
  border: 0 !important;
  border-bottom: 1px solid #dfe7eb !important;
  vertical-align: middle;
}

.city-directory-table tbody tr:nth-child(even) {
  background: #f7f9fa;
}

.city-directory-table td:first-child a {
  color: #1769aa;
  font-weight: 800;
}

.city-directory-table .text-clock-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: .1rem;
  white-space: nowrap;
}

.city-directory-table .text-clock-time {
  grid-column: 1;
  grid-row: 2;
  color: #126e68;
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.city-directory-table .text-clock-date {
  grid-column: 1;
  grid-row: 1;
  color: #72818c;
  font-size: .75rem;
}

.city-directory-table .text-clock-wrap small {
  grid-column: 1;
  grid-row: 3;
  color: #465761;
  font-weight: 700;
}

.city-directory-empty {
  padding: 2rem;
  background: #f6fafb;
  text-align: center;
}

.city-directory-empty p {
  margin: 0 0 .75rem;
}

.city-directory-empty a {
  color: #1769aa;
  font-weight: 700;
}

@media (max-width: 700px) {
  .city-directory-tools {
    margin-top: .75rem;
    padding: 1rem;
  }

  .city-directory-tools__form {
    grid-template-columns: 1fr;
  }

  .city-directory-tools button {
    width: 100%;
  }

  .city-directory-tools__reset {
    grid-column: auto;
  }

  .city-directory-popular ul {
    gap: .45rem;
  }

  .city-directory-popular a {
    padding: .45rem .7rem;
    font-size: .9rem;
  }

  .city-directory-results__heading {
    align-items: flex-end;
  }

  .city-directory-table,
  .city-directory-table table,
  .city-directory-table tbody {
    display: block;
    width: 100%;
  }

  .city-directory-table thead {
    display: none;
  }

  .city-directory-table tbody {
    display: grid;
    gap: .8rem;
  }

  .city-directory-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    grid-template-areas:
      "city country"
      "time difference";
    gap: .45rem 1rem;
    padding: 1rem 1rem 1.1rem 1.15rem;
    border-bottom: 1px solid #d8e2e8;
    border-left: 4px solid #58a8df;
    background: #fff;
  }

  .city-directory-table tbody tr:nth-child(even) {
    background: #f8fafb;
  }

  .cpt-table-frame.city-directory-table td {
    display: block;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .city-directory-table td::before {
    display: block;
    margin-bottom: .15rem;
    color: #71818c;
    content: attr(data-label);
    font-size: .72rem;
    font-weight: 600;
  }

  .city-directory-table td:nth-child(1) {
    grid-area: city;
    min-width: 0;
    font-size: 1.3rem;
  }

  .city-directory-table td:nth-child(1) a {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .city-directory-table td:nth-child(2) {
    grid-area: country;
    min-width: 0;
    text-align: right;
  }

  .city-directory-table td:nth-child(2) a {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .city-directory-table td:nth-child(3) {
    grid-area: time;
    margin-top: .45rem;
    padding-top: .65rem !important;
    border-top: 1px solid #e1e8ec !important;
  }

  .cpt-table-frame.city-directory-table td.text-clock-wrap {
    display: grid;
    grid-template-columns: max-content auto;
    justify-content: start;
    gap: 0 .45rem;
  }

  .city-directory-table .text-clock-wrap::before {
    grid-column: 1 / -1;
  }

  .city-directory-table .text-clock-time {
    grid-column: 1;
    grid-row: 2;
  }

  .city-directory-table .text-clock-date {
    grid-column: 1;
    grid-row: 3;
  }

  .city-directory-table .text-clock-wrap small {
    grid-column: 1;
    grid-row: 4;
    font-size: .78rem;
  }

  .city-directory-table td:nth-child(4) {
    grid-area: difference;
    min-width: 0;
    margin-top: .45rem;
    padding-top: .65rem !important;
    border-top: 1px solid #e1e8ec !important;
    font-size: .92rem;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .city-directory-table .text-clock-time { font-size: 1.7rem; }
}

@media (max-width: 380px) {
  .city-directory-table tbody tr {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: .45rem .7rem;
  }

  .city-directory-table .text-clock-time {
    font-size: 1.45rem;
  }

  .city-directory-table td:nth-child(4) {
    font-size: .85rem;
  }
}
