/* article-map.css: moved out of src/components/ArticleMap.astro on 2026-10-27, so a style fix is a single file upload. */

.map {
  margin: 2em 0;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.map .map-title {
  max-width: none;
  margin: 0 0 10px;
  font: 700 1.1rem/1.25 var(--title);
}

.map svg {
  display: block;
  width: 100%;
  height: auto;
  /* Tall maps (Peru) stay within one screen; the drawing keeps its proportions, centered. */
  max-height: 600px;
}

/* Ground */
.map .land {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 1.2;
}

.map .nb {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.map .terrace {
  fill: rgb(111 207 151 / 0.16);
}

.map .citadel,
.map .ruins {
  fill: #c3ced6;
}

/* Lakes, in the river colour. */
.map .water {
  fill: #b9d0de;
}

.map .paths {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

/* Lines; the same classes draw the keys under the map. */
.map .river,
.map .key-river {
  fill: none;
  stroke: #b9d0de;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map .rail,
.map .key-rail {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 7 4;
}

.map .road,
.map .key-road {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1;
}

.map .boundary,
.map .key-boundary {
  fill: none;
  stroke: var(--accent-deep);
  stroke-width: 1.4;
  stroke-dasharray: 2 3;
}

.map .trail,
.map .key-trail {
  fill: none;
  stroke: var(--accent-deep);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map .route path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map .route .casing {
  stroke: var(--paper);
  stroke-width: 7;
}

.map .route-1 .stroke,
.map .key-route {
  fill: none;
  stroke: var(--accent-deep);
  stroke-width: 3.5;
}

.map .route-2 .stroke,
.map .key-route2 {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
}

.map .label {
  fill: var(--ink-soft);
  font: 700 11px var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
}

.map .mark circle {
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 2;
}

.map .mark text {
  fill: var(--paper);
  font: 700 10px var(--head);
  text-anchor: middle;
}

.map .scale path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.map .scale text,
.map .north text {
  fill: var(--ink);
  font: 700 10px var(--head);
}

.map .north path {
  fill: var(--ink);
}

.map .north text {
  text-anchor: middle;
}

.map .keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font: 700 0.84rem/1.3 var(--head);
}

.map .keys li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map .keys svg {
  flex: 0 0 32px;
  width: 32px;
}

.map .stops {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 22px;
  margin: 16px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.map .stops li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.map .num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font: 700 0.72rem/1 var(--head);
}

.map .stops b {
  font: 700 0.98rem/1.3 var(--title);
  color: var(--ink);
}

.map .stops em {
  font-style: normal;
  font-size: 0.84rem;
}

.map figcaption {
  margin-top: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.map .credit {
  max-width: none;
  margin: 8px 0 0;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

/* On a phone the drawing shrinks to about half, so its marks and text are drawn larger. */
@media (max-width: 700px) {
  .map .mark circle {
    r: 15px;
  }
  .map .mark text {
    font-size: 16px;
    transform: translateY(2.5px);
  }
  .map .label {
    font-size: 18px;
  }
  .map .scale text,
  .map .north text {
    font-size: 17px;
  }
  .map .stops {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }
}
