body.homepage {
    padding-top: 0;
}

/* Its position is part of the space reserved above the search fields. */
body.homepage .call-to-action {
    transition-property: color, background-color, box-shadow;
}

/* The global typography uses !important; keep this change inside the hero. */
.home-hero .search-box h1,
.home-hero button,
.home-hero select,
body.homepage > .select2-container--open input {
    font-family: 'Manrope', Arial, sans-serif !important;
}

.home-hero {
    --home-header-height: 96px;
    --home-field-height: 58px;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--home-header-height) + 24px) max(16px, 4vw) max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(18px, 3.5vh, 32px);
    font-family: 'Manrope', Arial, sans-serif;
    background: linear-gradient(180deg, rgba(2, 29, 47, .18), rgba(2, 29, 47, .29) 40%, rgba(2, 29, 47, .20)),
                var(--home-photo, none) center 53% / cover no-repeat #315465;
}

.home-hero + .home-container {
    margin-top: 0;
}

.home-hero .search-box.homepage {
    width: min(100%, 810px);
    flex-shrink: 0;
    padding: 0;
}

.home-hero .search-box h1 {
    margin: 0 0 clamp(16px, 3vh, 30px);
    font-family: 'Manrope', Arial, sans-serif;
    font-size: clamp(35px, 5.2vw, 66px) !important;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.12;
    color: #fff;
    text-shadow: 0 3px 24px rgba(0, 25, 40, .16);
    overflow-wrap: anywhere;
}

.home-search-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 76px;
    align-items: center;
    gap: 0;
    padding: 9px;
    border-radius: 17px;
    background: #fff;
    color: #223e4f;
    box-shadow: 0 12px 36px rgba(2, 24, 37, .17);
}

.home-search-fields > .select2-container,
.home-search-fields > select:not(.select2-hidden-accessible),
.home-hero .home-search-fields > .btn {
    width: 100% !important;
    min-width: 0;
    margin: 0;
}

.home-search-label { display: none; }

.home-search-fields > select:not(.select2-hidden-accessible) {
    height: var(--home-field-height);
}

.home-hero .home-search-fields > .btn {
    height: var(--home-field-height);
    padding: 8px 12px;
    float: none;
    border: 0;
    border-radius: 11px;
    background: #003c70;
    color: #fff;
    font-family: inherit;
    font-size: 21px;
    box-shadow: none;
}

.home-hero .home-search-fields > .btn:hover,
.home-hero .home-search-fields > .btn:focus {
    background: #002b50;
}

.home-search-fields > .select2-container { float: none; }

.home-search-fields > .townSearchList + .select2-container {
    border-left: 1px solid #e2e8ed;
}

.home-search-fields .select2-container .select2-selection--single {
    height: var(--home-field-height);
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.home-search-fields .select2-container .select2-selection__rendered {
    height: var(--home-field-height);
    padding: 0 25px 0 16px;
    color: #223e4f;
}

.home-search-fields .select2-container .select2-selection__arrow {
    height: var(--home-field-height);
    padding: 0;
    top: 0;
    right: 7px;
}

.home-hero .home-search-fields .select2-container .selected {
    height: var(--home-field-height);
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.home-hero .home-search-fields .select2-container .selected > span {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    float: none;
    height: 24px;
    width: 24px;
    margin: 0;
    padding: 0;
    font-size: 21px;
    line-height: 24px;
    color: #526977;
}

.home-hero .home-search-fields .select2-container .selected > strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    flex-shrink: 0;
    margin: 0 0 0 34px;
    font-size: 15px;
    font-weight: 600;
    line-height: 19px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.home-hero .home-search-fields .select2-container .selected > small {
    flex-shrink: 0;
    margin: 0 0 0 34px;
    color: #526977;
    font-size: 12px;
    line-height: 16px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-hero .home-search-fields .select2-container .selected b { font-size: inherit; }
.home-hero .home-search-fields .select2-container .selected > small:empty { display: none; }
.home-search-fields .select2-container .placeholder > span,
.home-search-fields .select2-container .placeholder > small { display: none; }

.home-search-fields .select2-container .select2-selection:focus-visible,
.home-hero .btn:focus-visible {
    outline: 3px solid #437fa9;
    outline-offset: 2px;
}

@media (max-height: 480px) and (orientation: landscape) {
    .home-hero .home-search-fields .select2-container .selected:not(.placeholder) {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: var(--home-field-height);
        padding: 0;
    }

    .home-hero .home-search-fields .select2-container .selected > span { display: none; }

    .home-hero .home-search-fields .select2-container .selected:not(.placeholder) > strong {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        margin: 0;
        overflow: hidden;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 15px;
    }

    .home-hero .home-search-fields .select2-container .selected > small {
        margin: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        line-height: 14px;
    }
}

/* Select2 adds its open dropdown directly to the body. */
body.homepage > .select2-container--open {
    width: auto !important;
    font-family: 'Manrope', Arial, sans-serif;
}

body.homepage > .select2-container--open .select2-dropdown {
    border-color: #d6e0e6;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(2, 24, 37, .16);
}

body.homepage > .select2-container--open .select2-search__field {
    font-family: 'Manrope', Arial, sans-serif;
    font-size: 16px;
    min-height: 44px;
    border-radius: 6px;
}

body.homepage > .select2-container--open .select2-results__option {
    padding-bottom: 6px;
}

body.homepage > .select2-container--open .select2-results__option > div {
    height: auto;
    min-height: 50px;
}

@media (max-height: 480px) and (orientation: landscape) {
    body.homepage > .select2-container--open {
        position: fixed !important;
        top: calc(var(--home-list-top, 0px) + max(8px, env(safe-area-inset-top))) !important;
        left: calc(var(--home-view-left, 0px) + var(--home-view-width, 100%) * .08) !important;
        width: calc(var(--home-view-width, 100%) * .84) !important;
        z-index: 1051;
    }

    body.homepage > .select2-container--open .select2-dropdown {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        max-height: calc(100vh - 16px);
        max-height: calc(min(100svh, var(--home-list-height, 100svh)) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
        border: 1px solid #aaa;
        border-radius: 4px;
    }

    body.homepage > .select2-container--open .select2-results {
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    body.homepage > .select2-container--open .select2-results__option {
        padding-bottom: 6px;
    }

    body.homepage > .select2-container--open .select2-results__option > div {
        height: auto;
        min-height: 50px;
    }
}

.home-hero .home-search-fields .select2-container .placeholder strong {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--home-field-height);
    margin: 0;
    padding: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: clamp(15px, 1.6vw, 17px);
    font-weight: 500;
    line-height: 1.25;
}

.home-hero #ContentPlaceHolderMain_LinkVideoPanel {
    width: min(100%, 700px);
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    text-align: center;
}

.home-hero #ContentPlaceHolderMain_LinkVideoPanel > .home-promo-copy {
    margin: 0 0 16px;
    padding: clamp(18px, 2.7vh, 26px) clamp(20px, 3vw, 30px);
    border-radius: 17px;
    background: #fff;
    color: #223e4f;
    box-shadow: 0 12px 36px rgba(2, 24, 37, .13);
    text-align: left;
    overflow-wrap: anywhere;
}

.home-hero .home-promo-copy,
.home-hero #ContentPlaceHolderMain_LinkVideoPanel p {
    font-family: 'Manrope', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

.home-hero .home-promo-copy p {
    margin: 0 0 14px;
}

.home-hero .home-promo-copy p:last-child {
    margin-bottom: 0;
}

.home-hero #ContentPlaceHolderMain_LinkVideoPanel .home-promo-copy > p:first-child,
.home-hero .home-promo-copy summary {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.02em;
}

.home-hero .home-promo-copy summary {
    display: list-item;
    cursor: pointer;
}

.home-hero .home-promo-copy details[open] summary {
    margin-bottom: 14px;
}

.home-hero #ContentPlaceHolderMain_LinkVideo.btn {
    max-width: 100%;
    white-space: normal;
    font-family: 'Manrope', Arial, sans-serif;
    font-weight: 600;
    line-height: 1.5;
    padding: 12px 26px;
    border: 0;
    border-radius: 11px;
    min-height: 48px;
    background: #003c70;
    color: #fff;
    box-shadow: 0 8px 24px rgba(1, 25, 40, .19);
}

.home-hero #ContentPlaceHolderMain_LinkVideo.btn:hover,
.home-hero #ContentPlaceHolderMain_LinkVideo.btn:focus { background: #002b50; }

/* Translated editorial spans must not inherit the old standalone white box. */
.home-hero #ContentPlaceHolderMain_LinkVideoPanel .home-promo-copy span {
    display: inline;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: inherit;
    border-radius: 0;
}

/* Compact spacing before the existing disclosure is needed on short screens. */
.home-hero.home-hero--compact {
    --home-field-height: 48px;
    gap: 12px;
    padding-top: calc(var(--home-header-height) + 12px);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.home-hero.home-hero--compact .search-box h1 {
    font-size: clamp(28px, 4vw, 46px) !important;
    margin-bottom: 12px;
}
.home-hero--compact .home-search-fields { padding: 6px; }
.home-hero.home-hero--compact .home-search-fields .selected:not(.placeholder) > strong {
    line-height: 16px;
}
.home-hero.home-hero--compact .home-search-fields .selected > small { line-height: 14px; }
.home-hero.home-hero--compact #ContentPlaceHolderMain_LinkVideoPanel > .home-promo-copy {
    padding: 12px 20px;
    margin-bottom: 10px;
}
.home-hero--compact #ContentPlaceHolderMain_LinkVideoPanel p { line-height: 1.45; }
.home-hero--compact .home-promo-copy p { margin-bottom: 8px; }
.home-hero.home-hero--compact #ContentPlaceHolderMain_LinkVideoPanel .home-promo-copy > p:first-child,
.home-hero--compact .home-promo-copy summary { font-size: 17px; }

@media (max-width: 992px) {
    .home-hero { --home-header-height: 60px; }
}

@media (max-width: 599px) and (orientation: portrait) {
    .home-hero { --home-field-height: 50px; }
    /* Two title lines and the location must fit the 50px mobile control. */
    .home-hero .home-search-fields .select2-container .selected:not(.placeholder) > strong {
        line-height: 16px;
    }
    .home-hero .home-search-fields .select2-container .selected > small { line-height: 14px; }
    .home-search-fields { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .home-search-fields > .townSearchList + .select2-container {
        border-left: 0;
        border-top: 1px solid #e2e8ed;
    }
    .home-hero .home-search-fields > .btn { font-size: 16px; }
    .home-search-label { display: inline; }
}

@media (max-height: 520px) and (orientation: portrait) {
    .home-hero, .home-hero.home-hero--compact {
        --home-field-height: 44px;
        gap: 8px;
        padding-top: calc(var(--home-header-height) + 4px);
    }
    .home-hero .home-search-fields .select2-container .selected:not(.placeholder) > strong {
        line-height: 15px;
    }
}

@media (max-height: 480px) and (orientation: landscape) {
    .home-hero, .home-hero.home-hero--compact {
        --home-field-height: 44px;
        gap: 8px;
        padding-top: calc(var(--home-header-height) + 4px);
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }
    /* Override compact spacing: 2 x 15px + 14px fits the 44px control. */
    .home-hero .home-search-fields .select2-container .selected:not(.placeholder) > strong {
        line-height: 15px;
    }
    .home-hero .search-box h1,
    .home-hero.home-hero--compact .search-box h1 { margin-bottom: 6px; font-size: 26px !important; }
    .home-search-fields { padding: 5px; }
    .home-hero #ContentPlaceHolderMain_LinkVideoPanel > .home-promo-copy { margin-bottom: 6px; }
}

/* Leave room for the browser bars on phones held horizontally. */
@media (max-height: 300px) and (orientation: landscape) {
    .home-hero .search-box.homepage {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
        align-items: center;
        gap: 8px;
    }

    .home-hero .search-box h1,
    .home-hero.home-hero--compact .search-box h1 {
        margin: 0;
        font-size: clamp(18px, 3.8vw, 22px) !important;
    }

    .home-hero .home-search-fields .select2-container .placeholder strong {
        font-size: 14px;
        line-height: 1.1;
    }

    .home-hero #ContentPlaceHolderMain_LinkVideoPanel {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .home-hero #ContentPlaceHolderMain_LinkVideoPanel > .home-promo-copy,
    .home-hero.home-hero--compact #ContentPlaceHolderMain_LinkVideoPanel > .home-promo-copy {
        flex: 1;
        margin: 0;
        padding: 4px 10px;
    }

    .home-hero #ContentPlaceHolderMain_LinkVideo.btn {
        max-width: 40%;
    }
}
