/* conceit  A dark relief map with one luminous line crossing the Mediterranean
   shape    Full viewport map with map controls and no permanent panels
   type     Baskervville for route place names and water labels, Hedvig Letters Sans for coordinates and controls
   colour   Blue-black water, slate land, gold itinerary
   grid     One map plane, controls and credits inside the safe areas
   texture  Shaded relief within country outlines
   motion   Map gestures follow the pointer directly
   move     Route zoom fits the whole walk or the first section
   details  Place labels avoid collisions, route gaps stay gaps, popup follows a point,
            zoom limits disable buttons, controls have keyboard focus and offline status appears on failure */
:root {
  color-scheme: dark;
  font-family: "Hedvig Letters Sans", system-ui, sans-serif;
  background: #101a20;
  color: #f5efe2;
  --route: #f0b969;
  --control: #172329;
  --line: #394a4e;
  --attribution: #a3b0b1;
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
button { color: inherit; font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
#map { position: relative; height: 100svh; height: 100dvh; isolation: isolate; touch-action: none; cursor: grab; outline-offset: -3px; }
#map.dragging { cursor: grabbing; }
canvas, #pins { position: absolute; inset: 0; width: 100%; height: 100%; }
#pins { overflow: hidden; pointer-events: none; }
.controls {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  display: grid;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--control);
  box-shadow: 0 5px 20px #060b0e80;
}
.controls button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 23px;
  line-height: 1;
}
.controls button + button { border-top: 1px solid var(--line); }
button:disabled { opacity: .42; cursor: default; }
@media (hover: hover) {
  .controls button:hover:enabled, #close:hover { background: #26383d; }
}
button:focus-visible, a:focus-visible { outline: 2px solid #fff0ce; outline-offset: -3px; }
.fit { width: 17px; height: 14px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; }
.fit::after { content: ""; position: absolute; inset: 3px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: skewY(-24deg); }
.target { width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
.target::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: currentColor; }
.pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  pointer-events: auto;
  color: #fff4d9;
}
.pin::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: #1e292c;
  box-shadow: 0 0 0 3px #182328b0;
}
.pin.stage::before { width: 6px; height: 6px; background: #1e292c; }
.pin.departure::before, .pin.destination::before { width: 9px; height: 9px; background: var(--route); border-color: #fff1ca; }
.pin[aria-expanded=true]::before, .pin:hover::before { box-shadow: 0 0 0 4px #f0b96955; }
.pin span {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: "Baskervville", Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: .005em;
  line-height: 1;
  text-shadow: 0 1px 4px #05090b, 0 0 7px #05090b, 0 0 10px #05090b;
  pointer-events: auto;
}
.pin.flip span { left: auto; right: 30px; }
.pin.lift span { top: auto; bottom: 35px; left: calc(50% + var(--label-shift, 0px)); right: auto; transform: translateX(-50%); }
.pin.lower span { top: 38px; left: calc(50% + var(--label-shift, 0px)); right: auto; transform: translateX(-50%); }
.pin.unlabeled span { visibility: hidden; }
.map-key, .credit, #connection {
  position: absolute;
  margin: 0;
  z-index: 2;
  font-size: 11px;
  letter-spacing: .015em;
  line-height: 1.35;
  color: #d0d9d8;
  background: #111c21f0;
  border: 1px solid #2d3e42;
  border-radius: 6px;
}
.map-key {
  display: flex;
  flex-wrap: wrap;
  column-gap: 13px;
  row-gap: 5px;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 7px 9px;
}
.map-key > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sample { width: 14px; height: 0; border-top: 2px solid var(--route); }
.sample.corridor { border-top: 2px dashed #cda578; }
.credit {
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 4px 6px;
  color: var(--attribution);
  font-size: 10px;
}
.credit a { color: inherit; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
#connection { max-width: calc(100% - 78px); padding: 7px 9px; top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); }
.detail {
  z-index: 3;
  position: absolute;
  display: flex;
  align-items: start;
  gap: 12px;
  width: max-content;
  max-width: min(320px, calc(100% - 24px));
  padding: 6px 6px 6px 12px;
  border: 1px solid #536466;
  border-radius: 8px;
  background: #172429;
  box-shadow: 0 8px 30px #040909b8;
  cursor: default;
}
.detail > div { padding: 5px 0; }
.detail strong { display: block; font: 400 20px/1.12 "Baskervville", Georgia, serif; }
.detail p { margin: 3px 0 0; color: #ced6d5; font-size: 12px; line-height: 1.4; white-space: pre-line; }
#close { border: 0; border-radius: 4px; background: transparent; color: #d0d8d6; width: 36px; height: 36px; font-size: 20px; }
.no-script { position: absolute; top: 20px; left: 20px; }
@media (max-width: 620px) {
  .controls { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
  .map-key { left: max(12px, env(safe-area-inset-left)); bottom: max(35px, calc(env(safe-area-inset-bottom) + 25px)); }
  .credit { right: max(12px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); }
  #connection { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
  .pin span { font-size: 16px; left: 27px; }
  .pin.flip span { right: 28px; }
}
.share { display: grid; min-height: 100dvh; place-items: center; padding: 24px; text-align: center; }
.share p { margin: 0; }
.share button { margin: 12px auto 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--control); }

.account {
  width: min(100%, 24rem);
  margin: 0 auto;
  padding: 1.25rem;
  text-align: left;
}
.account h1 { margin: 0 0 1.75rem; font-size: 2rem; font-weight: 500; }
.account form:not([hidden]) { display: grid; gap: .55rem; }
.account label { margin-top: .65rem; }
.account input {
  width: 100%;
  box-sizing: border-box;
  color: inherit;
  background: #192832;
  border: 1px solid #65808c;
  border-radius: .35rem;
  padding: .75rem;
  font: inherit;
}
.account form p { margin: 0 0 .5rem; color: #bccace; }
.account button { margin-top: .65rem; }
