/* Named layouts reuse the existing appearance/card tokens and compiled assets. */
.re-layout-home[data-home-preset] { color: var(--appearance-ink); }
.re-layout-home[data-home-preset] .re-hero-copy {
    color: var(--appearance-ink);
    max-width: 52rem;
    margin: 0;
}
.re-layout-home[data-home-preset] .re-hero-copy > p:last-child { color: var(--appearance-ink); }
.re-layout-home[data-home-preset] h1 { font-size: clamp(2rem, 4vw, 3.75rem); line-height: 1.15; }
.re-layout-home[data-home-preset] h2 { font-size: 1.5rem; font-weight: 650; margin-bottom: 1rem; }
.re-layout-home .re-property-grid { gap: var(--appearance-card-gap, 1.5rem); }
.re-home-categories { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.re-home-categories a {
    padding: .75rem 1rem;
    border: 1px solid var(--appearance-border);
    border-radius: var(--appearance-button-radius);
    background: var(--appearance-panel);
    color: var(--appearance-ink);
}
.re-home-categories a:focus-visible { outline: 3px solid var(--re-focus); outline-offset: 3px; }
.re-layout-home[data-home-preset="aura"] { padding-block: 3rem; }
.re-layout-home[data-home-preset="aura"] > div + div { margin-top: 3rem; }
.re-layout-home[data-home-preset="aura"] [data-layout-section="property-search"] {
    padding: 2rem;
    border: 1px solid var(--appearance-border);
    border-radius: var(--appearance-radius);
    background: var(--appearance-panel);
}
.re-layout-home[data-home-preset="edge"] > div + div { margin-top: 1rem; }
.re-layout-home[data-home-preset="edge"] :is(.re-layout-banner, .re-layout-agencies, .re-layout-cta) { padding: 1rem; }
@media (min-width: 1001px) {
    .re-layout-home[data-appearance-card="card-airy"] .re-property-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .re-layout-home[data-appearance-card="card-dense"] .re-property-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .re-layout-home[data-home-preset] { padding: 1rem; }
    .re-layout-home[data-home-preset="aura"] > div + div { margin-top: 1.5rem; }
    .re-layout-home[data-home-preset="aura"] [data-layout-section="property-search"] { padding: 1rem; }
    .re-layout-home .re-header-search { flex-wrap: wrap; padding: 0; }
    .re-layout-home .re-header-search > * { min-width: 0; }
    .re-home-categories a { flex: 1 1 40%; text-align: center; }
}

/* RE-459: homepage teasers only, including Core's legacy home composition.
   The shared Search template and Customer action attributes remain authoritative. */
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) > * { min-width: 0; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-property-card > .re-media { height: auto; max-height: 10rem; aspect-ratio: 2 / 1; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-property-card .re-card__body { padding: .75rem; gap: .375rem; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-property-card .re-card__body h2 {
    margin: 0; font-size: 1rem; line-height: 1.35;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-property-card .re-card__price { font-size: 1.25rem; margin: 0; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-card__body > p { margin: 0; font-size: .8125rem; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-card__body > ul.re-card__specs {
    flex-wrap: nowrap; gap: .5rem; font-size: .75rem; line-height: 1.5;
}
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-card__body > ul.re-card__specs > li { min-width: 0; white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-card__body > ul.re-card__specs svg { width: .875rem; height: .875rem; display: inline-block; vertical-align: middle; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-card__meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) .re-card__body > p:has(time),
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) [data-listing-agency] { color: var(--re-muted); font-size: .75rem; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) [data-listing-agency] { flex-wrap: nowrap; gap: .375rem; min-width: 0; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) [data-listing-agency] > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) [data-listing-agency] .re-avatar { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) [data-listing-agent],
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) [data-card-contacts] { display: none; }
:is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) [data-card-actions] { display: flex; gap: .5rem; margin-top: .125rem; }
@media (min-width: 640px) {
    :is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1001px) {
    /* Override both airy and dense preset grids for the homepage teaser. */
    body :is(.re-featured-compact, .re-home [data-home-section="featured"] .re-property-grid, .re-home [data-home-section="latest"] .re-property-grid) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* RE-460: Brand's homepage city/agency markup stays authoritative for links and
   counts. Scope every override to these two sections, never shared profile UI.
   Tile grounds use appearance tokens only: --brand-accent is a client-chosen line
   colour and may be dark, so it is never a background under text. */
.re-home :is([data-home-section="cities"] .re-city-grid, [data-home-section="agencies"] .re-agency-grid) {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem;
}
.re-home :is([data-home-section="cities"] .re-city-tile, [data-home-section="agencies"] .re-agency) {
    display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 1.25rem;
    grid-template-rows: auto auto; align-content: center; align-items: center;
    gap: .375rem 1rem; min-width: 0; min-height: 7.5rem; padding: 1rem;
    border: 1px solid var(--appearance-border); border-radius: var(--appearance-radius);
    background: linear-gradient(120deg, var(--appearance-panel), var(--appearance-surface));
    color: var(--appearance-ink); text-decoration: none;
    box-shadow: var(--re-shadow); transition: border-color .15s, box-shadow .15s;
}
.re-home :is([data-home-section="cities"] .re-city-tile, [data-home-section="agencies"] .re-agency):hover {
    border-color: var(--brand-primary); box-shadow: var(--re-shadow-raised, 0 4px 14px #0000001a);
}
.re-home :is([data-home-section="cities"] .re-city-tile, [data-home-section="agencies"] .re-agency):focus-visible {
    outline: 3px solid var(--re-focus); outline-offset: 3px;
}
.re-home :is([data-home-section="cities"] .re-city-tile, [data-home-section="agencies"] .re-agency) h3 {
    grid-column: 2; grid-row: 1; align-self: end; margin: 0;
    font-size: 1.125rem; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere;
}
.re-home :is([data-home-section="cities"] .re-city-tile, [data-home-section="agencies"] .re-agency) p {
    grid-column: 2; grid-row: 2; align-self: start; margin: 0;
    font-size: .875rem; line-height: 1.5; color: var(--re-muted); overflow-wrap: anywhere;
}
.re-home [data-home-section="cities"] .re-city-tile > span,
.re-home [data-home-section="agencies"] .re-agency > img,
.re-home [data-home-section="agencies"] .re-agency:not(:has(img))::before {
    position: static; grid-column: 1; grid-row: 1 / 3;
    display: grid; place-items: center; width: 4.5rem; height: 4.5rem;
    border-radius: var(--appearance-radius); background: var(--appearance-panel);
    color: var(--brand-primary); opacity: 1;
}
.re-home [data-home-section="cities"] .re-city-tile > span { font-size: 2.75rem; line-height: 1; }
.re-home [data-home-section="agencies"] .re-agency > img { object-fit: contain; padding: .5rem; box-sizing: border-box; }
.re-home [data-home-section="agencies"] .re-agency:not(:has(img))::before {
    content: "";
    background: var(--appearance-panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23475569' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M9 40V12l18-5v33M27 18h12v22M5 40h38M16 17h4m-4 7h4m-4 7h4m12-6h2m-2 7h2M18 40v-4h4v4'/%3E%3C/svg%3E") center / 2.5rem no-repeat;
}
.re-home :is([data-home-section="cities"] .re-city-tile, [data-home-section="agencies"] .re-agency)::after {
    content: ""; grid-column: 3; grid-row: 1 / 3; width: .5rem; height: .5rem;
    border-top: 2px solid var(--brand-primary); border-right: 2px solid var(--brand-primary); transform: rotate(45deg);
}
@media (min-width: 641px) {
    .re-home :is([data-home-section="cities"] .re-city-grid, [data-home-section="agencies"] .re-agency-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1001px) {
    .re-home :is([data-home-section="cities"] .re-city-grid, [data-home-section="agencies"] .re-agency-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .re-home :is([data-home-section="cities"] .re-city-tile, [data-home-section="agencies"] .re-agency) { transition: none; }
}
