/* Church finder (map + address search). Uses the site's tokens from styles.css:
   --ink, --orange, --orange-dk, --gray-dk, --serif, --sans, --fs-ui, --fs-label, --ease. */
.finder{
  --line:#e6e1d9;
  margin-top:clamp(36px, 3.6vw, 68px);
  display:grid; grid-template-columns:minmax(300px, 400px) minmax(0, 1fr);
  background:#fff; border:1px solid var(--line);
  height:clamp(560px, 38vw, 720px);
}
.finder__side{ display:flex; flex-direction:column; min-height:0; min-width:0; border-right:1px solid var(--line); }
.finder__search{ padding:clamp(18px, 1.4vw, 26px); border-bottom:1px solid var(--line); }
.finder__label{ display:block; font-size:var(--fs-label); text-transform:uppercase; margin-bottom:7px; color:var(--ink); }
.finder__row{ display:flex; }
.finder__row input{ flex:1; min-width:0; font-family:var(--sans); font-size:max(16px, var(--fs-ui)); color:var(--ink);
  background:#fff; border:1px solid #b1b1b1; border-right:0; border-radius:0; height:clamp(46px, 2.76vw, 53px); padding:0 14px;
  transition:border-color .22s var(--ease), box-shadow .22s var(--ease); }
.finder__row input::placeholder{ color:#a9a7a4; }
.finder__row input:focus{ outline:0; border-color:var(--orange); box-shadow:0 0 0 3px rgba(225,139,26,.16); }
.finder__row .btn{ height:auto; padding:0 18px; }
.finder__tools{ display:flex; justify-content:space-between; gap:12px; margin-top:10px; font-size:13px; }
.finder .linkbtn{ background:none; border:0; padding:0; color:var(--gray-dk); cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.finder .linkbtn:hover{ color:var(--orange-dk); }
.finder__status{ padding:12px clamp(18px, 1.4vw, 26px); font-size:13px; line-height:1.5; color:var(--gray-dk); border-bottom:1px solid var(--line); min-height:44px; }
.finder__status.is-error{ color:#b0391f; }
.finder__list{ flex:1; overflow-y:auto; overscroll-behavior:contain; }
.church{ display:flex; gap:12px; align-items:flex-start; width:100%; text-align:left; background:none; border:0;
  border-bottom:1px solid var(--line); padding:14px clamp(18px, 1.4vw, 26px); cursor:pointer; transition:background .2s var(--ease); }
.church:hover, .church:focus-visible, .church.is-active{ background:#fdf6ec; outline:0; }
.church__pin{ flex:none; width:14px; height:20px; margin-top:3px; color:var(--orange); }
.church__body{ flex:1; min-width:0; }
.church__name{ display:block; font-family:var(--serif); font-weight:600; font-size:clamp(17px, 15.5px + .3vw, 21px); line-height:1.25; color:#000; }
.church__city{ display:block; margin-top:3px; font-size:14px; line-height:1.4; color:var(--gray-dk); }
.church__mi{ flex:none; font-size:13px; color:var(--gray-dk); margin-top:4px; white-space:nowrap; }
/* Leaflet stacks its layers up to z-index 1000; isolate them so the map stays under the sticky nav (z-index 100) */
.finder__map{ min-height:0; background:#eceae6; position:relative; z-index:0; isolation:isolate; }

/* map pieces */
.finder .leaflet-container{ font-family:var(--sans); }
.finder .pin{ background:none; border:0; }
.finder .pin svg{ width:26px; height:36px; display:block; filter:drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.finder .pin--you svg{ width:22px; height:22px; filter:none; }
.finder .cluster{ background:none; cursor:pointer; }
.finder .cluster div{ width:100%; height:100%; display:grid; place-items:center; border-radius:50%;
  background:var(--orange); color:#fff; font-weight:700; font-size:13px; box-shadow:0 0 0 5px rgba(225,139,26,.28);
  transition:transform .2s var(--ease), box-shadow .2s var(--ease); }
.finder .cluster:hover div{ transform:scale(1.08); box-shadow:0 0 0 8px rgba(225,139,26,.22); }
/* churches without an address yet sit on the city center: outlined, so they don't read as a real location */
.finder .cluster--city div{ background:#fff; color:var(--orange-dk); border:2px dashed var(--orange); box-shadow:0 1px 3px rgba(0,0,0,.18); }
.finder .cluster--city:hover div{ box-shadow:0 0 0 6px rgba(225,139,26,.18); }
.finder .pin--city path{ fill:#fff; stroke:var(--orange); stroke-width:2; stroke-dasharray:3 2; }
.finder .pin--city circle{ fill:var(--orange); }
.pop__note{ margin-top:6px; font-size:12.5px; line-height:1.4; color:var(--gray-dk); font-style:italic; }
.finder .pin svg{ transition:transform .2s var(--ease); transform-origin:50% 100%; }
.finder .pin:hover svg{ transform:scale(1.1); }

/* "use ⌘ + scroll" / "use two fingers" hint */
.finder__hint{ position:absolute; inset:0; z-index:1000; display:grid; place-items:center; padding:24px;
  background:rgba(42,37,34,.55); color:#fff; font-size:17px; text-align:center; pointer-events:none;
  opacity:0; transition:opacity .3s var(--ease); }
.finder__hint.is-on{ opacity:1; }

/* zoom buttons: square, like the site's buttons */
.finder .leaflet-bar{ border:1px solid var(--line); border-radius:0; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.finder .leaflet-bar a{ width:34px; height:34px; line-height:32px; border-radius:0 !important; color:var(--ink); font-weight:400; }
.finder .leaflet-bar a:hover{ background:#fdf6ec; }
.finder .leaflet-bar a:first-child{ border-bottom-color:var(--line); }

/* city card */
.pop__list{ margin-top:8px; display:grid; gap:2px; }
.pop__list button{ background:none; border:0; padding:3px 0; text-align:left; font:inherit; font-size:14px; color:var(--ink);
  cursor:pointer; text-decoration:underline; text-decoration-color:rgba(42,37,34,.25); text-underline-offset:3px; }
.pop__list button:hover{ color:var(--orange-dk); text-decoration-color:currentColor; }
.pop__more{ margin-top:6px; font-size:13px; color:var(--gray-dk); }
.finder .leaflet-fade-anim .leaflet-popup{ transition:opacity .25s var(--ease); }
.finder .leaflet-popup-content-wrapper{ border-radius:0; }
.finder .leaflet-popup-content{ margin:14px 16px; font-size:14px; line-height:1.4; }
.pop__name{ font-family:var(--serif); font-weight:600; font-size:17px; color:#000; }
.pop__city{ color:var(--gray-dk); margin-top:2px; }
.finder .pop__dir{ display:inline-block; margin-top:8px; color:var(--orange-dk); font-weight:500; }
/* the map provider's credit has to stay, but it can be quiet */
.finder .leaflet-control-attribution{ font-size:10px; line-height:1.4; padding:1px 6px; background:rgba(255,255,255,.6); color:#9a958f; }
.finder .leaflet-control-attribution a{ color:inherit; text-decoration:none; }

@media (max-width:820px){
  .finder{ grid-template-columns:minmax(0, 1fr); height:auto; }
  .finder__search, .finder__map, .finder__status, .finder__list{ min-width:0; }
  .finder__side{ display:contents; }
  .finder__search{ order:1; }
  .finder__map{ order:2; height:340px; border-bottom:1px solid var(--line); }
  .finder__status{ order:3; }
  .finder__list{ order:4; max-height:520px; }
}
@media (prefers-reduced-motion:reduce){ .finder *{ transition:none !important; } }
@media (hover:none){
  .finder .cluster:hover div, .finder .pin:hover svg{ transform:none; }
  .church:hover:not(.is-active){ background:none; }   /* phones keep a "hover" after a tap */
}

/* distance slider */
.finder__radius{ margin-top:16px; }
.finder__radius label{ display:block; font-size:14px; color:var(--ink); margin-bottom:6px; }
.finder__radius output{ font-weight:700; font-variant-numeric:tabular-nums; }
.finder__radius input[type=range]{ --pct:100%; width:100%; height:24px; margin:0; background:none; appearance:none; -webkit-appearance:none; cursor:pointer; }
.finder__radius input[type=range]::-webkit-slider-runnable-track{ height:4px; border-radius:2px;
  background:linear-gradient(to right, var(--orange) var(--pct), #ddd8cf var(--pct)); }
.finder__radius input[type=range]::-moz-range-track{ height:4px; border-radius:2px; background:#ddd8cf; }
.finder__radius input[type=range]::-moz-range-progress{ height:4px; border-radius:2px; background:var(--orange); }
.finder__radius input[type=range]::-webkit-slider-thumb{ -webkit-appearance:none; width:20px; height:20px; margin-top:-8px;
  border-radius:50%; background:#fff; border:2px solid var(--orange); box-shadow:0 1px 3px rgba(0,0,0,.2); }
.finder__radius input[type=range]::-moz-range-thumb{ width:16px; height:16px; border-radius:50%; background:#fff; border:2px solid var(--orange); }
.finder__radius input[type=range]:focus-visible{ outline:2px solid var(--orange); outline-offset:4px; }
.finder__scale{ display:flex; justify-content:space-between; font-size:12px; color:var(--gray-dk); margin-top:2px; }

/* before a search, and when nothing is in range */
.finder__empty{ display:grid; justify-items:center; gap:8px; text-align:center; padding:48px 28px; color:var(--gray-dk); font-size:15px; line-height:1.5; }
.finder__empty svg{ width:30px; height:42px; color:var(--orange); margin-bottom:6px; }
.finder__empty-title{ font-family:var(--serif); font-weight:600; font-size:clamp(18px, 16.5px + .3vw, 22px); line-height:1.3; color:#000; text-wrap:balance; }
.finder__empty p{ max-width:26em; }
.finder .finder__widen{ margin-top:10px; height:44px; padding:0 20px; }
.church__note{ display:block; margin-top:2px; font-size:12.5px; font-style:italic; color:var(--gray-dk); }
@media (max-width:820px){ .finder__empty{ padding:32px 20px; } }
