/* The map, wherever it is drawn.

   The script behind this has been shared between the event page and the
   delivery-areas page for a while; the styles were not. They stayed in
   events.css, which the areas page does not load, so that page rendered
   the whole map into a box 424 pixels wide and nothing high — Leaflet
   loaded, the tiles loaded, the twenty-eight districts were handed over,
   and the reader saw a gap between the district count and the hint that
   told them to tap one.

   Class names keep their ev- prefix. They are the names the script writes
   and the markup already carries, and renaming them across two pages to
   tidy a prefix would be a lot of risk for a cosmetic gain.

   One height ladder, one set of pins, one animation. Changing the map now
   changes it on both pages, which is what "the same map" should have
   meant all along. */

.ev-map-wrap{margin-top:20px}

.ev-map{
  position:relative;height:340px;border-radius:18px;overflow:hidden;
  border:1px solid var(--line);background:var(--mist);

  /* Leaflet numbers its own layers generously — the tile pane is 200, the
     marker pane 600, the zoom control 1000 — and position:relative with no
     z-index makes no stacking context, so those numbers were being compared
     against the sticky header's 50 in the root. The map slid over the menu
     on the way past. isolate keeps Leaflet's whole ladder inside this box,
     where it only has to order itself. */
  isolation:isolate;z-index:0
}

/* Something to look at while the tiles are on their way. */
.ev-map-skel{position:absolute;inset:0;display:grid;place-items:center;background:var(--mist)}
.ev-map-skel span{
  width:34px;height:34px;border-radius:50%;
  border:3px solid rgba(15,51,37,.15);border-top-color:var(--forest);
  animation:ev-spin .9s linear infinite
}
@keyframes ev-spin{to{transform:rotate(360deg)}}
.ev-map.ready .ev-map-skel{opacity:0;pointer-events:none;transition:opacity .4s ease}

.ev-map-hint{margin:12px 0 0;font-size:14px;color:var(--slate);text-align:center}

/* The map underneath is turned down, not the pins up. Every road and river
   stays where it was; they simply stop shouting over the two colours that
   carry meaning. */
.ev-map .leaflet-tile-pane{filter:saturate(.28) brightness(1.07) contrast(.9)}

/* The yard, and the districts arriving one after another. */
.ev-pin{
  /* display:block matters more than every other line here. These are
     <i> elements, and width and height do nothing to an inline box, so
     each pin was drawn as a 6px speck made of nothing but its own border
     no matter what size was asked for. */
  /* Centred on the point it marks. Leaflet anchors the icon box at the
     coordinate and the pins are wider than that box, so left alone the
     depot sat five pixels south-east of the yard. The centring uses the
     translate property rather than transform, which the drop animation
     owns. */
  display:block;position:absolute;left:50%;top:50%;translate:-50% -50%;
  width:17px;height:17px;border-radius:50%;
  background:var(--leaf);border:3px solid #fff;
  box-shadow:0 0 0 1px rgba(15,51,37,.3),0 4px 12px rgba(15,51,37,.45);
  transform:scale(0);animation:ev-drop .45s cubic-bezier(.34,1.56,.64,1) forwards;
  cursor:pointer;
  transition:background .18s ease,box-shadow .18s ease
}

/* A pin the pointer is over lifts before it is pressed, so it is obvious
   the map answers to a tap. The scale is written into its own property so
   the drop animation, which owns transform, is not fought over. */
.ev-pin:hover,
.ev-pin:focus-visible{
  background:#F2A03D;
  box-shadow:0 0 0 1px rgba(15,51,37,.3),0 0 0 7px rgba(242,160,61,.26),0 6px 16px rgba(15,51,37,.5)
}

.ev-pin.ev-depot{
  width:25px;height:25px;background:var(--forest);border-color:#fff;
  box-shadow:0 0 0 1px rgba(15,51,37,.35),0 0 0 6px rgba(124,184,62,.28),0 6px 16px rgba(15,51,37,.5);
  cursor:default
}
.ev-pin.ev-depot::after{
  content:"";position:absolute;inset:-9px;border-radius:50%;
  border:2px solid rgba(15,51,37,.45);animation:ev-ping 2.6s ease-out infinite
}
.ev-pin.on{background:#F2A03D;transform:scale(1.3);box-shadow:0 0 0 1px rgba(15,51,37,.3),0 0 0 6px rgba(242,160,61,.3),0 4px 14px rgba(15,51,37,.5)}

/* The yard says so without being hovered — it is the one pin on the map
   that a reader needs before they have touched anything. */
.ev-map .leaflet-tooltip.ev-here{
  padding:3px 9px;border:0;border-radius:999px;
  background:var(--forest);color:#fff;
  font-family:var(--disp);font-size:11.5px;font-weight:700;letter-spacing:.02em;
  box-shadow:0 4px 12px rgba(15,51,37,.45)
}
.ev-map .leaflet-tooltip.ev-here::before{border-top-color:var(--forest)}

/* A district's name and distance, on hover or tap. Bengali needs the room
   and does not take letter-spacing. */
.ev-map .leaflet-tooltip.ev-lbl{
  padding:5px 11px;border:0;border-radius:11px;
  background:#15211B;color:#fff;
  font-family:var(--sans);font-size:13px;font-weight:600;line-height:1.45;
  box-shadow:0 6px 18px rgba(15,51,37,.4)
}
.ev-map .leaflet-tooltip.ev-lbl::before{border-top-color:#15211B}
html[lang="bn"] .ev-map .leaflet-tooltip.ev-lbl{font-size:14px;letter-spacing:0}
html[lang="bn"] .ev-map .leaflet-tooltip.ev-here{font-size:12.5px;letter-spacing:0}
html[lang="bn"] .ev-map-hint{font-size:15px;line-height:1.7}

@keyframes ev-drop{
  0%{transform:scale(0) translateY(-12px);opacity:0}
  100%{transform:scale(1) translateY(0);opacity:1}
}
@keyframes ev-ping{
  0%{transform:scale(.7);opacity:.7}
  70%,100%{transform:scale(2.1);opacity:0}
}

@media (min-width:760px){ .ev-map{height:420px} }
@media (min-width:1000px){ .ev-map{height:480px} }

@media (prefers-reduced-motion:reduce){
  .ev-pin{animation:none;transform:scale(1)}
  .ev-pin.ev-depot::after{animation:none}
  .ev-map-skel span{animation:none}
}
