/* About: the working route. One line runs down the rowhouse hall and one stretch of it is lit at a time. */

.route--house {
  --landing: clamp(1.5rem, 5vh, 3.5rem);
  --hall-run: var(--phone-hall);
  --label-run: 7rem;
  max-width: var(--house-width);
  margin-inline: auto;
  padding: 0 var(--reach) var(--storey);
}

/* One stop per stretch of the route; phones keep the 26 px gutter and stack the words beside it */
.route--stop {
  display: grid;
  grid-template-areas: "hall tag" "hall words" "hall voice";
  grid-template-columns: var(--hall-run) minmax(0, 1fr);
  column-gap: .9rem;
  row-gap: .6rem;
  padding-block: var(--landing);
}
.route--stop[data-stop="top-floor"],
.route--stop[data-stop="front-door"] {
  grid-template-areas: "hall tag" "hall words" "hall picture";
}

/* The drawn hall: each stop carries its own piece, and the pieces meet at the same x so the line stays whole */
.route--hall {
  grid-area: hall;
  position: relative;
  margin-block: calc(-1 * var(--landing));
}
.route--hall svg { position: absolute; inset: 0; }

.route--line {
  fill: none;
  stroke: var(--petrol);
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
  opacity: .32;
  transition: opacity var(--swing), stroke var(--swing);
}
.route--stop[data-state="reading"] .route--line {
  stroke: var(--biro);
  opacity: 1;
}

/* Labels sit in their own margin, clear of the line */
.route--tag {
  grid-area: tag;
  margin: 0;
  font: 500 1.0625rem/1.3 var(--plan-lettering);
  color: var(--petrol);
}
.route--tag::before { content: "/ "; color: var(--biro); }

.route--words { grid-area: words; min-width: 0; max-width: 40rem; }
.route--words p { max-width: 38rem; }
.route--words .room--head { margin-bottom: .6rem; }
.route--words a { text-underline-offset: .2em; }

/* The owner's own sentences, set open along the hall */
.route--voice { grid-area: voice; min-width: 0; }
.route--voice p {
  max-width: 34rem;
  margin: 0 0 .9rem;
  font: 500 1.25rem/1.45 var(--plan-lettering);
  color: var(--petrol);
}

.route--picture { grid-area: picture; min-width: 0; }
.route--picture .sill--rule { margin-top: .5rem; }

/* Hand-off at the front door */
.exit--links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
  margin: .4rem 0 .8rem;
  padding: 0;
  list-style: none;
}
.exit--links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 1.125rem;
}

/* ---------- DESK ---------- */
@media (min-width: 48rem) {
  .route--house { --hall-run: 5rem; }
  .route--stop {
    grid-template-areas: "hall tag words voice";
    grid-template-columns: var(--hall-run) var(--label-run) minmax(0, 1fr) minmax(0, 1.3fr);
    column-gap: clamp(1.5rem, 3vw, 3rem);
    row-gap: 0;
    align-items: start;
  }
  .route--stop[data-stop="top-floor"],
  .route--stop[data-stop="front-door"] {
    grid-template-areas: "hall tag words picture";
    grid-template-columns: var(--hall-run) var(--label-run) minmax(0, 1fr) minmax(0, 1.5fr);
  }
  .route--hall { align-self: stretch; }
  .route--tag { padding-top: .6rem; }
  .route--voice { padding-top: 2.4rem; }
  .route--voice p { font-size: clamp(1.25rem, 1rem + .9vw, 1.65rem); }
  .route--picture { align-self: center; }
}

/* ---------- STILL ---------- */
/* Without motion the whole route is drawn, in blue, and stays that way */
@media (prefers-reduced-motion: reduce) {
  .route--line { stroke: var(--biro); opacity: 1; transition: none; }
}
