/* The home search map (home/idx-map.js). Loads after home/idx.css. Scoped to div.idx-map / #idx-map so the listing page's
   "See it on Google Maps" line (<p class="idx-map">) is untouched.
   FMLS: the mini card's text is one size (--idx-text, 14px), so the MLS # and courtesy line are never smaller than the
   other listing text (13.7(b), (c)); the courtesy is Newsreader italic in warm gray #7b7570 on white (4.54:1). The photo
   fills its frame with object-fit and is never edited or tinted (agreement 4.6(b)). */

/* ---------- List / Map toggle ---------- */
.idx-view{display:inline-flex;gap:4px;padding:4px;border-radius:999px;background:var(--cream,#faf7f1);box-shadow:inset 0 0 0 1px #d9cfbd}
.idx-view button{min-width:72px;min-height:44px;padding:0 18px;border:0;border-radius:999px;background:none;color:var(--navy,#173b61);font:800 14.5px/1 var(--display,"Manrope",system-ui,sans-serif);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .2s,color .2s}
.idx-view button:hover{background:#fff}
.idx-view button[aria-pressed="true"]{background:var(--navy,#173b61);color:#fff}
.idx-view button:focus-visible{outline:2px solid var(--navy,#173b61);outline-offset:2px}
.idx-map-rest{margin:10px 0 0;color:var(--navy,#173b61);font:italic 400 16px/1.45 var(--accent,"Newsreader",Georgia,serif)}

/* ---------- the map ---------- */
div.idx-map,#idx-map{--idx-text:14px;position:relative;width:100%;height:min(640px,70vh);min-height:360px;margin:16px 0 24px;overflow:hidden;border-radius:22px;background:#faf7f1;box-shadow:0 0 0 1px rgba(196,160,90,.45),0 30px 60px -40px rgba(10,20,40,.5);isolation:isolate}
#idx-map[hidden]{display:none}
/* Beats maplibre-gl.css (loaded later), which sets .maplibregl-map to position:relative. */
#idx-map .idx-map-gl{position:absolute;inset:0;width:100%;height:100%}
.idx-map-gl .maplibregl-canvas:focus-visible{outline:3px solid var(--navy,#173b61);outline-offset:-3px}

/* The count and the cap note, top left; "Search this area", top center. */
.idx-map-status,.idx-map-cap{position:absolute;left:12px;z-index:3;max-width:calc(100% - 80px);margin:0;padding:8px 14px;border-radius:999px;background:rgba(255,255,255,.94);box-shadow:0 0 0 1px rgba(23,59,97,.12),0 8px 20px -12px rgba(10,20,40,.45);color:var(--navy,#173b61);font:700 13.5px/1.25 var(--display,"Manrope",system-ui,sans-serif)}
.idx-map-status{top:12px}
.idx-map-status:empty{display:none}
.idx-map-cap{top:54px;border-radius:14px;font-weight:600}
.idx-map-area{position:absolute;left:50%;bottom:20px;z-index:4;transform:translateX(-50%);min-height:44px;padding:0 22px;border:0;border-radius:999px;background:var(--navy,#173b61);color:#fff;font:800 14.5px/1 var(--display,"Manrope",system-ui,sans-serif);white-space:nowrap;cursor:pointer;box-shadow:0 0 0 2px rgba(201,181,142,.9),0 14px 28px -14px rgba(10,20,40,.7)}
.idx-map-area:hover{background:#1B2F4E}
.idx-map-area:focus-visible{outline:3px solid #C9B58E;outline-offset:3px}

/* ---------- pins and bubbles (buttons; the 44px tap area is the ::before) ---------- */
.idx-mk-p,.idx-mk-c{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent;font-family:var(--display,"Manrope",system-ui,sans-serif);font-variant-numeric:tabular-nums}
.idx-mk-p::before,.idx-mk-c::before{content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
.idx-mk-p{min-height:28px;padding:0 10px;border-radius:999px;background:var(--navy,#173b61);color:#fff;font-size:13px;font-weight:800;line-height:1;white-space:nowrap;box-shadow:0 0 0 1.5px #fff,0 6px 14px -6px rgba(10,20,40,.6);transition:background .15s,transform .15s}
.idx-mk-p[data-pick]{box-shadow:0 0 0 2.5px #C9B58E,0 0 0 4px #fff,0 6px 14px -6px rgba(10,20,40,.6)}
.idx-mk-p:hover,.idx-mk-p[aria-current="true"]{z-index:2;background:#1B2F4E;transform:scale(1.08)}
.idx-mk-p[aria-current="true"]{background:#c4a05a;color:#10243b}
.idx-mk-c{border-radius:50%;background:rgba(23,59,97,.92);color:#fff;font-size:13.5px;font-weight:800;box-shadow:0 0 0 3px rgba(201,181,142,.55),0 0 0 6px rgba(201,181,142,.2)}
.idx-mk-c[data-size="s"]{width:34px;height:34px}
.idx-mk-c[data-size="m"]{width:42px;height:42px}
.idx-mk-c[data-size="l"]{width:50px;height:50px;font-size:14.5px}
.idx-mk-c:hover{background:#1B2F4E}
.idx-mk-p:focus-visible,.idx-mk-c:focus-visible{outline:3px solid #c4a05a;outline-offset:3px;z-index:3}

/* ---------- the mini card ---------- */
.idx-mcard{position:absolute;left:12px;bottom:12px;z-index:5;width:min(320px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;border-radius:20px;background:#fff;box-shadow:0 0 0 1px rgba(196,160,90,.5),0 28px 50px -24px rgba(10,20,40,.6)}
.idx-mcard[hidden]{display:none}
/* #idx-map beats home/idx.css's ".idx-map a" (the listing page's Google Maps link: navy, 800, underline on hover). */
#idx-map .idx-mcard-a{display:block;color:var(--ink,#22292b);font-weight:400;text-decoration:none}
.idx-mcard-a:focus-visible{outline:3px solid var(--navy,#173b61);outline-offset:-3px;border-radius:20px}
.idx-mcard-ph{position:relative;aspect-ratio:3/2;background:var(--idx-photo,#ece5d8);overflow:hidden}
.idx-mcard-ph img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.idx-mcard-nophoto{position:absolute;inset:0;display:grid;place-items:center;font-size:var(--idx-text)}
#idx-map .idx-mcard-tag{left:10px;bottom:10px}
.idx-mcard-b{display:flex;flex-direction:column;gap:2px;padding:12px 16px 16px}
.idx-mcard-b p{margin:0;font-size:var(--idx-text);line-height:1.45}
.idx-mcard .idx-mcard-price{font:400 26px/1.1 var(--accent,"Newsreader",Georgia,serif);color:var(--navy,#173b61);font-variant-numeric:tabular-nums}
.idx-mcard-facts b{font-weight:700;color:var(--navy,#173b61)}
.idx-mcard-name{font-weight:700;color:var(--navy,#173b61)}
.idx-mcard-a:hover .idx-mcard-name{text-decoration:underline;text-underline-offset:3px;text-decoration-color:#c4a05a}
.idx-mcard .idx-mcard-firm{margin-top:4px;font:italic 400 var(--idx-text)/1.45 var(--accent,"Newsreader",Georgia,serif);color:#7b7570}
.idx-mcard-wait{margin:0;padding:18px 56px 18px 16px;font-size:var(--idx-text);color:var(--ink,#22292b)}
.idx-mcard-x{position:absolute;top:8px;right:8px;z-index:2;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.94);color:var(--navy,#173b61);font-size:24px;line-height:1;cursor:pointer;box-shadow:0 4px 12px -6px rgba(10,20,40,.5)}
.idx-mcard-x:focus-visible{outline:3px solid var(--navy,#173b61);outline-offset:1px}

/* MapLibre's own controls, in BLEU colors and 44px. */
#idx-map .maplibregl-ctrl-group{border-radius:14px;overflow:hidden;box-shadow:0 0 0 1px rgba(23,59,97,.14),0 8px 18px -10px rgba(10,20,40,.5)}
#idx-map .maplibregl-ctrl-group button{width:44px;height:44px}
#idx-map .maplibregl-ctrl-attrib{font:500 11.5px/1.4 var(--display,"Manrope",system-ui,sans-serif);color:#4d5c6b}
#idx-map .maplibregl-ctrl-attrib a{color:var(--navy,#173b61);font-weight:500}

/* ---------- phones ---------- */
@media (max-width:760px){
  /* Phones (owner, 2026-11-15, second pass): the map fills almost the whole screen, and the clicked home's card is
     compact enough that every line shows without scrolling: a landscape (4:3) photo on the left with the price and
     facts beside it, then the address, MLS # and listing firm across the full width. Shared by both maps. */
  div.idx-map,#idx-map{height:88vh;height:88svh;min-height:480px;margin:12px 0 18px;border-radius:18px}
  .idx-mcard{left:8px;right:8px;bottom:8px;width:auto;max-height:calc(100% - 16px);overflow:auto;border-radius:18px}
  #idx-map .idx-mcard-a,#idx-nearby .idx-nb-card{display:grid;grid-template-columns:minmax(0,46%) minmax(0,1fr);column-gap:12px;row-gap:2px;align-content:start;padding:10px 12px 14px}
  .idx-mcard-b{display:contents}
  .idx-mcard-ph{grid-column:1;grid-row:1 / span 3;align-self:start;aspect-ratio:4/3;min-height:0;border-radius:12px}
  .idx-mcard-b>*{grid-column:1 / -1}
  .idx-mcard-b>.idx-mcard-price,.idx-mcard-b>.idx-nb-top,.idx-mcard-b>.idx-mcard-facts,.idx-mcard-b>.idx-facts-i{grid-column:2;min-width:0}
  .idx-mcard-b>.idx-mcard-price,.idx-mcard-b>.idx-nb-top{margin-top:2px}
  .idx-mcard-b>.idx-mcard-name{margin-top:8px}
  .idx-mcard .idx-mcard-price{font-size:21px}
  .idx-mcard-wait{grid-column:1 / -1}
  /* The close button sits on the photo's corner so it never covers the price. */
  .idx-mcard-x{top:16px;left:16px;right:auto;width:36px;height:36px;font-size:20px;background:rgba(255,255,255,.94)}
  #idx-map .idx-mcard-tag,#idx-nearby .idx-mcard-tag{left:6px;bottom:6px}
  .idx-map-status{font-size:13px}
  .idx-map-area{bottom:14px}
  #idx-map:has(.idx-mcard:not([hidden])) .idx-map-area{display:none}
}

@media (prefers-reduced-motion:reduce){
  .idx-view button,.idx-mk-p{transition:none}
  .idx-mk-p:hover,.idx-mk-p[aria-current="true"]{transform:none}
}

/* ---------- "Homes nearby" on the listing page (home/idx-nearby.js) ----------
   Desktop: under "About this home" in the left column, sticky beside the longer Details, filling the gap.
   Phones: after Details, as a normal block. */
.idx-lcol{display:flex;flex-direction:column;gap:clamp(28px,4vw,48px);min-width:0}
.idx-nearby{position:sticky;top:calc(env(safe-area-inset-top,0px) + 24px)}
.idx-nearby[hidden]{display:none}
.idx-nearby-h{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 16px;margin-bottom:12px}
.idx-nearby-h h2{margin:0}
.idx-nearby-h a{color:var(--navy,#173b61);font-weight:800;font-size:15px;text-decoration:none}
.idx-nearby-h a:hover{text-decoration:underline;text-underline-offset:4px}
.idx-nearby-map{--idx-text:14px;position:relative;height:min(620px,calc(100vh - 140px));min-height:380px;overflow:hidden;border-radius:22px;background:#faf7f1;box-shadow:0 0 0 1px #e7e0d2}
.idx-nearby-wait,.idx-nearby-none{position:absolute;left:16px;bottom:16px;z-index:3;margin:0;padding:8px 14px;border-radius:999px;background:#fff;color:var(--navy,#173b61);font-size:14px;font-weight:700;box-shadow:0 6px 18px -10px rgba(10,20,40,.5)}
#idx-nearby .idx-nearby-gl{position:absolute;inset:0;width:100%;height:100%}
.idx-nb-me{display:flex;flex-direction:column;align-items:center;pointer-events:none}
.idx-nb-me span{padding:6px 12px;border-radius:999px;background:var(--navy,#173b61);color:#fff;font:800 13px/1 var(--display,"Manrope",system-ui,sans-serif);box-shadow:0 0 0 3px #fff,0 8px 18px -8px rgba(10,20,40,.6)}
.idx-nb-me::after{content:"";width:0;height:0;border:7px solid transparent;border-top-color:var(--navy,#173b61);margin-top:-1px}
.idx-nb-pin.idx-nb-spot{position:relative;left:auto;bottom:auto;min-height:32px;cursor:pointer}
.idx-nb-pin.idx-nb-spot .sp-l{font-size:13px}
.idx-nb-card{position:absolute;left:12px;top:12px;bottom:12px;z-index:4;width:min(300px,calc(100% - 24px));overflow:auto}
#idx-nearby .idx-mcard-tag{position:absolute;left:10px;bottom:10px}
.idx-nb-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.idx-nb-save{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;color:var(--navy,#173b61);box-shadow:0 0 0 1px #e7e0d2}
.idx-nb-save .idx-i{width:20px;height:20px}
.idx-nb-go{display:inline-block;margin-top:10px;color:var(--navy,#173b61);font-weight:800;font-size:14px;text-decoration:none}
.idx-nb-go:hover{text-decoration:underline;text-underline-offset:3px}
@media (max-width:760px){
  .idx-lcol{display:contents}
  .idx-about{order:1}.idx-details{order:2}.idx-nearby{order:3;position:static}
  .idx-nearby-map{height:88vh;height:88svh;min-height:480px}
  .idx-nb-card{top:auto;left:8px;right:8px;bottom:8px;width:auto;max-height:calc(100% - 16px)}
  .idx-nb-top{gap:6px}
  .idx-nb-top .idx-mcard-price{min-width:0;font-size:20px}
  .idx-nb-save{width:40px;height:40px;flex:none}
  .idx-nb-go{margin-top:8px}
  #idx-nearby .idx-mcard-tag{left:6px;bottom:6px}
}
