/* ============================================================================
 *  search.css — editorial-luxury real estate search  (lot3320.info preview)
 * ========================================================================== */

:root {
  --paper:      #f4efe6;
  --paper-2:    #ece4d6;
  --card:       #fffdf8;
  --ink:        #211e19;
  --ink-soft:   #514b41;
  --muted:      #8d8474;
  --line:       rgba(33, 30, 25, 0.10);
  --line-2:     rgba(33, 30, 25, 0.16);
  --pine:       #2f5446;
  --pine-700:   #234539;
  --pine-300:   #6f9384;
  --brass:      #b3894e;
  --brass-soft: #d8b988;
  --rose:       #a6483b;     /* pending / alerts */
  --shadow-sm:  0 1px 2px rgba(33,30,25,.06), 0 2px 8px rgba(33,30,25,.06);
  --shadow-md:  0 6px 22px rgba(33,30,25,.12), 0 2px 6px rgba(33,30,25,.08);
  --shadow-lg:  0 22px 60px rgba(33,30,25,.22);
  --r-card: 16px;
  --r-pill: 999px;
  --head-h: 64px;
  --filter-h: 60px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app {
  display: grid;
  grid-template-rows: var(--head-h) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ----------------------------------------------------------------- header -- */
/* Shared masthead styling lives in site.css (position:sticky + blurred paper).
   Kept in sync here so the search header matches the content pages on scroll. */
.masthead {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--head-h);
  padding: 0 26px;
  background: rgba(244, 239, 230, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--pine);
  border-radius: 9px;
  color: var(--pine);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .5px;
}
.brand__name {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: .2px;
  line-height: 1;
}
.brand__name small {
  display: block;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.nav { display: flex; gap: 26px; margin-left: 14px; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  padding: 6px 0; position: relative; letter-spacing: .2px;
  transition: color .18s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 1.5px; background: var(--pine); transition: right .22s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a.is-active::after { right: 0; }
.nav a.is-active { color: var(--ink); }
.masthead__right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.phone {
  font-family: var(--display); font-weight: 500; font-size: 16px;
  color: var(--ink); white-space: nowrap;
}
.btn-contact {
  background: var(--pine); color: #fff; border: none;
  padding: 10px 18px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; letter-spacing: .3px;
  box-shadow: var(--shadow-sm); transition: transform .15s, background .2s;
}
.btn-contact:hover { background: var(--pine-700); transform: translateY(-1px); }

/* --------------------------------------------- map tools (search + draw) -- */
.map-tools {
  position: absolute; top: 14px; left: 14px; z-index: 600;
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 96px);
}
/* filter pills row — sits directly above the listing tiles */
.results__filters {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center;
  padding: 12px 14px; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.search-field {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 10px 16px; min-width: 230px;
  box-shadow: var(--shadow-md);
  transition: border-color .18s, box-shadow .18s;
}
.search-field:focus-within { border-color: var(--pine-300); box-shadow: 0 0 0 3px rgba(47,84,70,.10); }
.search-field svg { color: var(--muted); flex: none; }
.search-field input {
  border: none; outline: none; background: none; width: 100%;
  font-size: 14px; color: var(--ink); font-family: var(--ui);
}
.search-field input::placeholder { color: var(--muted); }

.fbar-pills { display: flex; gap: 6px; flex-wrap: wrap; }
/* keep the right-most dropdowns from spilling outside the results panel */
.fbar-pills .pill:nth-last-child(-n+2) .popover { left: auto; right: 0; }
.pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 7px 11px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  white-space: nowrap; transition: border-color .16s, background .16s, color .16s;
}
.pill:hover { border-color: var(--pine-300); color: var(--ink); }
.pill.is-open { border-color: var(--pine); color: var(--ink); background: #fff; }
.pill.has-value { border-color: var(--pine); color: var(--pine-700); font-weight: 600; }
.pill .chev { transition: transform .2s; color: var(--muted); }
.pill.is-open .chev { transform: rotate(180deg); }

.tool-draw {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 10px 15px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  box-shadow: var(--shadow-md);
  transition: all .16s;
}
.tool-draw:hover { border-color: var(--brass); color: var(--ink); }
.tool-draw.is-active { background: var(--brass); border-color: var(--brass); color: #fff; box-shadow: var(--shadow-sm); }
.tool-draw svg { transition: transform .2s; }
.tool-draw.is-active svg { transform: rotate(-8deg); }

/* dropdown popovers */
.popover {
  position: absolute; top: calc(100% + 9px); left: 0;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 16px; width: max-content; min-width: 230px; z-index: 60;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.pill.is-open .popover { opacity: 1; transform: none; pointer-events: auto; }
.popover h4 {
  margin: 0 0 10px; font-family: var(--ui); font-size: 11px;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row .dash { color: var(--muted); }
.popover select, .popover .seg {
  font-family: var(--ui); font-size: 14px; color: var(--ink);
  border: 1px solid var(--line-2); background: var(--paper);
  border-radius: 9px; padding: 9px 11px; outline: none;
}
.popover select:focus { border-color: var(--pine-300); }
.segset { display: flex; gap: 6px; flex-wrap: wrap; }
.segset button {
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-soft);
  border-radius: 9px; padding: 8px 13px; font-size: 13.5px; font-weight: 600;
  transition: all .14s;
}
.segset button:hover { border-color: var(--pine-300); }
.segset button.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.checks { display: grid; gap: 9px; }
.checks label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.checks input { accent-color: var(--pine); width: 16px; height: 16px; }
.popover .clear {
  margin-top: 13px; width: 100%; background: none; border: none;
  color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
  text-align: left; padding: 0;
}
.popover .clear:hover { color: var(--rose); }

/* --------------------------------------------------------------- main body- */
.stage { display: grid; grid-template-columns: 1.7fr 1fr; min-height: 0; position: relative; }

/* map */
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--paper-2); }
.maplibregl-map { font-family: var(--ui); }
.maplibregl-ctrl-attrib { background: rgba(255,253,248,.82); border-radius: 8px; font-size: 10.5px; color: var(--ink-soft); }
.maplibregl-ctrl-attrib a { color: var(--ink-soft); }
.map-hint {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  background: rgba(33,30,25,.86); color: #fff; backdrop-filter: blur(6px);
  padding: 9px 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
  z-index: 500; box-shadow: var(--shadow-md); display: none; align-items: center; gap: 9px;
}
.map-hint.show { display: flex; }
.area-chip {
  position: absolute; left: 16px; bottom: 16px; z-index: 500;
  display: none; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--brass);
  color: var(--pine-700); font-weight: 600; font-size: 13px;
  padding: 8px 9px 8px 14px; border-radius: var(--r-pill); box-shadow: var(--shadow-md);
}
.area-chip.show { display: inline-flex; }
.area-chip button {
  border: none; background: var(--paper-2); color: var(--ink-soft);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; line-height: 1;
}
.area-chip button:hover { background: var(--rose); color: #fff; }

/* custom zoom (MapLibre NavigationControl) */
.maplibregl-ctrl-group {
  border: none !important; box-shadow: var(--shadow-md) !important;
  border-radius: 12px !important; overflow: hidden; background: var(--card) !important;
}
.maplibregl-ctrl-group button { width: 38px !important; height: 38px !important; background: var(--card) !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button:hover { background: var(--paper) !important; }
.maplibregl-ctrl-group .maplibregl-ctrl-icon { background-size: 19px 19px; }

/* price pins — clean white tags, legible on the light basemap */
.pin-wrap { background: none; border: none; }
.pin {
  display: inline-block; position: relative;
  transform-origin: bottom center;
  white-space: nowrap;
  background: var(--card); color: var(--pine-700);
  font-family: var(--ui); font-weight: 700; font-size: 12.5px; letter-spacing: .2px;
  padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid rgba(33,30,25,.14);
  box-shadow: 0 3px 8px rgba(33,30,25,.28);
  cursor: pointer;
  transition: transform .12s ease, background .12s, color .12s, box-shadow .12s, border-color .12s;
}
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -4px;
  width: 9px; height: 9px; background: var(--card);
  border-right: 1px solid rgba(33,30,25,.14); border-bottom: 1px solid rgba(33,30,25,.14);
  transform: translateX(-50%) rotate(45deg);
}
.pin.pending { color: var(--muted); }
.pin.is-fav { border-color: var(--brass); color: var(--brass); }
.pin.is-fav::before { content: "\2665"; margin-right: 4px; font-size: 10px; }
.pin:hover, .pin.is-active {
  background: var(--pine); color: #fff; border-color: var(--pine);
  box-shadow: 0 6px 16px rgba(33,30,25,.40);
  transform: scale(1.09);
}
.pin:hover::after, .pin.is-active::after { background: var(--pine); border-color: var(--pine); }
.pin:hover.is-fav, .pin.is-active.is-fav { color: #fff; border-color: var(--pine); }

/* ------------------------------------------------------------- listings ---- */
.results {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--paper); border-left: 1px solid var(--line);
}
.results__bar {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px 20px 10px;
}
.results__count { font-family: var(--display); font-size: 21px; font-weight: 500; }
.results__count b { font-weight: 600; }
.results__sub { font-size: 13px; color: var(--muted); }
.results__sort { margin-left: auto; }
.results__sort select {
  font-family: var(--ui); font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line-2); background: var(--card);
  border-radius: var(--r-pill); padding: 8px 12px; outline: none;
}
.results__grid {
  overflow-y: auto; padding: 18px; align-content: start; grid-auto-rows: max-content;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px;
}
.results__grid::-webkit-scrollbar { width: 10px; }
.results__grid::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--paper); }

/* card */
.card {
  align-self: start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .2s ease, border-color .2s;
  opacity: 0; transform: translateY(10px);
  animation: rise .5s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card:hover, .card.is-active { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brass-soft); }
.card__media { position: relative; height: 210px; background: linear-gradient(135deg, var(--paper-2), #dcd2c0); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.badge {
  position: absolute; bottom: 12px; left: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 6px 11px; border-radius: 7px; color: #fff; background: var(--pine);
  box-shadow: var(--shadow-md);
}
.badge.new { background: var(--brass); }
.badge.pending { background: var(--rose); }
.fav {
  position: absolute; bottom: 12px; right: 12px; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: rgba(255,253,248,.9); backdrop-filter: blur(4px);
  display: grid; place-items: center; color: var(--ink-soft); font-size: 18px; line-height: 1;
  box-shadow: var(--shadow-md); transition: transform .14s, color .14s, background .14s;
}
.fav:hover { transform: scale(1.12); }
.fav.on { color: var(--rose); background: #fff; }
.card__body { padding: 16px 17px 17px; }
.card__price { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: .2px; }
.card__specs { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 8px 0 9px; font-size: 14px; color: var(--ink-soft); }
.card__specs span { display: inline-flex; align-items: center; }
.card__specs b { font-weight: 700; color: var(--ink); }
.card__specs span + span::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--muted); margin: 0 9px; }
.card__addr { font-size: 14.5px; color: var(--ink); line-height: 1.45; }
.card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line);
}
.card__courtesy { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); line-height: 1.35; }
.card__mls { flex: none; font-family: var(--display); font-weight: 600; font-size: 11.5px; letter-spacing: .3px; color: var(--pine); white-space: nowrap; }

.results__empty { padding: 60px 24px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.results__empty h3 { font-family: var(--display); font-weight: 500; color: var(--ink-soft); font-size: 20px; margin: 0 0 6px; }

/* loading shimmer */
.skeleton { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.skeleton .sk { background: linear-gradient(90deg, var(--paper-2) 25%, #e4dac8 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
.skeleton .sk-media { height: 210px; }
.skeleton .sk-line { height: 13px; margin: 12px 14px; border-radius: 4px; }
.skeleton .sk-line.w60 { width: 60%; }
.skeleton .sk-line.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -135% 0; } }

/* --------------------------------------------------------------- detail ---- */
.detail-scrim {
  position: fixed; inset: 0; background: rgba(33,30,25,.46);
  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 80;
}
.detail-scrim.show { opacity: 1; pointer-events: auto; }
.detail {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 92vw);
  background: var(--paper); box-shadow: var(--shadow-lg); z-index: 90;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.3,.8,.3,1);
  will-change: transform; display: flex; flex-direction: column; overflow: hidden;
}
.detail.show { transform: none; }
.detail__close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,253,248,.9); backdrop-filter: blur(6px); box-shadow: var(--shadow-md);
  font-size: 19px; color: var(--ink); display: grid; place-items: center;
}
.detail__close:hover { background: #fff; }
.detail__scroll { overflow-y: auto; }
.detail__hero { aspect-ratio: 16/10; background: var(--paper-2); position: relative; }
.detail__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail__thumbs { display: flex; gap: 8px; padding: 10px 22px 0; }
.detail__thumbs img { width: 76px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; opacity: .7; transition: opacity .15s, border-color .15s; }
.detail__thumbs img:hover, .detail__thumbs img.on { opacity: 1; border-color: var(--brass); }
.detail__body { padding: 18px 22px 30px; }
.detail__price { font-family: var(--display); font-size: 32px; font-weight: 600; }
.detail__addr { font-size: 16px; margin: 4px 0 2px; }
.detail__town { color: var(--muted); font-size: 14px; }
.detail__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.detail__stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 12px; text-align: center; }
.detail__stat b { display: block; font-family: var(--display); font-size: 19px; font-weight: 600; }
.detail__stat span { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.detail__desc { font-size: 14.5px; line-height: 1.7; color: var(--ink-soft); }
.detail__cta { display: flex; gap: 10px; margin: 22px 0 14px; }
.detail__cta a { flex: 1; text-align: center; padding: 13px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; }
.cta-primary { background: var(--pine); color: #fff; }
.cta-primary:hover { background: var(--pine-700); }
.cta-ghost { background: none; border: 1.5px solid var(--line-2); color: var(--ink); }
.cta-ghost:hover { border-color: var(--pine); color: var(--pine); }
.detail__courtesy { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }

/* preview ribbon */
.ribbon {
  position: fixed; bottom: 14px; left: 14px; z-index: 70;
  background: rgba(33,30,25,.9); color: var(--paper); backdrop-filter: blur(8px);
  font-size: 11px; letter-spacing: .4px; padding: 7px 13px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-md); pointer-events: none;
}
.ribbon b { color: var(--brass-soft); }

/* mobile toggle */
.view-toggle { display: none; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .nav, .phone { display: none; }
  .stage { grid-template-columns: 1fr; }
  .map-wrap, .results { grid-column: 1; grid-row: 1; }
  .results { display: none; }
  body.show-list .results { display: flex; }
  body.show-list .map-wrap { display: none; }
  .view-toggle {
    display: inline-flex; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 75; background: var(--ink); color: var(--paper); border: none;
    border-radius: var(--r-pill); padding: 0; box-shadow: var(--shadow-lg); overflow: hidden;
  }
  .view-toggle button { background: none; border: none; color: var(--paper); padding: 11px 20px; font-size: 13.5px; font-weight: 600; }
  .view-toggle button.on { background: var(--pine); }
  .map-tools { right: 14px; max-width: none; }
  .map-tools .search-field { min-width: 0; flex: 1; }
}
