/* ==========================================================================
   Block: Hero (includes/blocks/hero.php)
   Depends on css/tokens.css
   ========================================================================== */

/*
 * The section sits above the ones that follow so the city dropdown, which
 * hangs past the bottom edge, is not painted over by the next section. Its
 * inner wrapper and the next section's both sit at z-index 1, and without
 * this the later one in the document wins.
 */
.hero-search {
    position: relative;
    z-index: 10;
    overflow: visible;
    background: var(--cloud);
    font-family: var(--font-body);
}

/* Background ---------------------------------------------------------- */
.hero-search__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-search__bg-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: .4;
}

.hero-search__bg-veil {
    position: absolute;
    inset: 0;
    background: rgba(51, 65, 85, .04);
}

/* Shell --------------------------------------------------------------- */
.hero-search__inner {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-9) var(--gutter);
}

.hero-search__grid {
    display: grid;
    align-items: center;
    gap: var(--space-8);
}

@media (min-width: 1024px) {
    .hero-search__grid {
        grid-template-columns: 1.1fr .9fr;
    }
}

/* Badge --------------------------------------------------------------- */
.hero-search__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--brand-50);
    box-shadow: 0 0 0 1px var(--brand-100);
    color: var(--brand-600);
    font-size: var(--text-caption);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    line-height: 1.2;
}

.hero-search__badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent-500);
}

/* Headline ------------------------------------------------------------ */
.hero-search__title {
    margin: var(--space-5) 0 0;
    font-family: var(--font-display);
    /* Steps up to the h1 token once there is room for it. */
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -.025em;
    color: var(--ink-900);
}

@media (min-width: 640px) {
    .hero-search__title {
        font-size: var(--text-h1);
    }
}

.hero-search__title-break {
    display: none;
}

@media (min-width: 640px) {
    @media (min-width: 640px) {
    .hero-search__title {
        font-size: var(--text-h1);
    }
}

.hero-search__title-break {
        display: block;
    }
}

/* Hand-drawn underline stroke under the second line */
.hero-search__title-mark {
    position: relative;
    display: inline-block;
}

.hero-search__title-mark::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -.15em;
    left: 0;
    height: .42em;
    background-image: var(--underline-image);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* Trust row ----------------------------------------------------------- */
.hero-search__trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5);
    margin-top: var(--space-6);
    color: var(--ink-900);
    font-size: var(--text-small);
    font-weight: 600;
}

.hero-search__trust-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.hero-search__trust-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--brand-600);
}

/* Checklist ----------------------------------------------------------- */
.hero-search__list {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-search__list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-lead);
    line-height: 1.5;
    color: var(--ink-700);
}

.hero-search__tick {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: var(--space-1);
    border-radius: 50%;
    background: var(--brand-600);
    color: #fff;
}

.hero-search__tick svg {
    width: 14px;
    height: 14px;
}

/* Search panel -------------------------------------------------------- */
.hero-search__panel {
    margin-top: var(--space-8);
}

.hero-search__panel-inner {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    background: var(--brand-600);
    box-shadow: var(--ring-brand), var(--shadow-lg);
}

.hero-search__panel-head {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

@media (min-width: 640px) {
    .hero-search__panel-head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.hero-search__eyebrow {
    margin: 0;
    color: var(--accent-300);
    font-size: var(--text-caption);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.hero-search__panel-title {
    margin: var(--space-1) 0 0;
    font-family: var(--font-display);
    font-size: var(--text-h4);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
}

.hero-search__panel-note {
    margin: 0;
    color: var(--ink-300);
    font-size: var(--text-small);
}

/* Search bar ---------------------------------------------------------- */
.hero-search__form {
    margin-top: var(--space-5);
}

.hero-search__bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: 1rem;
    background: var(--cloud);
    box-shadow: var(--ring-brand), var(--shadow-lg);
}

@media (min-width: 1024px) {
    .hero-search__bar {
        flex-direction: row;
        align-items: stretch;
    }
}

.hero-search__field {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color .18s ease;
}

.hero-search__field:hover {
    background: var(--mist);
}

.hero-search__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.hero-search__icon svg {
    width: 20px;
    height: 20px;
}

.hero-search__icon--brand {
    background: var(--brand-50);
    color: var(--brand-600);
}

.hero-search__icon--accent {
    background: rgba(245, 179, 1, .15);
    color: var(--accent-600);
}

.hero-search__field-body {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.hero-search__label {
    display: block;
    color: var(--ink-400);
    font-size: var(--text-caption);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .025em;
}

.hero-search__select-wrap {
    position: relative;
    display: block;
}

.hero-search__select,
.hero-search__input {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink-900);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.hero-search__select:focus,
.hero-search__input:focus {
    outline: none;
    box-shadow: none;
    background: transparent;
}

.hero-search__select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: var(--space-5);
    cursor: pointer;
}

.hero-search__input::placeholder {
    color: var(--ink-400);
    font-weight: 500;
    opacity: 1;
}

.hero-search__chevron {
    position: absolute;
    top: 50%;
    right: 0;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--ink-400);
    pointer-events: none;
    transition: transform .18s ease;
}

.hero-search__field:hover .hero-search__chevron {
    transform: translateY(-62%);
}

.hero-search__divider {
    display: none;
}

@media (min-width: 1024px) {
    .hero-search__divider {
        display: block;
        align-self: stretch;
        width: 1px;
        background: var(--border);
    }
}

/* Submit -------------------------------------------------------------- */
.hero-search__submit {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--brand-600);
    color: #fff;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color .18s ease, transform .1s ease;
}

.hero-search__submit svg {
    width: 20px;
    height: 20px;
}

.hero-search__submit:hover {
    background: var(--brand-700);
}

.hero-search__submit:active {
    transform: scale(.98);
}

/* Focus --------------------------------------------------------------- */
.hero-search__select:focus-visible,
.hero-search__input:focus-visible,
.hero-search__submit:focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Reveal -------------------------------------------------------------- */
.hero-search__reveal {
    animation: hero-search-fade-up .55s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes hero-search-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-search__reveal {
        animation: none;
    }

    .hero-search__submit,
    .hero-search__field,
    .hero-search__chevron {
        transition: none;
    }
}

/* City dropdown ------------------------------------------------------- */
.hero-search__field--city {
    position: relative;
}

.hero-search__cities {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    z-index: 30;
    width: max(100%, 18rem);
    max-height: 17rem;
    margin: 0;
    padding: var(--space-2);
    overflow-y: auto;
    list-style: none;
    border-radius: var(--radius-lg);
    background: var(--cloud);
    box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
}

.hero-search__cities[hidden] {
    display: none;
}

.hero-search__cities li {
    margin: 0;
}

.hero-search__cities li[hidden] {
    display: none;
}

.hero-search__city {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .12s ease;
}

.hero-search__city:hover,
.hero-search__city.is-active {
    background: var(--mist);
}

.hero-search__city-name {
    color: var(--ink-900);
    font-size: var(--text-base);
    font-weight: 600;
}

.hero-search__city-count {
    flex-shrink: 0;
    color: var(--ink-400);
    font-size: var(--text-small);
}

.hero-search__city--any {
    color: var(--ink-500);
    font-size: var(--text-base);
    font-weight: 500;
}

.hero-search__city-empty {
    padding: var(--space-2) var(--space-3);
    color: var(--ink-400);
    font-size: var(--text-small);
}

.hero-search__city-empty[hidden] {
    display: none;
}
