/* ============================================================
   RealEstate Hup — Directory layer (archives + object singulars)
   Builds only on tokens from app.css (--rh-*). No new palette.
   Covers: page head, filter bar / mobile drawer, sort, result
   count, pagination, property-card variant, resale divider.
============================================================ */

/* ---- Object / archive page head ---- */
.rh-page-head{background:var(--rh-bg-soft);border-bottom:1px solid var(--rh-line)}
.rh-page-head__in{padding-block:40px 32px}
.rh-page-head .rh-eyebrow{display:block;margin-bottom:8px}
.rh-page-head h1{font-size:clamp(1.7rem,3vw,2.5rem)}
.rh-page-head p{color:var(--rh-muted);margin-top:10px;max-width:70ch}
.rh-crumbs{display:flex;flex-wrap:wrap;gap:6px;align-items:center;color:var(--rh-muted);font-size:.82rem;margin-bottom:16px}
.rh-crumbs a{color:var(--rh-muted)}
.rh-crumbs a:hover{color:var(--rh-primary)}
.rh-crumbs span[aria-hidden]{opacity:.6}

/* object hero (single area / developer) */
.rh-obj-hero{display:grid;grid-template-columns:auto 1fr;gap:22px;align-items:center}
.rh-obj-hero__logo{width:88px;height:88px;flex:none;border-radius:var(--rh-radius);background:var(--rh-white);border:1px solid var(--rh-line);display:grid;place-items:center;font-weight:800;color:var(--rh-primary);font-size:1.7rem}
.rh-obj-stats{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.rh-stat{display:inline-flex;align-items:center;gap:8px;background:var(--rh-white);border:1px solid var(--rh-line);border-radius:var(--rh-radius-pill);padding:8px 14px;font-weight:700;font-size:.85rem;color:var(--rh-ink-2)}
.rh-stat b{color:var(--rh-ink)}
.rh-stat .rh-price-em{color:var(--rh-accent)}

/* ---- Toolbar: results count + filters + sort ---- */
.rh-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:22px}
.rh-count{font-weight:700;color:var(--rh-ink-2);font-size:.92rem}
.rh-count b{color:var(--rh-ink)}
.rh-toolbar__spacer{margin-inline-start:auto}

/* filters form */
.rh-filters{display:contents}
.rh-filters-cbx{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip:rect(0 0 0 0)}
.rh-filters__open{display:none}
.rh-filters__scrim{display:none}
.rh-filters__panel{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.rh-filters__fields{display:flex;gap:10px;flex-wrap:wrap;flex:1;min-width:0}
.rh-filters__title{display:none}
.rh-fld{display:flex;flex-direction:column;gap:4px;background:var(--rh-bg-soft);border:1px solid var(--rh-line);border-radius:12px;padding:8px 12px;min-width:150px}
.rh-fld--grow{flex:1;min-width:220px}
.rh-fld label{font-size:.68rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--rh-muted)}
.rh-fld input,.rh-fld select{border:0;background:transparent;font-size:.95rem;color:var(--rh-ink);font-family:inherit;outline:none;width:100%}
.rh-filters__actions{display:flex;gap:8px;align-items:center}
.rh-filters__reset{color:var(--rh-muted);font-weight:700;font-size:.85rem;padding:10px 8px}
.rh-filters__reset:hover{color:var(--rh-primary)}

/* sort */
.rh-sort{display:flex;flex-direction:column;gap:4px;background:var(--rh-bg-soft);border:1px solid var(--rh-line);border-radius:12px;padding:8px 12px;min-width:170px}
.rh-sort label{font-size:.68rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--rh-muted)}
.rh-sort select{border:0;background:transparent;font-size:.95rem;color:var(--rh-ink);font-family:inherit;outline:none;width:100%}

/* active filter chips */
.rh-activef{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.rh-activef__chip{display:inline-flex;align-items:center;gap:6px;background:var(--rh-primary-050);color:var(--rh-primary-700);border-radius:var(--rh-radius-pill);padding:6px 12px;font-weight:700;font-size:.8rem}
.rh-activef__chip a{display:inline-flex;color:inherit;line-height:0}
.rh-activef__chip .rh-icn{width:14px;height:14px}
.rh-activef__clear{color:var(--rh-primary);font-weight:700;font-size:.8rem;padding:6px 4px;align-self:center}
.rh-activef__clear:hover{text-decoration:underline}
.rh-note--foot{margin-top:22px}

/* ---- Property card variant (distinct from project card) ---- */
.rh-card--prop{border-color:var(--rh-line-2)}
.rh-card--prop .rh-card__media{aspect-ratio:16/10}
.rh-badge--resale{background:var(--rh-ink-2)}
.rh-card__specs{display:flex;gap:14px;flex-wrap:wrap;color:var(--rh-ink-2);font-size:.82rem;margin-top:4px;padding-top:8px;border-top:1px dashed var(--rh-line)}
.rh-card__specs span{display:inline-flex;align-items:center;gap:5px}
.rh-card__specs .rh-icn{width:15px;height:15px;color:var(--rh-muted)}

/* ---- Resale divider / labelled section ---- */
.rh-block-label{display:flex;align-items:center;gap:12px;margin:8px 0 20px}
.rh-block-label h2{font-size:clamp(1.25rem,2vw,1.6rem)}
.rh-block-label .rh-tag{background:var(--rh-bg-soft);border:1px solid var(--rh-line);color:var(--rh-muted);border-radius:var(--rh-radius-pill);padding:4px 12px;font-weight:700;font-size:.75rem;letter-spacing:.03em;text-transform:uppercase}
.rh-note{color:var(--rh-muted);font-size:.85rem;max-width:70ch;margin-bottom:18px;line-height:1.6}

/* ---- Attribution / disclosure block ---- */
.rh-attrib{display:flex;gap:12px;background:var(--rh-bg-soft);border:1px solid var(--rh-line);border-radius:var(--rh-radius);padding:16px 18px;color:var(--rh-ink-2);font-size:.86rem;line-height:1.6}
.rh-attrib .rh-icn{width:20px;height:20px;flex:none;color:var(--rh-primary);margin-top:2px}

/* ---- Area / developer archive tiles: counts ---- */
.rh-area__ov .rh-area__count{display:inline-flex;align-items:center;gap:5px;margin-top:2px;font-weight:700}
.rh-dev__count{color:var(--rh-primary);font-weight:700}
.rh-dev__logo img{width:100%;height:100%;object-fit:contain;padding:8px;border-radius:inherit}
.rh-obj-hero__logo img{width:100%;height:100%;object-fit:contain;padding:10px;border-radius:inherit}

/* ---- Empty state ---- */
.rh-empty{text-align:center;padding:56px 20px;border:1px dashed var(--rh-line-2);border-radius:var(--rh-radius);background:var(--rh-bg-soft)}
.rh-empty .rh-icn{width:40px;height:40px;color:var(--rh-muted);margin:0 auto 14px}
.rh-empty h3{font-size:1.15rem}
.rh-empty p{color:var(--rh-muted);margin-top:8px}
.rh-empty a{color:var(--rh-primary);font-weight:700}

/* ---- Pagination (paginate_links output) ---- */
.rh-pagination{margin-top:36px;display:flex;justify-content:center}
.rh-pagination .nav-links{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.rh-pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:42px;padding:0 12px;border:1px solid var(--rh-line-2);border-radius:var(--rh-radius-btn);background:var(--rh-white);color:var(--rh-ink-2);font-weight:700;font-size:.92rem}
.rh-pagination a.page-numbers:hover{border-color:var(--rh-primary);color:var(--rh-primary)}
.rh-pagination .page-numbers.current{background:var(--rh-primary);border-color:var(--rh-primary);color:var(--rh-white)}
.rh-pagination .page-numbers.dots{border-color:transparent;background:transparent}

/* related chips (developers in area / areas of developer) */
.rh-chips{display:flex;flex-wrap:wrap;gap:10px}
.rh-chips a{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--rh-line-2);background:var(--rh-white);border-radius:var(--rh-radius-pill);padding:9px 16px;font-weight:700;font-size:.88rem;color:var(--rh-ink-2)}
.rh-chips a:hover{border-color:var(--rh-primary);color:var(--rh-primary)}
.rh-chips a b{color:var(--rh-primary)}

/* type grid reuse (discovery tiles) */
.rh-types-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}

/* utilities + lead-CTA helpers (kept token-based, no inline hex/px) */
.rh-section--soft{background:var(--rh-bg-soft)}
.rh-container--narrow{max-width:820px}
.rh-eyebrow--onlead{color:rgba(255,255,255,.82)}
.rh-lead__wa{margin-top:14px}
.rh-lead__legal{color:var(--rh-muted);text-align:center;display:block}
.rh-lead__legal a{color:var(--rh-primary);font-weight:700}
.rh-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* focus visibility (a11y) */
.rh-fld:focus-within,.rh-sort:focus-within{outline:2px solid var(--rh-primary-050);border-color:var(--rh-primary)}
.rh-pagination a.page-numbers:focus-visible,.rh-chips a:focus-visible,.rh-filters__open:focus-visible{outline:2px solid var(--rh-primary);outline-offset:2px}

/* ============ RESPONSIVE ============ */
@media(max-width:1100px){
  .rh-types-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:900px){
  /* Filters collapse into a right-side drawer opened by the toggle button */
  .rh-filters__open{display:inline-flex;order:-1}
  .rh-filters__panel{position:fixed;inset-block:0;inset-inline-end:0;width:min(88vw,360px);transform:translateX(100%);
    transition:transform .25s var(--rh-ease);z-index:70;background:var(--rh-white);flex-direction:column;
    align-items:stretch;gap:14px;overflow:auto;box-shadow:var(--rh-shadow-lg);padding:20px 18px calc(20px + env(safe-area-inset-bottom))}
  body.rh[dir="rtl"] .rh-filters__panel{inset-inline-end:auto;inset-inline-start:0;transform:translateX(-100%)}
  .rh-filters__title{display:flex;align-items:center;justify-content:space-between;font-size:1.1rem;font-weight:800}
  .rh-filters__title label{cursor:pointer;line-height:0;color:var(--rh-muted)}
  .rh-filters__fields{flex-direction:column}
  .rh-fld,.rh-fld--grow{min-width:0;width:100%}
  .rh-filters__actions{flex-direction:column;margin-top:auto}
  .rh-filters__actions .rh-btn{width:100%;justify-content:center}
  .rh-filters-cbx:checked ~ .rh-filters .rh-filters__panel{transform:translateX(0)}
  .rh-filters-cbx:checked ~ .rh-filters .rh-filters__scrim{display:block;position:fixed;inset:0;z-index:65;
    background:rgba(18,33,29,.45);border:0}
  .rh-sort{min-width:0;flex:1}
  .rh-types-grid{grid-template-columns:repeat(2,1fr)}
  .rh-obj-hero{grid-template-columns:1fr}
  .rh-obj-hero__logo{width:72px;height:72px}
}
@media(max-width:560px){
  .rh-toolbar{gap:10px}
  .rh-sort{width:100%}
  .rh-types-grid{grid-template-columns:1fr 1fr}
}
@media(prefers-reduced-motion:reduce){
  .rh-filters__panel{transition:none}
}
