/* ==========================================================================
   Lia's research map.
   A drawn map, not a real one. Ink on dusk rather than ink on parchment, so
   it belongs to the same evening as the rest of the site.
   ========================================================================== */

.map-wrap {
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
}

.map {
  position: relative;
  /* The art is 400x500, and the markers are placed as percentages, so the
     box has to keep that shape or they would drift off their features. */
  aspect-ratio: 400 / 500;
  width: 100%;
}

.map-art {
  display: block;
  width: 100%;
  height: 100%;
}

/* The drawn lines. One weight for the land, a lighter one for the sea. */
.ink {
  fill: none;
  stroke: #9d86d8;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ink.faint { stroke: #5f4f96; stroke-width: 1.2; }

/* Sea and land, so the coast reads as a coast rather than a crack. */
.sea  { fill: rgba(44, 74, 134, 0.16); stroke: none; }
.land { fill: #130d33; stroke: none; }

.coast {
  fill: none;
  stroke: #bcaaef;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Landforms are solid shapes sitting on the ground, not floating arcs. */
.hills {
  fill: rgba(157, 134, 216, 0.14);
  stroke: #9d86d8;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.water {
  fill: rgba(80, 130, 200, 0.22);
  stroke: #7d9fd8;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.trees {
  fill: rgba(140, 200, 170, 0.16);
  stroke: #86bfa2;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.stone {
  fill: rgba(200, 180, 240, 0.2);
  stroke: #b3a2e0;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.compass {
  fill: none;
  stroke: #8c79c8;
  stroke-width: 1.3;
  stroke-linecap: round;
}

.compass .needle { fill: rgba(182, 129, 255, 0.5); }

/* Her route: pencilled in afterwards, not part of the printed map. */
.route {
  fill: none;
  stroke: var(--leas);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 1 7;
  opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Markers
   -------------------------------------------------------------------------- */

.pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  /* 44px square, centred on its point rather than hanging off it. */
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  color: inherit;
}

.pin-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 8px auto;
  border-radius: 50%;
  border: 1.5px solid var(--leas);
  background: #170f3a;
  color: var(--leas-soft);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.pin:hover .pin-num { background: #241663; }

.pin:focus-visible { outline: none; }
.pin:focus-visible .pin-num {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* The open marker is filled AND larger AND its note is showing, so the state
   never rests on colour alone. */
.pin[aria-expanded="true"] .pin-num {
  background: var(--leas);
  border-color: var(--leas-soft);
  color: #1a0f3d;
  box-shadow: 0 0 16px rgba(182, 129, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Notes
   -------------------------------------------------------------------------- */

.notes {
  width: 100%;
  max-width: 34em;
  margin-inline: auto;
  min-height: 7.5em;
}

.note-prompt {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-align: center;
}

.note {
  padding: 2px 0 2px 18px;
  border-left: 1px solid rgba(182, 129, 255, 0.3);
}

.note[hidden] { display: none; }

.note-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: var(--leas-soft);
}

.note p {
  margin: 0;
  color: #ded7fb;
  font-size: 1.02rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.aside {
  max-width: 34em;
  margin-inline: auto;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-align: center;
}

/* Very old browsers without aspect-ratio: fall back to a fixed height so the
   markers still land on their features. */
@supports not (aspect-ratio: 4 / 5) {
  .map { height: 500px; }
}
