/* BAN HAUS location map. Colours come from the palette in banhaus-map.js (set as --bh-map-*).
   Type sizes follow the site scale (12 / 14 / 16: --t-xs, --t-s, --t-m, with fallbacks for use outside the site);
   targets are 44 px. */
.bh-map {
  --bh-map-paper: #F2EEE6;
  --bh-map-cream: #D8CEBD;
  --bh-map-ink: #25211D;
  --bh-map-timber: #A57A48;
  --bh-map-rust: #78402F;
  --bh-map-green: #2F483F;
  --bh-map-line8: #C2577A;
  --bh-map-street: #F9F7F2;
  --bh-map-halo: 0 0 1px var(--bh-map-street), 0 0 2px var(--bh-map-street), 0 0 3px var(--bh-map-street),
    0 0 4px var(--bh-map-street), 0 0 6px var(--bh-map-street);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  container: bhmap / inline-size;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  background: var(--bh-map-paper);
  color: var(--bh-map-ink);
  border: 1px solid color-mix(in srgb, var(--bh-map-ink) 14%, transparent);
  border-radius: 2px;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 639px) {
  .bh-map { aspect-ratio: 4 / 5; }
}

/* static image: placeholder while loading, the map itself without JS/WebGL */
.bh-map__static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 28% 30%;
  transition: opacity .5s ease;
}
.bh-map.is-ready .bh-map__static { opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s .5s; }
.bh-map.is-static { aspect-ratio: auto; min-height: 0; }
.bh-map.is-static .bh-map__static { position: relative; height: auto; object-fit: contain; display: block; }
.bh-map.is-static .bh-map__gl,
.bh-map.is-static .bh-map__ui,
.bh-map.is-static .bh-map__credit { display: none; }

/* `.maplibregl-map` (added to this element) sets position: relative; keep it filling the frame */
.bh-map .bh-map__gl,
.bh-map .bh-map__gl.maplibregl-map {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
}
.bh-map.is-ready .bh-map__gl { opacity: 1; }
/* markers and hints use the page's typeface, not MapLibre's default Helvetica stack */
.bh-map .bh-map__gl.maplibregl-map { font: inherit; }
.bh-map .maplibregl-canvas:focus-visible { outline: 2px solid var(--bh-map-ink); outline-offset: -4px; }
.bh-map .maplibregl-canvas-container.maplibregl-interactive { cursor: grab; }
.bh-map .maplibregl-canvas-container.maplibregl-interactive:active { cursor: grabbing; }

.bh-map__sr {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* controls */
.bh-map__ui {
  position: absolute;
  z-index: 3;
  top: 14px; left: 14px; right: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 6px 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease .1s;
}
.bh-map.is-ready .bh-map__ui { opacity: 1; }
.bh-map__ui > * { pointer-events: auto; }
.bh-map__panel {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bh-map-street) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--bh-map-ink) 16%, transparent);
  border-radius: 3px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--bh-map-ink) 8%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.bh-map__views {
  display: flex;
  padding: 3px;
  gap: 2px;
}
.bh-map__view,
.bh-map__zbtn {
  appearance: none;
  margin: 0;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.bh-map__view {
  padding: 7px 12px 7px;
  font-size: var(--t-s, 14px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: .01em;
  background: transparent;
  border-radius: 2px;
  color: color-mix(in srgb, var(--bh-map-ink) 78%, transparent);
  transition: background-color .2s ease, color .2s ease;
}
.bh-map__view:hover { color: var(--bh-map-ink); background: color-mix(in srgb, var(--bh-map-ink) 6%, transparent); }
.bh-map__view[aria-pressed="true"] { background: var(--bh-map-ink); color: var(--bh-map-paper); }
.bh-map__distance {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px 8px;
  border-top: 1px solid color-mix(in srgb, var(--bh-map-ink) 10%, transparent);
  font-size: var(--t-xs, 12px);
  line-height: 1.3;
  color: color-mix(in srgb, var(--bh-map-ink) 76%, transparent);
}
.bh-map__distance::before {
  content: "";
  flex: none;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--bh-map-rust);
}
.bh-map__zoom {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bh-map-street) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--bh-map-ink) 16%, transparent);
  border-radius: 3px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--bh-map-ink) 8%, transparent);
  overflow: hidden;
}
.bh-map__zbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
}
.bh-map__zbtn + .bh-map__zbtn { border-top: 1px solid color-mix(in srgb, var(--bh-map-ink) 12%, transparent); }
.bh-map__zbtn svg { width: 15px; height: 15px; }
.bh-map__zbtn:hover { background: color-mix(in srgb, var(--bh-map-ink) 6%, transparent); }
.bh-map__view:focus-visible,
.bh-map__zbtn:focus-visible,
.bh-pin--parking:focus-visible,
.bh-map__credit a:focus-visible {
  outline: 2px solid var(--bh-map-ink);
  outline-offset: 2px;
}

/* attribution */
.bh-map__credit {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 2px 8px 3px;
  font-size: var(--t-xs, 12px);
  line-height: 1.3;
  letter-spacing: .01em;
  color: color-mix(in srgb, var(--bh-map-ink) 66%, transparent);
  background: color-mix(in srgb, var(--bh-map-paper) 84%, transparent);
  border-top-left-radius: 2px;
}
.bh-map__credit a { color: inherit; text-decoration: none; }
.bh-map__credit a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* cooperative-gesture hint, restyled */
.bh-map .maplibregl-cooperative-gesture-screen {
  z-index: 4;
  padding: 24px;
  background: color-mix(in srgb, var(--bh-map-ink) 58%, transparent);
  color: var(--bh-map-paper);
  font: inherit;
  font-size: var(--t-s, 14px);
  letter-spacing: .01em;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------------------- */
/* markers: zero-size anchors; children are laid out around the exact point.                 */
/* Labels sit to one side (.is-left / .is-right, chosen by the label placer in JS).           */
.bh-pin { --gap: 18px; position: relative; display: block; width: 0; height: 0; color: var(--bh-map-ink); }
.bh-pin__label {
  position: absolute;
  top: 50%;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  line-height: 1.25;
  text-shadow: var(--bh-map-halo);
  pointer-events: none;
  transform: translateY(-50%);
}
.bh-pin.is-right .bh-pin__label { left: var(--gap); align-items: flex-start; text-align: left; }
.bh-pin.is-left .bh-pin__label { right: var(--gap); align-items: flex-end; text-align: right; }
.bh-pin.is-above .bh-pin__label,
.bh-pin.is-below .bh-pin__label { left: 0; align-items: center; text-align: center; transform: translateX(-50%); }
.bh-pin.is-above .bh-pin__label { top: auto; bottom: var(--gap); }
.bh-pin.is-below .bh-pin__label { top: var(--gap); }
.bh-pin.is-label-hidden .bh-pin__label { visibility: hidden; }
.bh-pin.is-covered { visibility: hidden; }
.bh-pin__name { font-size: var(--t-s, 14px); font-weight: 600; letter-spacing: .005em; }
.bh-pin__sub { font-size: var(--t-xs, 12px); font-weight: 500; color: color-mix(in srgb, var(--bh-map-ink) 78%, transparent); }
.bh-pin__note { font-size: var(--t-xs, 12px); color: color-mix(in srgb, var(--bh-map-ink) 64%, transparent); margin-top: 1px; }

/* venue — the logo's open circle around the building, the route ends at its frontage */
.bh-pin--venue { --gap: 36px; z-index: 5; }
.bh-pin--venue .bh-pin__badge {
  position: absolute;
  left: -27px; top: -27px;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bh-map-street) 92%, transparent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--bh-map-ink) 14%, transparent),
    0 6px 18px -6px color-mix(in srgb, var(--bh-map-ink) 30%, transparent);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.bh-pin__arc { position: absolute; inset: 3px; width: 48px; height: 48px; color: var(--bh-map-ink); }
.bh-pin__dot { fill: var(--bh-map-rust); }
.bh-pin__mark { position: absolute; inset: 5px; width: 44px; height: 44px; object-fit: contain; }
.bh-pin--venue.has-mark .bh-pin__arc,
.bh-pin--venue.has-mark.name-auto .bh-pin__name,
.bh-pin--venue.name-never .bh-pin__name { display: none; }
/* the name is set quietly: it must not compete with the logo's own lettering */
.bh-pin--venue .bh-pin__name { font-size: var(--t-s, 14px); font-weight: 500; letter-spacing: .02em; }
.bh-pin--venue .bh-pin__sub { font-size: var(--t-s, 14px); font-weight: 600; color: var(--bh-map-ink); }
.bh-map.is-drawing .bh-pin--venue .bh-pin__badge { transform: scale(.92); }
.bh-map.is-arrived .bh-pin--venue .bh-pin__badge { transform: scale(1); }

/* subway exit */
.bh-pin--exit { --gap: 20px; z-index: 4; }
.bh-pin--exit .bh-pin__square {
  position: absolute;
  left: -12px; top: -12px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 3px;
  background: var(--bh-map-ink);
  color: var(--bh-map-paper);
  font-size: var(--t-xs, 12px); font-weight: 600; line-height: 1;
  box-shadow: inset 0 -3px 0 var(--bh-map-line8), 0 0 0 2px var(--bh-map-street);
  font-variant-numeric: lining-nums;
}

/* turn point */
.bh-pin--turn { --gap: 13px; z-index: 3; }
.bh-pin__ring {
  position: absolute;
  left: -6px; top: -6px;
  width: 12px; height: 12px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--bh-map-street);
  border: 2.5px solid var(--bh-map-rust);
}
.bh-pin--turn .bh-pin__name { font-size: var(--t-s, 14px); }

/* station */
.bh-pin--station { --gap: 12px; z-index: 2; }
.bh-pin--station .bh-pin__ring { border-color: var(--bh-map-line8); }
.bh-pin--station .bh-pin__name { font-size: var(--t-s, 14px); }
.bh-pin__line { font-size: var(--t-xs, 12px); font-weight: 600; color: color-mix(in srgb, var(--bh-map-line8) 80%, var(--bh-map-ink)); }

/* parking */
.bh-pin--parking { --gap: 19px; z-index: 2; text-decoration: none; }
.bh-pin--parking .bh-pin__square {
  position: absolute;
  left: -12px; top: -12px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 3px;
  background: var(--bh-map-green);
  color: var(--bh-map-paper);
  font-size: var(--t-xs, 12px); font-weight: 600; line-height: 1;
  box-shadow: 0 0 0 2px var(--bh-map-street);
  transition: transform .2s ease;
}
.bh-pin--parking .bh-pin__label { font-size: var(--t-xs, 12px); font-weight: 500; pointer-events: auto; }
.bh-pin--parking:hover .bh-pin__square { transform: scale(1.08); }
.bh-pin--parking:hover .bh-pin__label { text-decoration: underline; text-underline-offset: 2px; }

/* per-view simplification (the walk view shows the station: the route starts at its exit) */
.bh-map[data-view="parking"] .bh-pin--turn { display: none; }
.bh-map[data-view="parking"] .bh-pin--venue .bh-pin__note,
.bh-map[data-view="parking"] .bh-pin--exit .bh-pin__sub { display: none; }

@container bhmap (max-width: 560px) {
  .bh-map__ui { top: 10px; left: 10px; right: 10px; }
  .bh-map__view { padding: 7px 10px; }
  .bh-pin__note { white-space: normal; width: max-content; max-width: 8.6em; word-break: keep-all; }
}

@media (prefers-reduced-motion: reduce) {
  .bh-map *, .bh-map .bh-pin__badge { transition: none !important; }
}
