/* ===========================================================================
   Stay With Salus, the district map component.
   Loaded on the home page only. Sits on top of salus.css and reads its tokens.

   SALUS-MAP-COMPONENT: BEGIN
   Instructed 16 August 2026: the cluster bubbles carry a number, and that
   number is wanted. It is the one place on this site where a count of
   apartments is permitted. The instruction is quoted in full in NOTES.md
   section 1. Do not strip it as a regression.
   =========================================================================== */

.salus-map{
  position:relative;
  height:600px;
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--cream-warm);
  border:1px solid var(--line);
  box-shadow:var(--shadow-rest);
  isolation:isolate;
}
.salus-map__canvas{position:absolute;inset:0;background:#eceff1}

/* The no-script and pre-boot fallback. Removed by map.js once Leaflet is up. */
.salus-map__fallback{
  position:absolute;inset:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:18px;text-align:center;padding:32px;
}
.salus-map__fallback p{margin:0;color:var(--muted);max-width:44ch}
.salus-map__fallback ul{
  list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;
  gap:10px;justify-content:center;max-width:640px;
}
.salus-map__fallback a{
  display:inline-block;padding:9px 18px;border-radius:var(--pill);
  border:1px solid var(--line);background:var(--white);
  font-size:15px;color:var(--forest);
}
.salus-map__fallback a:hover{border-color:var(--forest);}

/* The honest line. Sits outside the map, always rendered, never JavaScript. */
.salus-map__note{
  margin:14px 2px 0;font-size:14px;line-height:22px;color:var(--muted);
  display:flex;gap:9px;align-items:flex-start;
}
.salus-map__note i{
  flex:0 0 auto;width:15px;height:15px;margin-top:4px;border-radius:50%;
  border:1.5px solid var(--sage);position:relative;
}
.salus-map__note i::after{
  content:"";position:absolute;left:50%;top:2.5px;width:1.5px;height:8px;
  background:var(--sage);transform:translateX(-50%);border-radius:1px;
}

/* --------------------------------------------------------------- basemap */
.salus-map .leaflet-container{
  font-family:'Outfit',-apple-system,BlinkMacSystemFont,sans-serif;
  font-size:14px;background:#eceff1;
}
/* Positron is already muted. This takes the last of the colour out of it so it
   reads as paper under the badges, the way the reference does. */
.salus-map .leaflet-tile-pane{filter:saturate(.55) contrast(.96) brightness(1.02)}

.salus-map .leaflet-control-attribution{
  background:rgba(255,255,255,.82);color:var(--muted);
  font-size:11px;line-height:16px;padding:2px 8px;border-radius:6px 0 0 0;
}
.salus-map .leaflet-control-attribution a{color:var(--forest);text-decoration:underline}

/* ---------------------------------------------------------------- badges */
/* Dark brand circle, white numeral, size grows with what it holds. */
.smap-cluster{background:none;border:0}
.smap-cluster div{
  width:100%;height:100%;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--forest-deep);
  color:var(--white);
  font-weight:500;
  letter-spacing:0;
  border:2.5px solid rgba(255,255,255,.92);
  box-shadow:0 2px 5px rgba(31,42,32,.30), 0 6px 16px rgba(31,42,32,.22);
  transition:transform .14s ease, background .14s ease;
}
.smap-cluster:hover div{background:var(--forest);transform:scale(1.06)}
.smap-cluster.is-xs div{font-size:14px}
.smap-cluster.is-s  div{font-size:15px}
.smap-cluster.is-m  div{font-size:16px}
.smap-cluster.is-l  div{font-size:18px}

/* A cluster that cannot split any further, because everything in it shares one
   postcode district. Ringed, so it reads as a stack rather than a spread. */
.smap-cluster.is-locked div{
  box-shadow:0 0 0 4px rgba(31,42,32,.14), 0 2px 5px rgba(31,42,32,.30),
             0 6px 16px rgba(31,42,32,.22);
}

/* One property. A house, not a numeral. */
.smap-pin{background:none;border:0}
.smap-pin div{
  width:100%;height:100%;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--forest-deep);
  border:2.5px solid rgba(255,255,255,.92);
  box-shadow:0 2px 5px rgba(31,42,32,.30), 0 6px 16px rgba(31,42,32,.22);
  transition:transform .14s ease, background .14s ease;
}
.smap-pin:hover div{background:var(--forest);transform:scale(1.09)}
.smap-pin svg{width:17px;height:17px;display:block}
.smap-pin svg path{fill:var(--white)}

/* --------------------------------------------------------------- controls */
.salus-map .leaflet-bar,
.salus-map .leaflet-control-zoom{
  border:1px solid var(--line);border-radius:12px;overflow:hidden;
  box-shadow:var(--shadow-rest);
}
.salus-map .leaflet-bar a,
.salus-map .leaflet-bar a:hover{
  width:38px;height:38px;line-height:36px;
  background:var(--white);color:var(--forest);
  border-bottom:1px solid var(--line);font-size:19px;font-weight:300;
}
.salus-map .leaflet-bar a:last-child{border-bottom:0}
.salus-map .leaflet-bar a:hover{background:var(--cream)}
.salus-map .leaflet-bar a.leaflet-disabled{background:var(--cream-warm);color:var(--sage)}

.smap-expand{margin-top:10px !important}
.smap-expand a{display:flex !important;align-items:center;justify-content:center}
.smap-expand svg{width:16px;height:16px}
.smap-expand svg path{stroke:var(--forest);stroke-width:1.7;fill:none;
  stroke-linecap:round;stroke-linejoin:round}

/* ----------------------------------------------------------- search box */
.smap-search{
  width:274px;max-width:calc(100vw - 96px);
  font-family:'Outfit',sans-serif;
}
.smap-search__field{
  position:relative;background:var(--white);
  border:1px solid var(--line);border-radius:12px;
  box-shadow:var(--shadow-rest);
  display:flex;align-items:center;gap:9px;padding:0 12px;height:44px;
}
.smap-search__field:focus-within{border-color:var(--forest);box-shadow:var(--shadow-raise)}
.smap-search__field svg{width:15px;height:15px;flex:0 0 auto}
.smap-search__field svg *{stroke:var(--muted);stroke-width:1.8;fill:none}
.smap-search input{
  border:0;outline:0;background:none;width:100%;height:100%;
  font-size:15px;color:var(--ink);
}
.smap-search input::placeholder{color:var(--muted)}
.smap-search__clear{
  flex:0 0 auto;width:19px;height:19px;border-radius:50%;
  background:var(--cream-warm);color:var(--muted);
  font-size:12px;line-height:19px;text-align:center;padding:0;
}
.smap-search__clear[hidden]{display:none}

.smap-search__list{
  list-style:none;margin:7px 0 0;padding:5px;
  background:var(--white);border:1px solid var(--line);border-radius:12px;
  box-shadow:var(--shadow-modal);
  max-height:262px;overflow-y:auto;
}
.smap-search__list[hidden]{display:none}
.smap-search__list li{margin:0}
.smap-search__list button{
  display:block;width:100%;text-align:left;padding:8px 11px;border-radius:8px;
  font-size:14px;line-height:19px;color:var(--ink);
}
.smap-search__list button:hover,
.smap-search__list button:focus-visible,
.smap-search__list .is-active button{background:var(--cream);outline:0}
.smap-search__list b{font-weight:500;display:block}
.smap-search__list span{display:block;font-size:12.5px;color:var(--muted)}
.smap-search__none{padding:11px 12px;font-size:14px;color:var(--muted)}

/* ------------------------------------------------------------- popup card */
.salus-map .leaflet-popup-content-wrapper{
  border-radius:14px;padding:0;overflow:hidden;
  box-shadow:var(--shadow-modal);border:1px solid var(--line);
}
.salus-map .leaflet-popup-content{margin:0;width:250px !important;line-height:inherit}
.salus-map .leaflet-popup-tip{border:1px solid var(--line);box-shadow:var(--shadow-rest)}
.salus-map .leaflet-popup-close-button{
  width:26px;height:26px;top:7px;right:7px;border-radius:50%;
  background:rgba(255,255,255,.92);color:var(--forest);
  font-size:17px;line-height:24px;text-align:center;
}
.salus-map .leaflet-popup-close-button:hover{background:var(--white)}

.smap-card{display:block;color:inherit}
.smap-card img{width:100%;height:142px;object-fit:cover;background:var(--cream-warm)}
.smap-card__body{padding:12px 14px 14px}
.smap-card h4{
  font-family:'Cormorant Garamond',Georgia,serif;font-weight:400;
  font-size:21px;line-height:1.14;margin:0 0 3px;color:var(--forest);
}
.smap-card__loc{margin:0 0 7px;font-size:13px;color:var(--muted)}
.smap-card__meta{margin:0 0 9px;font-size:13.5px;color:var(--ink)}
.smap-card__rate{margin:0;font-size:15px;color:var(--forest);font-weight:500}
.smap-card__rate span{font-weight:400;font-size:13px;color:var(--muted)}
.smap-card:hover h4{text-decoration:underline;text-underline-offset:3px}

/* A stack of properties sharing one postcode district. */
.smap-stack{width:252px}
.smap-stack__head{
  padding:12px 14px 10px;border-bottom:1px solid var(--line);background:var(--cream);
}
.smap-stack__head b{display:block;font-size:15px;font-weight:500;color:var(--forest)}
.smap-stack__head span{display:block;font-size:12.5px;color:var(--muted);margin-top:2px}
.smap-stack__list{list-style:none;margin:0;padding:5px;max-height:248px;overflow-y:auto}
.smap-stack__list a{
  display:flex;gap:10px;align-items:center;padding:7px 8px;border-radius:9px;color:inherit;
}
.smap-stack__list a:hover{background:var(--cream)}
.smap-stack__list img{
  width:52px;height:44px;flex:0 0 auto;border-radius:6px;object-fit:cover;
  background:var(--cream-warm);
}
.smap-stack__list b{display:block;font-size:13.5px;font-weight:500;line-height:18px}
.smap-stack__list span{display:block;font-size:12.5px;color:var(--muted);line-height:17px}

/* ------------------------------------------------------- gesture curtain */
/* A map that hijacks the page scroll on a phone is worse than no map, so
   panning takes a deliberate gesture and this says which one. */
.smap-curtain{
  position:absolute;inset:0;z-index:900;pointer-events:none;
  display:flex;align-items:center;justify-content:center;
  background:rgba(26,31,26,.34);
  opacity:0;transition:opacity .18s ease;
}
.smap-curtain.is-on{opacity:1}
.smap-curtain p{
  margin:0;padding:12px 22px;border-radius:var(--pill);
  background:rgba(255,255,255,.96);color:var(--forest);
  font-size:15px;box-shadow:var(--shadow-modal);
}

/* ---------------------------------------------------------- full screen */
.salus-map:fullscreen{height:100%;border-radius:0;border:0}
.salus-map:-webkit-full-screen{height:100%;border-radius:0;border:0}
.salus-map.is-pseudo-full{
  position:fixed;inset:0;height:auto;width:auto;
  z-index:4000;border-radius:0;border:0;
}

/* ---------------------------------------------------------------- narrow */
@media (max-width:900px){
  .salus-map{height:480px}
}
@media (max-width:640px){
  .salus-map{height:430px;border-radius:12px}
  .smap-search{width:210px;max-width:calc(100vw - 132px)}
  .smap-search__field{height:40px}
  .smap-search input{font-size:16px}
  .salus-map .leaflet-popup-content{width:224px !important}
  .smap-card img{height:124px}
  .salus-map__fallback a{padding:8px 15px;font-size:14px}
}
@media (prefers-reduced-motion:reduce){
  .smap-cluster div,.smap-pin div,.smap-curtain{transition:none}
}
/* SALUS-MAP-COMPONENT: END */
