/* ==========================================================================
   lc-super-search.css — the super search page (/homes/).
   Paired with lc-super-search.php (server-rendered rack) and lc-super-search.js.
   Tokens are the /listings/ set from lc-listings.css — one visual system across
   the real-estate surfaces, so a visitor moving between them never re-learns it.
   Card rules mirror lc-listings.css deliberately, including the 13px attribution
   footer: NAR IDX 7.58 sizes that line off the card's median type, and the
   constraint travels with the card wherever it renders.
   ========================================================================== */

.lc-ss {
  --lc-ink:      #1d2721;
  --lc-muted:    #6b7772;
  --lc-line:     #e3e6e3;
  --lc-bg:       #ffffff;
  --lc-bg-soft:  #f6f7f5;
  --lc-accent:   #2f6f57;
  --lc-gold:     #b8863b;
  --lc-shadow:   0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);

  box-sizing: border-box;
  color: var(--lc-ink);
  font-size: 15px;
  line-height: 1.4;
  padding-bottom: 48px;
}
.lc-ss *, .lc-ss *::before, .lc-ss *::after { box-sizing: border-box; }

/* ---- shared control vocabulary ----------------------------------------- */
.lc-ss input[type="text"],
.lc-ss input[type="search"],
.lc-ss input[type="number"],
.lc-ss select {
  height: 38px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--lc-line);
  border-radius: 8px;
  background: var(--lc-bg);
  color: var(--lc-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.lc-ss input::placeholder { color: #9aa49f; }
.lc-ss input:hover, .lc-ss select:hover { border-color: #c9cfcb; }
.lc-ss input:focus, .lc-ss select:focus {
  border-color: var(--lc-accent);
  box-shadow: 0 0 0 3px rgba(47,111,87,.14);
}
.lc-ss :focus-visible { outline: 2px solid var(--lc-accent); outline-offset: 2px; }
.lc-ss input:focus, .lc-ss select:focus { outline: none; }

.lc-ss button { font: inherit; cursor: pointer; }
.lc-ss button:disabled { opacity: .55; cursor: default; }

.lc-ss__lab {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--lc-muted);
  margin: 0 0 4px;
}
.lc-ss__field { display: block; min-width: 0; }

.lc-ss__pair { display: flex; align-items: center; gap: 6px; }
.lc-ss__pair input { width: 0; flex: 1 1 0; }
.lc-ss__dash { color: var(--lc-muted); }

/* ---- the sentence box --------------------------------------------------- */
.lc-ss__lede {
  flex-basis: 100%;
  margin: 0 0 2px;
  font-size: 15.5px;
  color: var(--lc-ink);
  max-width: 72ch;
}

.lc-ss__nl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.lc-ss__nl-input {
  flex: 1 1 320px;
  height: 46px !important;
  font-size: 15px !important;
}
.lc-ss__nl-go {
  height: 46px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  background: var(--lc-accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, transform .1s;
}
.lc-ss__nl-go:hover { background: #275c48; }
.lc-ss__nl-go:active { transform: translateY(1px); }
.lc-ss__nl-msg {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--lc-muted);
}

/* ---- chips: the one place the whole applied state is visible ------------ */
.lc-ss__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.lc-ss__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 12px;
  border: 1px solid rgba(47,111,87,.35);
  border-radius: 999px;
  background: rgba(47,111,87,.08);
  color: var(--lc-accent);
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.lc-ss__chip:hover { background: rgba(47,111,87,.16); border-color: var(--lc-accent); }
.lc-ss__chip i { font-style: normal; font-size: 15px; line-height: 1; }

/* ---- the board: strip + rack as ONE instrument -------------------------- *
 * The strip is the board's top row and the rack its tinted lower half, inside a
 * single border — a compact search with an optional annex is exactly the reading
 * this page must not have, because the depth IS the page. */
.lc-ss__form {
  margin: 0 0 18px;
  background: var(--lc-bg);
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  box-shadow: var(--lc-shadow);
  overflow: hidden;
}

.lc-ss__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  padding: 16px 20px;
}
.lc-ss__primary > .lc-ss__field { flex: 0 1 auto; }
.lc-ss__primary select { width: auto; min-width: 110px; }
.lc-ss__primary .lc-ss__field--range { flex: 0 1 230px; }
.lc-ss__primary .lc-ss__field--range input { min-width: 0; }

/* Segmented radios — one control, not six buttons. */
.lc-ss__field--seg { border: 0; padding: 0; margin: 0; }
.lc-ss__field--seg legend { padding: 0; }
.lc-ss__seg {
  display: inline-flex;
  border: 1px solid var(--lc-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--lc-bg);
}
.lc-ss__seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lc-ss__seg label {
  padding: 0 12px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  color: var(--lc-ink);
  cursor: pointer;
  border-left: 1px solid var(--lc-line);
  transition: background .15s, color .15s;
  user-select: none;
}
.lc-ss__seg label:first-of-type { border-left: 0; }
.lc-ss__seg label:hover { background: var(--lc-bg-soft); }
.lc-ss__seg input:checked + label {
  background: var(--lc-accent);
  color: #fff;
}
.lc-ss__seg input:focus-visible + label {
  outline: 2px solid var(--lc-accent);
  outline-offset: -2px;
}

/* Toggle chip (waterfront, new construction). */
.lc-ss__chiptoggle {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--lc-line);
  border-radius: 999px;
  background: var(--lc-bg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--lc-ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
}
.lc-ss__chiptoggle:hover { border-color: #c9cfcb; background: var(--lc-bg-soft); }
.lc-ss__chiptoggle input { position: absolute; opacity: 0; pointer-events: none; }
.lc-ss__chiptoggle:has(input:checked) {
  background: var(--lc-accent);
  border-color: var(--lc-accent);
  color: #fff;
}
.lc-ss__chiptoggle:has(input:focus-visible) {
  outline: 2px solid var(--lc-accent);
  outline-offset: 2px;
}

/* ---- the rack ----------------------------------------------------------- */
/* Column flow rather than a grid: seven groups of very different heights pack the
   columns instead of leaving a one-control group alone in a tall cell. Always open,
   at every width — no toggle stands between the visitor and the depth. At narrow
   widths it must be plain block flow, never `columns: 1`: a height-capped multicol
   fragments its overflow into horizontal columns instead of scrolling. */
.lc-ss__rack {
  columns: 3;
  column-gap: 32px;
  padding: 4px 20px 14px;
  background: var(--lc-bg-soft);
  border-top: 1px solid var(--lc-line);
}
.lc-ss__group {
  border: 0;
  margin: 0;
  padding: 14px 0 10px;
  min-width: 0;
  break-inside: avoid;
  width: 100%;
}
.lc-ss__group legend {
  padding: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--lc-muted);
  margin-bottom: 10px;
}
.lc-ss__group .lc-ss__field { margin-bottom: 10px; }
.lc-ss__group .lc-ss__field:last-child { margin-bottom: 0; }
.lc-ss__group .lc-ss__chiptoggle { margin-top: 2px; align-self: flex-start; }

.lc-ss__quiet {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--lc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lc-ss__formfoot { padding: 8px 20px 12px; background: var(--lc-bg-soft); }
.lc-ss__formfoot:empty { display: none; }
.lc-ss__clear {
  border: none;
  background: none;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--lc-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.lc-ss__clear:hover { color: var(--lc-ink); }

/* ---- results head ------------------------------------------------------- */
.lc-ss__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 6px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--lc-line);
}
.lc-ss__count { margin: 0; flex: 1 1 auto; color: var(--lc-muted); font-size: 14px; }
.lc-ss__count b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--lc-ink);
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.lc-ss__sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lc-muted); }
.lc-ss__sort select { width: auto; height: 34px; font-size: 13.5px; }

/* The floating live count: while the results head sits below the viewport, the
   number a filter change produced is still visible, and tapping it jumps down. */
.lc-ss__jump {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  z-index: 900;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 999px;
  background: var(--lc-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  transition: opacity .2s, transform .2s;
}
.lc-ss__jump:hover { background: #275c48; }
.lc-ss__jump b { font-variant-numeric: tabular-nums; }
.lc-ss__jump { white-space: nowrap; max-width: calc(100vw - 32px); }
.lc-ss__jump[hidden] { display: none; }
@media (max-width: 820px) {
  /* Clear of the site bottom bar. */
  .lc-ss__jump { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
.lc-ss__head { scroll-margin-top: 96px; }

/* ---- results grid + cards ----------------------------------------------- */
.lc-ss__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--lc-bg);
  border: 1px solid var(--lc-line);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .18s, transform .18s;
}
.lc-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.lc-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e7eae8;
  overflow: hidden;
}
.lc-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-card__noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--lc-muted);
  font-size: 13px;
  background: var(--lc-bg-soft);
}
.lc-card__ribbon {
  position: absolute;
  top: 10px; left: 0;
  background: var(--lc-gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 0 4px 4px 0;
}
.lc-card__save {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92); color: #8a9490;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .1s, color .12s;
}
.lc-card__save:hover { transform: scale(1.08); color: #d6455f; }
.lc-card__save.is-on { color: #d6455f; }
.lc-card__save svg { display: block; fill: currentColor; }

.lc-card__body { padding: 10px 12px 12px; }
.lc-card__price {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--lc-ink);
  line-height: 1.1;
}
.lc-card__meta { margin-top: 4px; font-size: 13px; color: var(--lc-ink); }
.lc-card__meta b { font-weight: 700; }
.lc-card__addr {
  margin-top: 6px;
  font-size: 13px;
  color: var(--lc-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lc-card__sub {
  font-size: 12px;
  color: var(--lc-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: 2px;
}
/* NAR IDX 7.58: no smaller than the card's median type (13px here), full ink.
   Ranked as a footer by the hairline and space, never by size or fading. */
.lc-card__attrib {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--lc-line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--lc-ink);
}

/* ---- loading / empty / error ------------------------------------------- */
.lc-ss__skel {
  border: 1px solid var(--lc-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--lc-bg);
}
.lc-ss__skel-media { aspect-ratio: 4 / 3; }
.lc-ss__skel-line { height: 14px; margin: 12px 12px 0; border-radius: 4px; }
.lc-ss__skel-line--short { width: 55%; margin-bottom: 14px; }
.lc-ss__skel-media, .lc-ss__skel-line {
  background: linear-gradient(90deg, #eef0ee 25%, #f7f8f7 42%, #eef0ee 58%);
  background-size: 300% 100%;
  animation: lc-ss-shimmer 1.3s ease-in-out infinite;
}
@keyframes lc-ss-shimmer {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}

.lc-ss__state {
  padding: 44px 20px;
  text-align: center;
  border: 1px dashed var(--lc-line);
  border-radius: 12px;
  background: var(--lc-bg-soft);
}
.lc-ss__state p {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  color: var(--lc-ink);
}

.lc-ss__more { text-align: center; margin-top: 22px; }
.lc-ss__more button {
  height: 44px;
  padding: 0 26px;
  border: 1px solid var(--lc-accent);
  border-radius: 8px;
  background: var(--lc-bg);
  color: var(--lc-accent);
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.lc-ss__more button:hover { background: var(--lc-accent); color: #fff; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1100px) {
  .lc-ss__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lc-ss__rack { columns: 2; }
}

@media (max-width: 820px) {
  .lc-ss__grid { gap: 12px; }
  .lc-ss__primary { padding: 12px 14px; gap: 10px 12px; }
  .lc-ss__primary select { min-width: 96px; }
  /* One column, block flow — a height-capped multicol fragments sideways. */
  .lc-ss__rack { columns: auto; padding: 4px 14px 12px; }
  .lc-ss__formfoot { padding: 8px 14px 12px; }
}

@media (max-width: 640px) {
  .lc-ss__grid { grid-template-columns: 1fr; }
  .lc-ss__count b { font-size: 22px; }
  .lc-ss__nl-input { height: 44px !important; }
  .lc-ss__nl-go { height: 44px; }
}

/* ---- embedded on /listings/: the "All filters" panel --------------------- *
 * The same shell docks inside the map app's own bar (.lc-bar is the positioning
 * context). Desktop: a full-width panel directly under the bar. Mobile: the map
 * page's surface is the map, so the button gates entry — but inside, the rack is
 * open with no second collapse. */
.lc-ss--embed { display: none; padding-bottom: 0; text-align: left; }
/* While the panel is open the bar must clear the map's own controls (Leaflet zoom
   runs ~z1000 against the bar's 500) or they print through the panel. */
body.lc-ss-open .lc-bar { z-index: 1100; }
.lc-ss--embed:focus { outline: none; }
.lc-ss--embed.is-open { display: block; }
.lc-bar .lc-ss--embed {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--lc-bg);
  border-bottom: 1px solid var(--lc-line);
  box-shadow: 0 18px 32px rgba(0,0,0,.16);
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.lc-ss--embed .lc-ss__nl { margin: 8px 0 12px; padding: 0 16px; }
.lc-ss--embed .lc-ss__chips { padding: 0 16px; }
.lc-ss--embed .lc-ss__form {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.lc-ss--embed .lc-ss__rack { columns: 3; }

.lc-ss__panelbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 2px;
}
.lc-ss__panel-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lc-muted);
}
.lc-ss__panel-done {
  height: 34px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: var(--lc-accent);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  transition: background .15s;
}
.lc-ss__panel-done:hover { background: #275c48; }

/* 960px is the map app's own mobile breakpoint, not this module's 820. The open
   overlay is reparented to <body> by the JS (the fixed bar's stacking context
   would otherwise cap it below the bottom nav), so the selector must not require
   a bar ancestor. */
@media (max-width: 960px) {
  .lc-ss--embed.is-open {
    position: fixed;
    inset: 0;
    max-height: none;
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--lc-bg);
    border-bottom: 0;
    padding-bottom: 32px;
  }
  .lc-ss--embed .lc-ss__rack { columns: auto; }
  .lc-ss__panelbar { position: sticky; top: 0; background: var(--lc-bg); z-index: 5; padding-bottom: 8px; box-shadow: 0 1px 0 var(--lc-line); }
}
@media (min-width: 961px) and (max-width: 1250px) {
  .lc-ss--embed .lc-ss__rack { columns: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-ss *, .lc-ss *::before, .lc-ss *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
