/* Stone Arch Search, laid out like Zillow's (Kyle 2026-10-20) so it feels familiar, in Stone Arch brand
 * colors only (marketing/brand-guide.md): Ivory, Navy, Forest, Sky Blue, Gold, Rust.
 * Headers: Libre Caslon Display (web stand-in for Big Caslon). Body: Jost. */
.sas {
  --sas-ivory: #F6F5F0;
  --sas-navy: #2A3A51;
  --sas-forest: #344B43;
  --sas-sky: #9EB0B7;
  --sas-gold: #E1AA2F;
  --sas-rust: #974B25;
  --sas-line: rgba(42, 58, 81, .14);
  --sas-soft: rgba(42, 58, 81, .06);
  --sas-head: "Big Caslon", "Libre Caslon Display", Georgia, serif;
  --sas-body: "Jost", "Optima", "Segoe UI", sans-serif;
  --sas-h: 80vh;
  /* Full width of the window, whatever the theme's content column is. */
  /* --sas-sbw (set by the script) is the page scrollbar's width, which 100vw includes. */
  position: relative; width: calc(100vw - var(--sas-sbw, 0px));
  margin-left: calc(50% - 50vw + var(--sas-sbw, 0px) / 2); margin-right: calc(50% - 50vw + var(--sas-sbw, 0px) / 2);
  display: flex; flex-direction: column; height: var(--sas-h);
  font-family: var(--sas-body); font-weight: 400; color: var(--sas-navy); background: #fff;
  border-top: 1px solid var(--sas-line);
}
.sas *, .sas *::before, .sas *::after { box-sizing: border-box; }
.sas p { margin: 0; }
.sas-ico { flex: none; }

/* ---------- Top bar: search box + filter buttons ---------- */
.sas-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fff;
  border-bottom: 1px solid var(--sas-line); position: relative; z-index: 5;
}
.sas-where { position: relative; flex: 0 1 320px; min-width: 200px; display: flex; align-items: center; }
.sas-where .sas-ico { position: absolute; right: 12px; color: var(--sas-navy); pointer-events: none; }
.sas .sas-where input {
  width: 100%; height: 40px; padding: 0 38px 0 14px; margin: 0;
  border: 1px solid rgba(42, 58, 81, .45) !important; border-radius: 4px; background: #fff !important; box-shadow: none !important;
  font: 400 15px var(--sas-body); color: var(--sas-navy) !important;
}
.sas-where input:focus { outline: 2px solid var(--sas-gold); outline-offset: 0; }
.sas-where input::-webkit-search-cancel-button { display: none; }
.sas-suggest {
  position: absolute; top: 44px; left: 0; right: 0; margin: 0; padding: 6px 0; list-style: none; background: #fff;
  border: 1px solid var(--sas-line); border-radius: 4px; box-shadow: 0 8px 24px rgba(42, 58, 81, .18); z-index: 20;
}
.sas-suggest[hidden] { display: none; }
.sas-suggest li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; margin: 0; cursor: pointer; font-size: 15px; }
.sas-suggest li small { color: rgba(42, 58, 81, .6); font-size: 13px; white-space: nowrap; }
.sas-suggest li[aria-selected="true"], .sas-suggest li:hover { background: var(--sas-soft); }

.sas-menus { display: flex; gap: 8px; flex-wrap: nowrap; }
.sas-menu { position: relative; }
.sas .sas-menu-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; margin: 0; white-space: nowrap;
  border: 1px solid rgba(42, 58, 81, .45) !important; border-radius: 4px; background: #fff !important; color: var(--sas-navy) !important;
  font: 500 14px var(--sas-body); letter-spacing: 0; text-transform: none; cursor: pointer; box-shadow: none !important;
}
.sas .sas-menu-btn:hover { border-color: var(--sas-navy) !important; }
.sas .sas-menu.is-active .sas-menu-btn { background: var(--sas-navy) !important; color: var(--sas-ivory) !important; border-color: var(--sas-navy) !important; }
.sas-menu-btn[aria-expanded="true"] .sas-ico { transform: rotate(180deg); }

.sas-panel {
  position: absolute; top: 46px; left: 0; width: 300px; padding: 16px; background: #fff; z-index: 30;
  border: 1px solid var(--sas-line); border-radius: 6px; box-shadow: 0 10px 30px rgba(42, 58, 81, .2);
}
.sas-panel[hidden] { display: none; }
.sas-panel-wide { width: 340px; }
.sas-menu[data-menu="more"] .sas-panel { left: auto; right: 0; }
.sas-panel-title { margin: 14px 0 8px !important; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: rgba(42, 58, 81, .7); }
.sas-panel-title:first-child { margin-top: 0 !important; }
.sas-panel hr { border: 0; border-top: 1px solid var(--sas-line); margin: 12px 0; }
.sas-radio, .sas-checkline { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 15px; cursor: pointer; }
.sas .sas-radio input, .sas .sas-checkline input { width: 18px; height: 18px; margin: 0; accent-color: var(--sas-navy); }
.sas-range { display: flex; align-items: flex-end; gap: 8px; }
.sas-range label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: rgba(42, 58, 81, .7); }
.sas-dash { padding-bottom: 10px; font-size: 14px; color: rgba(42, 58, 81, .7); white-space: nowrap; }
.sas .sas-panel input[type=text], .sas .sas-panel select {
  width: 100%; height: 40px; padding: 0 10px; margin: 0; border: 1px solid rgba(42, 58, 81, .4) !important; border-radius: 4px;
  background: #fff !important; color: var(--sas-navy) !important; font: 400 15px var(--sas-body); box-shadow: none !important;
}
.sas .sas-panel input.is-invalid { border: 2px solid var(--sas-rust) !important; }
.sas-seg { display: flex; border: 1px solid rgba(42, 58, 81, .4); border-radius: 4px; overflow: hidden; }
.sas .sas-seg button {
  flex: 1; height: 40px; padding: 0; margin: 0; border: 0 !important; border-left: 1px solid rgba(42, 58, 81, .25) !important; border-radius: 0;
  background: #fff !important; color: var(--sas-navy) !important; font: 500 14px var(--sas-body); cursor: pointer; box-shadow: none !important; min-width: 0;
}
.sas .sas-seg button:first-child { border-left: 0 !important; }
.sas .sas-seg button[aria-checked="true"] { background: var(--sas-navy) !important; color: var(--sas-ivory) !important; }
.sas-panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.sas-panel-foot .sas-btn:only-child { margin-left: auto; }
.sas .sas-link { padding: 0; border: 0 !important; background: none !important; color: var(--sas-navy) !important; font: 500 14px var(--sas-body); text-decoration: underline; cursor: pointer; box-shadow: none !important; min-width: 0; }

.sas .sas-btn {
  height: 40px; padding: 0 20px; border-radius: 4px; cursor: pointer; margin: 0;
  font: 500 14px var(--sas-body); letter-spacing: .02em; text-transform: none; box-shadow: none !important; min-width: 0; line-height: 1;
}
.sas .sas-btn-navy, .sas .sas-btn-navy:hover, .sas .sas-btn-navy:focus { background: var(--sas-navy) !important; color: var(--sas-ivory) !important; border: 1px solid var(--sas-navy) !important; }
.sas-btn:focus-visible, .sas-menu-btn:focus-visible, .sas-tool:focus-visible, .sas-heart:focus-visible { outline: 2px solid var(--sas-gold); outline-offset: 2px; }

/* ---------- Map + list ---------- */
.sas-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 46%); }
.sas-map-wrap { position: relative; min-height: 0; }
.sas-map { position: absolute; inset: 0; }
.sas.is-drawing .sas-map canvas { touch-action: none; }
.sas-map-tools { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 8px; }
.sas .sas-tool {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; margin: 0;
  background: #fff !important; color: var(--sas-navy) !important; border: 1px solid rgba(42, 58, 81, .3) !important; border-radius: 4px;
  font: 500 14px var(--sas-body); cursor: pointer; box-shadow: 0 2px 8px rgba(42, 58, 81, .18) !important; min-width: 0; text-transform: none; letter-spacing: 0;
}
.sas .sas-tool[hidden] { display: none; }
.sas-draw-hint {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 8px 14px; background: var(--sas-navy); color: var(--sas-ivory); font-size: 14px; border-radius: 4px;
  box-shadow: 0 4px 14px rgba(42, 58, 81, .25); white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis;
}
.sas-draw-hint[hidden] { display: none; }

.sas-list { min-height: 0; overflow-y: auto; background: #fff; border-left: 1px solid var(--sas-line); }
.sas-list-head { padding: 14px 16px 6px; }
.sas .sas-title { margin: 0; font-family: var(--sas-head); font-weight: 400; font-size: 24px; line-height: 1.25; color: var(--sas-navy); text-transform: none; letter-spacing: 0; }
.sas-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.sas-count { font-size: 14px; font-weight: 600; }
.sas.is-loading .sas-count, .sas.is-loading .sas-cards { opacity: .55; transition: opacity .2s; }
.sas-sort { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--sas-navy); }
.sas .sas-sort select {
  appearance: none; -webkit-appearance: none; height: 32px; padding: 0 22px 0 4px; margin: 0; border: 0 !important; box-shadow: none !important;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%232A3A51'/%3E%3C/svg%3E") no-repeat right 4px center !important;
  color: var(--sas-navy) !important; font: 600 14px var(--sas-body); cursor: pointer;
}
.sas-note { margin-top: 6px !important; font-size: 13px; color: rgba(42, 58, 81, .75); }
.sas-note[hidden] { display: none; }
.sas-error { color: var(--sas-rust); }
.sas-cards { list-style: none; margin: 0; padding: 8px 16px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
.sas-attribution { padding: 12px 16px 20px; font-size: 11px; line-height: 1.5; color: rgba(42, 58, 81, .65); border-top: 1px solid var(--sas-line); }
.sas-attribution:empty { display: none; }

/* ---------- Cards ---------- */
.sas-card { position: relative; margin: 0; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 6px rgba(42, 58, 81, .14), 0 0 0 1px rgba(42, 58, 81, .05); transition: box-shadow .15s; }
.sas-card:hover, .sas-card.is-hover { box-shadow: 0 6px 18px rgba(42, 58, 81, .22), 0 0 0 2px var(--sas-gold); }
.sas-card-link { display: block; color: inherit !important; text-decoration: none !important; }
.sas-card-link:focus-visible { outline: 2px solid var(--sas-gold); outline-offset: -2px; }
.sas-photo { position: relative; aspect-ratio: 16 / 10; background: var(--sas-sky); overflow: hidden; }
.sas-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.sas-card:hover .sas-photo img { transform: scale(1.03); }
.sas-nophoto { display: grid; place-items: center; height: 100%; color: var(--sas-ivory); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.sas-badge {
  position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 3px; background: #fff; color: var(--sas-navy);
  font: 600 12px var(--sas-body); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); max-width: calc(100% - 56px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sas-badge.is-open { background: var(--sas-navy); color: var(--sas-ivory); }
.sas-badge.is-soon { background: var(--sas-forest); color: var(--sas-ivory); }
.sas-badge.is-new { background: var(--sas-gold); color: var(--sas-navy); }
.sas .sas-heart {
  position: absolute; top: 6px; right: 6px; width: 38px; height: 38px; padding: 0; margin: 0; display: grid; place-items: center;
  border: 0 !important; border-radius: 50%; background: transparent !important; cursor: pointer; box-shadow: none !important; min-width: 0;
}
.sas-heart svg { fill: rgba(0, 0, 0, .25); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); transition: transform .15s; }
.sas-heart:hover svg { transform: scale(1.1); }
.sas-heart.is-on svg { fill: var(--sas-rust); stroke: #fff; }
.sas-info { padding: 10px 12px 12px; }
.sas-price { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.sas-price small { font-size: 14px; font-weight: 400; }
.sas-facts { margin-top: 3px !important; font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sas-facts b { font-weight: 600; }
.sas-sep { margin: 0 6px; color: rgba(42, 58, 81, .35); }
.sas-address { margin-top: 2px !important; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sas-courtesy { margin-top: 6px !important; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: rgba(42, 58, 81, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sas-contact { margin-top: 2px !important; font-size: 12px; color: rgba(42, 58, 81, .75); }

/* ---------- Map popup (mini card) ---------- */
.sas-popup .maplibregl-popup-content { padding: 0; border-radius: 6px; overflow: hidden; box-shadow: 0 8px 24px rgba(42, 58, 81, .3); font-family: var(--sas-body); color: var(--sas-navy); }
.sas-popup .maplibregl-popup-close-button { z-index: 2; width: 26px; height: 26px; margin: 4px; border-radius: 50%; background: rgba(255, 255, 255, .9) !important; color: var(--sas-navy) !important; font-size: 18px; line-height: 1; padding: 0; border: 0 !important; }
.sas-pop { display: block; color: inherit !important; text-decoration: none !important; }
.sas-pop-photo { position: relative; display: block; }
.sas-pop-photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.sas-pop-info { display: block; padding: 8px 12px 10px; }
.sas-pop-info > span { display: block; }
.sas-pop .sas-price { font-size: 19px; }
.sas-pop .sas-facts { font-size: 13px; }
.sas-pop .sas-address { font-size: 13px; }

.sas .sas-toggle { display: none; }

/* ---------- Medium screens: one column of cards ---------- */
@media (min-width: 900px) and (max-width: 1199px) {
  .sas-body { grid-template-columns: minmax(0, 1fr) 380px; }
  .sas-cards { grid-template-columns: 1fr; }
  .sas-where { flex-basis: 220px; }
}

/* ---------- Phones and small tablets: list or map, filters scroll sideways, panels slide up ---------- */
@media (max-width: 899px) {
  .sas { height: auto; min-height: var(--sas-h); }
  .sas-bar { flex-wrap: wrap; padding: 8px 12px; position: sticky; top: 0; }
  .sas-where { flex: 1 1 100%; }
  .sas-menus { width: 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .sas-menus::-webkit-scrollbar { display: none; }
  .sas-menu { position: static; }
  .sas-panel, .sas-panel-wide, .sas-menu[data-menu="more"] .sas-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 80vh; overflow-y: auto;
    border-radius: 12px 12px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .sas.has-open-menu::after { content: ""; position: fixed; inset: 0; background: rgba(42, 58, 81, .35); z-index: 25; }
  .sas-body { display: block; }
  .sas-map-wrap { height: calc(100vh - 140px); min-height: 420px; }
  .sas-body[data-view="list"] .sas-map-wrap { display: none; }
  .sas-body[data-view="map"] .sas-list { display: none; }
  .sas-list { border-left: 0; overflow: visible; }
  .sas-cards { grid-template-columns: 1fr; }
  .sas .sas-toggle {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 6; height: 44px; padding: 0 20px; margin: 0;
    background: var(--sas-navy) !important; color: var(--sas-ivory) !important; border: 0 !important; border-radius: 22px;
    font: 600 15px var(--sas-body); box-shadow: 0 6px 18px rgba(42, 58, 81, .35) !important; cursor: pointer; min-width: 0;
  }
}

/* ---------- Theme guards ---------- */
/* WPL's "Chosen" script replaces every <select> on the site with its own widget; keep ours native. */
.sas .chosen-container { display: none !important; }
.sas select { display: block !important; }
.sas strong, .sas b { font-family: inherit; }
.sas ul, .sas li { list-style: none; }
.sas .maplibregl-ctrl-group button, .sas .maplibregl-ctrl-group button:hover {
  width: 29px; height: 29px; padding: 0; margin: 0; border: 0 !important; border-radius: 0; background-color: #fff !important; box-shadow: none !important;
}
.sas .maplibregl-ctrl-group button + button { border-top: 1px solid rgba(42, 58, 81, .15); }

/* Search page: no theme page title or side padding; the search fills the window under the site header. */
body.stonearch-search-page { background-color: #fff !important; }
body.stonearch-search-page .entry-header, body.stonearch-search-page .page-header,
body.stonearch-search-page .breadcrumb, body.stonearch-search-page .breadcrumbs,
body.stonearch-search-page .q-breadcrumbs-section { display: none !important; }
body.stonearch-search-page .site-content, body.stonearch-search-page .entry-content,
body.stonearch-search-page .content-area, body.stonearch-search-page article { padding-top: 0 !important; padding-bottom: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; }
body.stonearch-search-page { overflow-x: hidden; }

.sas-noprice { font-size: 18px; font-weight: 500; }
