.school-dates-head {
  padding-bottom: 20px;
}

.school-dates-head .h2,
.school-dates-choice .h2-sub {
  margin: 0;
}

.school-dates-head .lead-inner {
  max-width: 60ch;
  margin-top: 8px;
}

.school-dates-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 840px;
  margin-bottom: 16px;
}

.school-dates-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--paper);
}

.school-dates-choice-follow {
  background: var(--indigo-tint);
}

.school-dates-choice p,
.school-dates-lookup p {
  margin: 8px 0 18px;
  color: var(--body);
  font: 400 16px/1.55 var(--text);
}

.school-dates-choice > a {
  margin-top: auto;
}

.school-dates-lookup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  max-width: 840px;
  margin-bottom: 32px;
  padding: 18px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
}

.school-dates-lookup .h2-sub,
.school-dates-lookup p {
  margin-bottom: 0;
}

.school-dates-email {
  max-width: 640px;
  padding-top: 24px;
  border-top: 1px solid var(--border-strong);
  scroll-margin-top: 24px;
}

.school-dates-email .h2-sub {
  margin-bottom: 8px;
}

.school-dates-email .td-search,
.school-dates-email .td-noscript {
  margin-top: 18px;
}

.school-dates-email .td-status:empty {
  margin-top: 0;
  min-height: 0;
}

.january-dates [hidden] {
  display: none;
}

.january-head .h2 {
  margin: 8px 0;
}

.january-filter {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 10px 16px;
  max-width: 760px;
}

.january-filter .td-input {
  margin-top: 6px;
  min-height: 48px;
}

.january-dates :is(a, button, input, select):focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
}

.january-filter .td-status {
  grid-column: 1 / -1;
  margin: 0;
}

.january-borough-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.january-borough-links a,
.january-head a,
.january-email-link a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.january-email-link {
  margin: 8px 0 0;
}

.january-no-results {
  max-width: 640px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--paper);
  color: var(--body);
}

.january-no-results p {
  margin: 0;
}

.january-borough {
  margin: 32px 0;
  scroll-margin-top: 24px;
}

.january-borough .h2-sub {
  margin-bottom: 10px;
}

.january-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  padding: 14px 18px;
}

.january-result .td-result-where,
.january-result-source {
  grid-column: 1;
}

.january-result time {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--ink);
  font: 700 15px/1.45 var(--text);
}

.january-result-source {
  justify-self: start;
  font: 400 14px/1.5 var(--text);
}

.january-result a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.january-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  color: var(--body);
  font: 600 14px/1.5 var(--text);
}

.january-pagination button:disabled {
  opacity: .6;
  cursor: default;
}

.january-follow {
  margin: 32px 0;
}

@media (max-width: 560px) {
  .school-dates-choices,
  .january-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .school-dates-choice,
  .school-dates-lookup {
    padding: 18px;
  }

  .january-result {
    grid-template-columns: minmax(0, 1fr);
  }

  .january-result time {
    grid-column: 1;
    grid-row: auto;
  }
}

/* The term-dates paid landing (site/term-dates-landing.js puts the class on <html>): the school
   search straight under the heading, so a phone shows the label, the hint and the whole field
   before any scroll. The order below draws it there from the first paint; the script then moves
   the section to the same place in the page, for screen readers and the Tab key. */
.td-paid-landing .td-page {
  display: flex;
  flex-direction: column;
}

.td-paid-landing .td-page > .td-head {
  order: -2;
  padding-top: 24px;
  padding-bottom: 16px;
}

.td-paid-landing .td-page > .school-dates-email {
  order: -1;
  margin-bottom: 32px;
  padding-top: 0;
  border-top: 0;
}

/* The label and hint say what these did, so they go; the section's heading stays for screen readers. */
.td-paid-landing .td-head .lead-inner,
.td-paid-landing .school-dates-email > .lead-inner {
  display: none;
}

.td-paid-landing .school-dates-email > .h2-sub {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.td-paid-landing .school-dates-email .td-search {
  margin-top: 0;
}

/* Shown from the first paint, before site/term-dates.js has run (which adds td-ready). After that
   the form's hidden attribute decides again: closed or paused, it goes. */
.td-paid-landing:not(.td-ready) #td-search[hidden] {
  display: block !important;
}
