/* How to get to a place (src/map/place-page.mjs): its card, the map of the
   ways there, each way under its name and mark, and the climb tool's words
   and picture for a walk, in the page's flow rather than over a map. Linked
   after the site's styles and the climb tool's, only on a page that has the
   block. */

.place-approach {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 6%);
  color: var(--navy);
}

.place-approach h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.place-approach p {
  margin: 4px 0 0;
}

.place-approach-map {
  margin: 4px 0 12px;
}

.place-approach-map[hidden] {
  display: none;
}

/* The map's ground colour holds its place until it draws. */
.place-approach-map-canvas {
  height: 280px;
  overflow: hidden;
  border-radius: 12px;
  background: #ece7dc;
}

/* In the column beside the story on a wide screen, as tall as it is wide,
   so the ways close to the place are not crowded together. */
@media (min-width: 900px) {
  .place-approach-map-canvas {
    height: auto;
    aspect-ratio: 1;
  }
}

/* Opened over the whole window by its button. */
.place-approach-map-canvas.is-full {
  position: fixed;
  inset: 0;
  z-index: 1000;
  height: auto;
  aspect-ratio: auto;
  border-radius: 0;
}

.place-approach-card {
  margin-bottom: 8px;
}

.place-approach-card[hidden],
.place-approach-climb[hidden] {
  display: none;
}

.place-approach h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 6px;
  font-size: 1rem;
}

/* The colour each walk is drawn in on the map, as `colours` in
   public/map/maps/approach-map.mjs has them, in order. */
.place-approach-swatch {
  flex: none;
  width: 24px;
  height: 6px;
  border-radius: 3px;
  background: #c2410c;
}

.place-approach-swatch--1 {
  background: #3f7a3a;
}

.place-approach-swatch--2 {
  background: #4f7d6a;
}

/* The rides up, as `rideColours` in public/map/maps/approach-map.mjs has
   them, in order. */
.place-approach-swatch--ride-0 {
  background: #6d28d9;
}

.place-approach-swatch--ride-1 {
  background: #e11d74;
}

/* The buses' routes are dashed on the map, as `busColour` in
   public/map/maps/approach-map.mjs has them. */
.place-approach-swatch--bus {
  background: repeating-linear-gradient(90deg, #2a6f97 0 7px, transparent 7px 11px);
}

/* Whom a walk suits, under its name. */
.place-approach .place-approach-note {
  margin: 0 0 4px;
  color: var(--muted);
}

/* How far a way is, told alike for every way there, under its name. */
.place-approach .place-approach-facts {
  margin: 0 0 6px;
}

.place-approach-climb {
  color: var(--muted);
}

/* The one line about safety, set apart so it is not read past, yet no
   louder than the ways one is meant to take. */
.place-approach .place-approach-warning {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-block: 2px;
  padding-inline: 10px 0;
  border-inline-start: 3px solid #b45309;
  color: #5c3410;
}

.place-approach-warning::before {
  content: "⚠";
  flex: none;
  color: #b45309;
}

.place-approach-climb::before {
  content: "↑";
  margin-inline-end: 4px;
  color: var(--gold);
}

/* The way to the climb tool, for the climb from where one stays. */
.place-approach-own {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.place-approach-own a {
  color: var(--navy);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.place-approach-own a::after {
  content: " →";
  color: var(--gold);
}

[dir="rtl"] .place-approach-own a::after {
  content: " ←";
}

.place-approach-credit {
  color: var(--muted);
  font-size: 0.8125rem;
}

.place-approach-credit a {
  color: inherit;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

/* The same words and pictures for the walk laid to a place, in its page's
   flow rather than over a map: the climb under the walk's other lines, the
   profile at the foot of the picture, which is smaller here, among the
   page's words. */
.place-approach-card .map-climb-result {
  max-width: 420px;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
}

.place-approach-card .map-climb-words {
  display: flex;
  flex-direction: column;
}

.place-approach-card .map-climb-profile {
  margin-top: auto;
}

.place-approach-card .map-climb-side {
  align-self: end;
}

.place-approach-card .map-climb-building {
  width: 44px;
  height: 96px;
}

.place-approach-card .map-climb-result p {
  margin: 0 0 4px;
}

/* The climb is a detail of the walk, told under how far it is, not above it. */
.place-approach-card .map-climb-main {
  color: var(--muted);
  font-size: inherit;
  font-weight: 400;
}

.place-approach-card .map-climb-at {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}
