/* RE-461: loaded only on the homepage. All rules belong to its hero/search.
   Text grounds, control borders and focus use neutral tokens: brand colours are
   client-chosen and are not assumed readable (see the shared UI catalogue). */
.re-home .re-home-hero,
.re-layout-home .re-home-hero { position: relative; isolation: isolate; background: #343b36; padding: clamp(2.5rem, 6vw, 5rem) max(var(--re-page-gutter), calc((100% - var(--re-page-max)) / 2 + var(--re-page-gutter))) 2rem; border-radius: 0; }
.re-home-hero .re-home-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; border-radius: inherit; z-index: -2; }
.re-home-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(20 30 28 / .7), rgb(20 30 28 / .65)); border-radius: inherit; z-index: -1; pointer-events: none; }
.re-home-hero .re-hero-copy,
.re-layout-home[data-home-preset] .re-home-hero .re-hero-copy { max-width: 52rem; margin: 0 auto 2rem; text-align: center; color: #fff; }
.re-home-hero .re-hero-copy h1 { font-size: clamp(2rem, 4vw, 3.75rem); line-height: 1.12; letter-spacing: -.035em; margin-bottom: 1rem; }
.re-home-hero .re-hero-copy > p,
.re-layout-home[data-home-preset] .re-home-hero .re-hero-copy > p:last-child,
.re-home-hero > .re-hero-trust { color: #fff; }
.re-home-hero .re-hero-trust { font-size: .875rem; margin-top: 1rem; text-align: center; }
/* RE-498: the homepage owns full-width surfaces; each content region owns one
   shared page gutter. Override Brand home.css .re-home/.re-section/.re-cta here
   without changing the container contract on other routes. No viewport units:
   a reserved scrollbar must not create horizontal overflow. */
.cms-index-index #maincontent { margin-block-start: 0; }
.cms-index-index #maincontent > .columns,
.cms-index-index #maincontent > .columns .column.main > .re-layout-home,
.cms-index-index .re-home {
    width: 100%; max-width: none; padding-inline: 0; margin-inline: 0;
}
.cms-index-index .re-layout-home[data-home-preset] { padding-block-start: 0; }
.cms-index-index .re-home > .re-section,
.cms-index-index .re-layout-home > [data-layout-section]:not([data-layout-section="hero"]) {
    box-sizing: border-box; width: 100%; max-width: var(--re-page-max);
    margin-inline: auto; padding-inline: var(--re-page-gutter);
}
.cms-index-index .re-home > .re-cta {
    box-sizing: border-box; width: calc(100% - 2 * var(--re-page-gutter));
    max-width: calc(var(--re-page-max) - 2 * var(--re-page-gutter)); margin-inline: auto;
}
.cms-index-index .re-layout-home[data-home-preset] > [data-layout-section="property-search"] {
    border: 0; border-radius: 0; background: none;
}
.cms-index-index .re-layout-home :is(.re-layout-agencies, .re-layout-stats, .re-layout-testimonials, .re-layout-map) {
    padding-inline: 0; border-inline-width: 0;
}

/* Keep the suggestion list and the filter panels above the following sections. */
.cms-index-index :is(.re-home, .re-layout-home) .re-home-hero { overflow: visible; z-index: 1; }
.cms-index-index :is(.re-home, .re-layout-home) .re-home-hero:has(.re-suggest-input[aria-expanded="true"]) {
    z-index: 40;
}
.re-home-search { position: relative; min-width: 0; color: var(--appearance-ink, #0f172a); }
.re-home-search [hidden] { display: none !important; }
.re-home-search .re-hero-categories {
    display: flex;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 8px;
    padding: 4px;
    background: #fff;
    border-radius: var(--appearance-radius, 1rem);
}
.re-home-search .re-hero-categories button {
    min-width: 0;
    min-height: 40px;
    padding: 4px clamp(6px, 2vw, 20px);
    border-radius: var(--appearance-button-radius, .5rem);
    white-space: nowrap;
    font-size: .875rem;
}
.re-home-search .re-hero-categories button[aria-selected="true"] {
    background: color-mix(in srgb, var(--brand-primary) 15%, white);
    font-weight: 700;
}
.re-home-search .re-hero-categories button:hover { text-decoration: underline; }
.re-home-search .re-hero-search-box {
    max-width: 848px;
    margin-inline: auto;
    padding: 16px;
    border: 1px solid var(--appearance-border, #e1e7e3);
    border-radius: var(--appearance-radius, 1rem);
    background: var(--appearance-panel, #fff);
    box-shadow: var(--re-shadow-overlay, 0 16px 40px #0002);
}
.re-home-search :is(.re-hero-form, .re-hero-directory-form, .re-hero-filters) {
    display: grid;
    gap: 12px;
    align-items: start;
}
.re-home-search .re-hero-form {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.re-home-search .re-hero-directory-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.re-home-search .re-hero-directory-agents { grid-template-columns: auto minmax(0, 1fr) auto; }
.re-home-search .re-hero-directory-agents .re-hero-city {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 40px;
    min-height: 40px;
}
.re-home-search .re-hero-filters {
    position: relative;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.re-home-search .re-search-tabs {
    display: flex;
    min-width: 0;
    height: 48px;
    margin: 0;
    gap: 0;
    padding: 3px;
    border: 1px solid var(--re-border, #64748b);
    border-radius: var(--appearance-button-radius, .5rem);
}
.re-home-search .re-search-tabs label {
    position: relative;
    flex: 1;
    display: grid;
    place-items: center;
    padding-inline: clamp(10px, 1.5vw, 18px);
    border-radius: var(--appearance-button-radius, .5rem);
    cursor: pointer;
    white-space: nowrap;
}
.re-home-search .re-search-tabs label:has(input:checked) {
    background: var(--re-surface-muted, #f1f5f9);
    font-weight: 700;
}
.re-home-search .re-search-tabs label:has(input:focus-visible) {
    outline: 2px solid var(--re-focus, #0f172a);
    outline-offset: -2px;
}
.re-home-search :is(.form-input, .form-select, .re-hero-filter-button, .re-hero-verified, .re-hero-submit) {
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    margin: 0;
    font-size: .875rem;
}
.re-home-search :is(.form-input, .form-select, .re-hero-filter-button, .re-hero-verified) {
    border: 1px solid var(--re-border, #64748b);
    border-radius: var(--appearance-button-radius, .5rem);
    background-color: var(--appearance-panel, #fff);
    color: var(--appearance-ink, #0f172a);
}
.re-home-search .re-hero-submit {
    justify-content: center;
    padding-block: 0;
    white-space: nowrap;
    background: var(--brand-primary);
    color: var(--re-primary-contrast, #fff);
    font-weight: 700;
    border-radius: var(--appearance-button-radius, .5rem);
}
.re-home-search .re-hero-filters :is(.form-input, .form-select, .re-hero-filter-button) {
    height: 40px;
    min-height: 40px;
}
.re-home-search .re-hero-verified {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-inline: 12px;
    cursor: pointer;
}
.re-home-search .re-hero-verified input { flex: none; width: 1rem; height: 1rem; margin: 0; }
.re-home-search :is(a, input, select, button):focus-visible {
    outline: 3px solid var(--re-focus, #0f172a);
    outline-offset: 2px;
}
.re-home-search .re-hero-categories button:focus-visible { outline-offset: -2px; }

.re-home-search .re-hero-filter { position: relative; min-width: 0; }
.re-home-search .re-hero-filter-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-inline: 12px;
    text-align: start;
}
.re-home-search .re-hero-filter-button > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.re-home-search .re-hero-filter-chevron {
    flex: none;
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-2px) rotate(45deg);
}
.re-home-search .re-hero-popover {
    display: grid;
    gap: 8px;
}
.re-home-search .re-hero-filter-ready .re-hero-popover {
    position: absolute;
    z-index: 50;
    inset-block-start: calc(100% + 4px);
    inset-inline-start: 0;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--appearance-border, #e1e7e3);
    border-radius: var(--appearance-button-radius, .5rem);
    background: var(--appearance-panel, #fff);
    box-shadow: var(--re-shadow-overlay, 0 16px 40px #0002);
}
.re-home-search .re-hero-popover-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.re-home-search .re-hero-popover-actions button {
    min-height: 36px;
    padding-inline: 10px;
    border-radius: var(--appearance-button-radius, .5rem);
    background: var(--re-surface-muted, #f1f5f9);
}
.re-home-search .re-hero-popover-actions button:last-child {
    background: var(--brand-primary);
    color: var(--re-primary-contrast, #fff);
    font-weight: 700;
}
.re-home-search .re-hero-directory-link {
    display: table;
    margin: 8px auto 0;
    color: #fff;
    font-size: .875rem;
    text-decoration: underline;
    text-underline-offset: .15em;
}
.re-home-search .re-hero-directory-link:focus-visible { outline-color: #fff; }

/* The shared suggestion label still names its editable input. */
.re-home-search .re-suggest > .re-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.re-home-search .re-suggest .re-suggest-control { margin: 0; }
.re-home-search .re-suggest > .re-suggest-list {
    position: absolute;
    inset: var(--re-suggest-top, calc(100% + 6px)) auto auto var(--re-suggest-left, 0px);
    width: var(--re-suggest-width, 100%);
    min-width: 0;
    max-height: min(400px, 60vh);
    max-height: min(400px, 60dvh, var(--re-suggest-height, 400px));
    margin-top: 0;
    text-align: start;
    border-color: var(--re-border, #64748b);
    border-radius: var(--appearance-button-radius, .5rem);
    background: var(--appearance-panel, #fff);
    box-shadow: var(--re-shadow, 0 2px 8px #0000001a);
}
.re-home-search .re-suggest-list .re-suggest-copy small {
    white-space: normal;
    overflow-wrap: anywhere;
}
.re-home-search .re-suggest mark { background: var(--re-surface-muted, #f1f5f9); color: inherit; font-weight: 700; }

@media (max-width: 767px) {
    .re-home-hero .re-hero-copy > p { font-size: .9375rem; }
    .re-home-search .re-hero-categories { margin-bottom: 4px; }
    .re-home-search .re-hero-search-box { padding: 12px; }
    .re-home-search :is(.re-hero-form, .re-hero-directory-form, .re-hero-filters) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .re-home-search :is(.re-search-tabs, .re-location, .re-hero-submit) { grid-column: 1 / -1; }
    .re-home-search .re-hero-form > .re-hero-submit { grid-row: 4; }
    .re-home-search .re-hero-directory-agents .re-hero-city { grid-column: auto; grid-row: auto; }
    .re-home-search .re-hero-filter { position: static; }
    .re-home-search .re-hero-filters > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 390px) {
    .re-home-search .re-hero-categories button { padding-inline: 6px; font-size: .8125rem; }
}

.re-hero-directory-suggest .re-suggest-input::-webkit-search-cancel-button { display: none; }
.re-hero-directory-suggest .re-hero-name-clear { flex: none; min-width: 24px; min-height: 24px; }

@media (max-width: 767px) {
    .re-home-search .re-hero-directory-suggest { grid-column: 1 / -1; }
}
