/* Deptford map section ("Find them on the street"). Pairs with map/map.js and map/section.html.
   Uses the tokens from styles.css (--dhh-*). */

.map { border-top: 1px dashed var(--dhh-rule); }
.map-inner { max-width: 70rem; margin: 0 auto; padding: 3.5rem 1rem 4rem; }
@media (min-width: 720px) { .map-inner { padding-inline: 2rem; } }

.map-head .num { color: var(--dhh-pink-deep); }
.map-head h2 {
  margin: .35rem 0 .5rem;
  font: 400 clamp(2.2rem, 6vw, 3.2rem)/1 var(--dhh-font-display);
  letter-spacing: .02em; text-transform: uppercase;
}
.map-head p { max-width: 34rem; margin: 0 0 1.75rem; }

.map-body { display: grid; gap: 1.25rem; }
@media (min-width: 860px) {
  .map-body { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 2.25rem; }
}

/* ---- the map ---- */
.map-figure { margin: 0; min-width: 0; }
.map-canvas { position: relative; }
.map-canvas > svg { display: block; width: 100%; height: auto; }
.map-pins { position: absolute; inset: 0; }
.map-credit { margin-top: .5rem; font-size: .8rem; line-height: 1.4; }
.map-credit a { color: inherit; }

/* street labels: fewer, bigger on small screens */
@media (max-width: 599px) {
  .map .dmap .ml-minor, .map .dmap .ml-sub { display: none; }
  .map .dmap .ml-scale { display: none; }
  .map .dmap .ml-plate { transform: translate(26px, 0) rotate(-3deg) scale(1.35); }
  .map .dmap .ml-major { font-size: 21px; letter-spacing: .1em; stroke-width: 6px; }
  .map .dmap .ml-place { font-size: 15px; letter-spacing: .1em; stroke-width: 6px; }
  .map .dmap .ml-hs { font-size: 38px; stroke-width: 8px; }
  .map .dmap .ml-water { font-size: 22px; stroke-width: 6px; }
  .map .dmap .ml-osm { font-size: 17px; }
}

.map-pin {
  --size: 30px;
  position: absolute; z-index: 1;
  width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  display: grid; place-items: center; padding: 0;
  border: 2.5px solid var(--dhh-navy); border-radius: 50%;
  background: var(--dhh-pink); color: var(--dhh-white);
  font: 400 1.1rem/1 var(--dhh-font-display); letter-spacing: .02em;
  box-shadow: 2px 2px 0 var(--dhh-navy);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.map-pin span { display: block; transform: translateY(1px); }
/* Invisible 40px hit area round each pin (map.js spaces the pins out by this size, so they don't overlap). */
.map-pin::before { content: ""; position: absolute; inset: min(0px, calc(50% - 20px)); }
/* charities: a white diamond, so they read as different from the traders */
.map-pin--charity { border-radius: 4px; background: var(--dhh-white); color: var(--dhh-navy); transform: rotate(45deg); }
.map-pin--charity span { transform: rotate(-45deg) translateY(1px); }
.map-pin:hover, .map-pin.is-active { z-index: 3; background: var(--dhh-navy); color: var(--dhh-white); transform: scale(1.2); }
.map-pin--charity:hover, .map-pin--charity.is-active { transform: rotate(45deg) scale(1.2); }
.map-pin:focus { outline: none; }
.map-pin:focus-visible { z-index: 3; outline: 3px solid var(--dhh-pink-deep); outline-offset: 3px; }
@media (max-width: 599px) { .map-pin { --size: 25px; font-size: .95rem; border-width: 2px; } }

.dmap .ml-leaders line { stroke: var(--dhh-navy); stroke-width: 1.8px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dmap .ml-leaders circle { fill: var(--dhh-navy); }
.dmap .ml-leaders .is-active line { stroke: var(--dhh-pink); stroke-width: 3px; }
.dmap .ml-leaders .is-active circle { fill: var(--dhh-pink); stroke: var(--dhh-navy); stroke-width: 1.5; }

/* ---- card ---- */
.map-side { min-width: 0; }
.map-card {
  position: relative; z-index: 2; margin-bottom: 1.5rem; padding: 1rem 1.1rem 1.1rem;
  background: var(--dhh-white); border: 2.5px solid var(--dhh-navy); border-radius: 3px;
  box-shadow: 5px 5px 0 var(--dhh-kraft);
  min-height: 9.5rem;
}
/* wide screens: the side column is exactly as tall as the map, and the list scrolls inside it */
@media (min-width: 860px) {
  .map-side { display: flex; flex-direction: column; height: 0; min-height: 100%; }
  .map-card { flex: none; }
  .map-lists {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding-right: .5rem; scrollbar-width: thin; scrollbar-color: var(--dhh-navy) transparent;
    border-bottom: 1px dashed var(--dhh-rule);
  }
  .map-lists .map-list:last-child { margin-bottom: .5rem; }
  .map-lists:focus-visible { outline: 3px solid var(--dhh-pink-deep); outline-offset: 2px; }
}
.map-card > * { margin: 0; }
.map-card-hint { font-style: italic; }
.map:not(.map--js) .map-card { display: none; } /* the card needs the script; the list still works without it */
.map-card-kind {
  display: inline-block; margin-bottom: .55rem; padding: .32rem .6rem .22rem;
  background: var(--dhh-pink); color: var(--dhh-white);
  font: 600 .68rem/1.2 var(--dhh-font-label); letter-spacing: .18em; text-transform: uppercase;
  transform: rotate(-2deg);
}
.map-card.is-charity .map-card-kind { background: var(--dhh-navy); }
.map-card-name { font: 400 2rem/1 var(--dhh-font-display); letter-spacing: .02em; text-transform: uppercase; }
.map-card-blurb { margin-top: .4rem; font-size: 1rem; line-height: 1.5; }
.map-card-addr {
  margin-top: .65rem; padding-top: .55rem; border-top: 1px dashed var(--dhh-rule);
  font: 600 .74rem/1.5 var(--dhh-font-label); letter-spacing: .14em; text-transform: uppercase;
}
.map-card-links { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .6rem; font-size: .95rem; }
.map-card-links a { color: var(--dhh-pink-deep); text-underline-offset: 3px; }
.map-card-links a:hover { color: var(--dhh-navy); }
.map-card-links a:focus-visible { outline: 3px solid var(--dhh-pink-deep); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .map-card.has-place > * { animation: map-card-in .22s ease both; }
  @keyframes map-card-in { from { opacity: 0; transform: translateY(4px); } }
  .map-card.has-place > .map-card-kind { animation-name: map-tag-in; }
  @keyframes map-tag-in { from { opacity: 0; transform: rotate(-2deg) translateY(4px); } }
}

/* ---- list (the legend, and the way in without the map) ---- */
.map-list-title {
  margin: 0 0 .4rem;
  font: 600 .78rem/1.4 var(--dhh-font-label); letter-spacing: .18em; text-transform: uppercase;
}
.map-list { list-style: none; margin: 0 0 1.75rem; padding: 0; border-top: 1px dashed var(--dhh-rule); }
.map-list > li { margin: 0; }
.map-item {
  display: grid; grid-template-columns: 1.9rem 1fr; gap: .75rem; align-items: start;
  width: 100%; margin: 0; padding: .55rem .5rem .55rem .25rem;
  border: 0; border-bottom: 1px dashed var(--dhh-rule); border-left: 4px solid transparent; border-radius: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.map-item:hover, .map-item.is-active { background: var(--dhh-white); border-left-color: var(--dhh-pink); }
.map-item:focus { outline: none; }
.map-item:focus-visible { outline: 3px solid var(--dhh-pink-deep); outline-offset: -3px; }
.map-n {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-top: .1rem;
  border: 2px solid var(--dhh-navy); border-radius: 50%;
  background: var(--dhh-pink); color: var(--dhh-white);
  font: 400 1rem/1 var(--dhh-font-display);
}
.map-item--charity .map-n { border-radius: 3px; background: var(--dhh-white); color: var(--dhh-navy); transform: rotate(45deg) scale(.86); }
.map-n > span { display: block; transform: translateY(1px); }
.map-item--charity .map-n > span { transform: rotate(-45deg) scale(1.16) translateY(1px); }
.map-item.is-active .map-n { background: var(--dhh-navy); color: var(--dhh-white); }
.map-item-text { min-width: 0; line-height: 1.3; }
.map-name { font-weight: 600; font-size: 1.05rem; }
.map-item.is-active .map-name { color: var(--dhh-pink-deep); }
.map-what { display: block; font-style: italic; font-size: .92rem; }
.map-addr {
  display: block; margin-top: .15rem;
  font: 600 .66rem/1.45 var(--dhh-font-label); letter-spacing: .14em; text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .map-pin, .map-item { transition: none; }
}
