/*-- -------------------------- -->
<---      Homepage Tokens       -->
<--- -------------------------- -*/
@media only screen and (min-width: 0rem) {
  :root {
    --hpAccent: #F2A65A;
    --hpInk: #0c2233;
    --hpInkSoft: #16394f;
    --hpSurface: #f4f7f9;
    --hpBorder: #e2e8ee;
    --hpMuted: #6b7a88;
    --hpRadius: 0.875rem;
  }
}

/*-- -------------------------- -->
<---         Home Hero          -->
<--- -------------------------- -*/
/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
  #hero-home {
    /* leaves room for the fixed navigation */
    padding: clamp(9.5rem, 20vw, 13.5rem) 1rem clamp(3.5rem, 7vw, 5.5rem);
    overflow: hidden;
    position: relative;
    z-index: 1;
    isolation: isolate;
  }
  #hero-home .hp-hero-bg {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -2;
  }
  #hero-home .hp-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
  }
  #hero-home .hp-hero-bg:after {
    /* readability overlay */
    content: "";
    width: 100%;
    height: 100%;
    background: linear-gradient(
      180deg,
      rgba(8, 24, 36, 0.88) 0%,
      rgba(8, 24, 36, 0.66) 42%,
      rgba(8, 24, 36, 0.92) 100%
    );
    pointer-events: none;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
  }
  #hero-home .hp-hero-inner {
    text-align: center;
    width: 100%;
    max-width: 60rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
  }
  #hero-home .hp-eyebrow {
    font-size: clamp(0.75rem, 1.6vw, 0.8125rem);
    font-weight: 700;
    line-height: 1em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6.25rem;
    display: inline-block;
  }
  #hero-home .hp-hero-title {
    /* 39px - 72px */
    font-size: clamp(2.4375rem, 6.4vw, 4.5rem);
    font-weight: 900;
    line-height: 1.08em;
    letter-spacing: -0.02em;
    max-width: 18ch;
    margin: clamp(1.25rem, 3vw, 1.75rem) 0 0;
    color: #fff;
  }
  #hero-home .hp-hero-title em {
    font-style: normal;
    color: var(--hpAccent);
    white-space: nowrap;
  }
  #hero-home .hp-lead {
    font-size: clamp(1rem, 1.9vw, 1.1875rem);
    line-height: 1.6em;
    max-width: 38rem;
    margin: clamp(1rem, 2.5vw, 1.25rem) 0 0;
    color: rgba(255, 255, 255, 0.82);
  }

  /* Search card */
  #hero-home .hp-search {
    width: 100%;
    max-width: 52rem;
    /* prevents padding from affecting width */
    box-sizing: border-box;
    margin: clamp(1.75rem, 4vw, 2.5rem) 0 0;
    padding: 0.625rem;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 1.25rem 3rem rgba(4, 16, 26, 0.32);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  #hero-home .hp-field {
    text-align: left;
    flex: 1;
    min-width: 0;
    padding: 0.625rem 0.9375rem;
    background-color: var(--hpSurface);
    border-radius: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    position: relative;
    transition: background-color 0.3s, box-shadow 0.3s;
  }
  #hero-home .hp-field:focus-within {
    background-color: #fff;
    box-shadow: inset 0 0 0 2px var(--primary);
  }
  #hero-home .hp-field > span,
  #hero-home .hp-field > .hp-combo-caption {
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hpMuted);
  }
  #hero-home .hp-field input {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5em;
    width: 100%;
    padding: 0;
    background: transparent;
    color: var(--headerColor);
    border: none;
    outline: none;
  }
  #hero-home .hp-field input::placeholder {
    color: #9aa7b2;
  }
  #hero-home .hp-submit {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1em;
    letter-spacing: 0.02em;
    min-height: 3.5rem;
    padding: 0 1.75rem;
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0.625rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
  }
  #hero-home .hp-submit:hover {
    background-color: var(--secondary);
  }
  #hero-home .hp-submit svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
  }

  /* Popular city shortcuts */
  #hero-home .hp-popular {
    font-size: 0.9375rem;
    line-height: 1.5em;
    margin: clamp(1.25rem, 3vw, 1.5rem) 0 0;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.375rem 0.875rem;
  }
  #hero-home .hp-popular a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    transition: color 0.3s, border-color 0.3s;
  }
  #hero-home .hp-popular a:hover {
    color: var(--hpAccent);
    border-color: var(--hpAccent);
  }

  /* Stat strip */
  #hero-home .hp-hero-stats {
    width: 100%;
    max-width: 68rem;
    margin: clamp(2.75rem, 6vw, 4rem) auto 0;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1rem;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    position: relative;
    z-index: 2;
  }
  #hero-home .hp-hero-stats li {
    text-align: center;
    list-style: none;
    padding: clamp(1.125rem, 3vw, 1.625rem) 0.75rem;
    background-color: rgba(9, 27, 41, 0.62);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
  }
  #hero-home .hp-stat-num {
    /* 28px - 40px */
    font-size: clamp(1.75rem, 3.6vw, 2.5rem);
    font-weight: 900;
    line-height: 1em;
    color: #fff;
  }
  #hero-home .hp-stat-label {
    font-size: clamp(0.75rem, 1.5vw, 0.8125rem);
    font-weight: 700;
    line-height: 1.3em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.68);
  }
}
/* Tablet - 768px */
@media only screen and (min-width: 48rem) {
  #hero-home .hp-search {
    flex-direction: row;
    align-items: stretch;
  }
  #hero-home .hp-submit {
    flex: 0 0 auto;
  }
  #hero-home .hp-hero-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #hero-home * {
    transition: none !important;
  }
}
/* Dark Mode */
@media only screen and (min-width: 0rem) {
  body.dark-mode #hero-home .hp-search {
    background-color: var(--medium);
  }
  body.dark-mode #hero-home .hp-field {
    background-color: var(--accent);
  }
  body.dark-mode #hero-home .hp-field > span,
  body.dark-mode #hero-home .hp-field > .hp-combo-caption,
  body.dark-mode #hero-home .hp-field input {
    color: var(--bodyTextColorWhite);
  }
}

/*-- -------------------------- -->
<---   Hero State/City Picker   -->
<--- -------------------------- -*/
/* The two dependent comboboxes in the hero search card. They reuse .hp-field,
   so they inherit its surface, focus ring, and dark-mode colours; everything
   below is the popup, the locked state, and the hint line under the card.

   The popup is absolutely positioned inside .hp-field, so it would be cut off
   by the hero's own overflow:hidden, which is template boilerplate here, since
   the only absolutely positioned thing in the hero is the background picture,
   inset to exactly 100% x 100%. Turning it off lets a long list hang below the
   fold of the hero instead of being clipped mid-option. */
@media only screen and (min-width: 0rem) {
  #hero-home {
    /* see the note above: nothing in the hero overflows it but the popup */
    overflow: visible;
  }
  #hero-home .hp-hero-inner {
    /* above .hp-hero-stats, which is a later sibling at the same level. An
       open popup overlaps the stat strip and must paint over it */
    z-index: 3;
  }
  #hero-home .hp-combo {
    /* the popup anchors to this */
    position: relative;
  }
  #hero-home .hp-combo-caption {
    /* a <label>, so it needs the block/pointer behaviour the <span> got free */
    display: block;
    cursor: text;
  }
  #hero-home .hp-field input:disabled {
    cursor: not-allowed;
    color: var(--hpMuted);
  }
  #hero-home .hp-field-locked {
    opacity: 0.72;
  }
  #hero-home .hp-combo-list {
    width: 100%;
    max-height: 20rem;
    box-sizing: border-box;
    margin: 0;
    padding: 0.375rem;
    background-color: #fff;
    border: 1px solid var(--hpBorder);
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2.5rem rgba(4, 16, 26, 0.24);
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 20;
  }
  #hero-home .hp-combo-option {
    font-size: 0.9375rem;
    line-height: 1.3em;
    text-align: left;
    padding: 0.625rem 0.75rem;
    color: var(--hpInk);
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s, color 0.2s;
  }
  #hero-home .hp-combo-option:hover,
  #hero-home .hp-combo-option.active {
    background-color: var(--primary);
    color: #fff;
  }
  #hero-home .hp-combo-label {
    font-weight: 700;
  }
  #hero-home .hp-combo-sub {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--hpMuted);
    transition: color 0.2s;
  }
  #hero-home .hp-combo-option:hover .hp-combo-sub,
  #hero-home .hp-combo-option.active .hp-combo-sub {
    color: rgba(255, 255, 255, 0.82);
  }
  #hero-home .hp-combo-empty {
    font-size: 0.9375rem;
    text-align: left;
    padding: 0.625rem 0.75rem;
    color: var(--hpMuted);
  }
  #hero-home .hp-combo-empty:empty {
    display: none;
  }

  /* "Don't see your city?" is always the last option, and a route off this
     page rather than a city, so it reads as its own thing. */
  #hero-home .hp-combo-cta {
    font-size: 0.875rem;
    margin-top: 0.375rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hpBorder);
    border-radius: 0 0 0.5rem 0.5rem;
    color: var(--secondary);
  }
  #hero-home .hp-combo-cta .hp-combo-label {
    font-weight: 700;
    white-space: normal;
  }
  #hero-home .hp-combo-cta:hover,
  #hero-home .hp-combo-cta.active {
    background-color: var(--hpAccent);
    color: var(--hpInk);
  }

  /* Hint line under the search card: city counts, and validation prompts. */
  #hero-home .hp-hint {
    font-size: 0.875rem;
    line-height: 1.4em;
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
    color: rgba(255, 255, 255, 0.78);
  }
  #hero-home .hp-hint:empty {
    margin: 0;
  }
}
/* Dark Mode */
@media only screen and (min-width: 0rem) {
  body.dark-mode #hero-home .hp-combo-list {
    background-color: var(--medium);
    border-color: rgba(255, 255, 255, 0.14);
  }
  body.dark-mode #hero-home .hp-combo-option {
    color: var(--bodyTextColorWhite);
  }
  body.dark-mode #hero-home .hp-combo-cta {
    border-top-color: rgba(255, 255, 255, 0.14);
    color: var(--bodyTextColorWhite);
  }
}
