/* The setup guide: a line map of the steps up top, then each part's steps as stops along its own line,
   coloured like it: the community pink, the live map cyan, dispatching amber. */

.gd-page {
  width: min(1120px, 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: 56px 0 80px;
}

.gd-page [id] {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.gd-hero h1 {
  max-width: 21ch;
  font-size: clamp(42px, 6.6vw, 78px);
  font-weight: 800;
  font-stretch: 80%;
  line-height: 0.95;
  letter-spacing: -0.015em;
}

.gd-lead {
  max-width: 62ch;
  margin-top: 22px;
  color: var(--haze);
  font-size: 19px;
  line-height: 1.6;
}

.gd-page small {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--haze);
  font: 600 13px/1.3 var(--text);
  letter-spacing: 0;
  vertical-align: middle;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 25px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 7px;
  color: var(--moon);
  font: 700 14px/1 var(--text);
  vertical-align: 1px;
}

/* ---- the line map: one line for each part, a stop for each step, lined up in columns */

.gd-route {
  margin-top: 44px;
  padding: 24px 28px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(29, 19, 66, 0.45);
}

.gd-line {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 12px 0;
}

.gd-line-name {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 1px;
  color: var(--moon);
  font: 750 18px/1.2 var(--display);
  font-stretch: 88%;
  text-decoration: none;
}

.gd-line-name::before {
  content: "";
  flex: none;
  width: 24px;
  height: 7px;
  border-radius: 4px;
  background: var(--gd-line);
}

.gd-line-name small {
  margin-left: 0;
  padding: 1px 8px;
  font-size: 12px;
}

.gd-stations {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.gd-stations li {
  position: relative;
}

/* The track from this stop to the next. */
.gd-stations li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 100%;
  height: 4px;
  background: var(--gd-line);
}

.gd-stations a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 4px 4px;
  color: var(--haze);
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.gd-stations a::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border: 4px solid var(--gd-line);
  border-radius: 50%;
  background: var(--night);
  transition: background-color 0.15s ease;
}

.gd-stations a:hover {
  color: var(--moon);
}

.gd-stations a:hover::before {
  background: var(--gd-line);
}

.gd-route-help {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 15px;
}

.gd-route-help a,
.gd-text a:not(.button),
.gd-still a,
.gd-need a {
  color: var(--moon);
  text-underline-offset: 3px;
}

/* ---- what you need */

.gd-need {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  margin-top: 36px;
  padding: 0 28px;
}

.gd-need h2 {
  padding-top: 2px;
  font-size: 18px;
  font-weight: 750;
  font-stretch: 88%;
}

.gd-need ul {
  display: grid;
  gap: 8px;
  max-width: 70ch;
  margin: 0;
  padding-left: 20px;
  color: var(--haze);
}

.gd-need li::marker {
  color: var(--dim);
}

/* ---- a part: its line's colour, then its steps as stops */

.gd-part {
  margin-top: 92px;
}

.gd-part-head::before {
  content: "";
  display: block;
  width: 64px;
  height: 8px;
  margin-bottom: 20px;
  border-radius: 4px;
  background: var(--gd-line);
}

.gd-part-head h2 {
  font-size: clamp(34px, 4.6vw, 50px);
  font-weight: 800;
  font-stretch: 82%;
  line-height: 1;
  letter-spacing: -0.01em;
}

.gd-part-head p {
  max-width: 64ch;
  margin-top: 14px;
  color: var(--haze);
  font-size: 18px;
  line-height: 1.6;
}

.gd-steps {
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: stop;
}

.gd-step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 0 0 64px 78px;
  counter-increment: stop;
}

.gd-step:last-child {
  padding-bottom: 0;
}

/* The stop, numbered. */
.gd-step::before {
  content: counter(stop);
  position: absolute;
  z-index: 1;
  top: -6px;
  left: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 5px solid var(--gd-line);
  border-radius: 50%;
  background: var(--night);
  color: var(--moon);
  font: 800 19px/1 var(--display);
}

/* The line on to the next stop. */
.gd-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 20px;
  bottom: -20px;
  left: 20px;
  width: 6px;
  border-radius: 3px;
  background: var(--gd-line);
  opacity: 0.55;
}

.gd-text h3 {
  padding-top: 3px;
  font-size: 27px;
  font-weight: 750;
  font-stretch: 86%;
  line-height: 1.1;
}

.gd-text p {
  max-width: 62ch;
  margin-top: 12px;
  line-height: 1.65;
}

.gd-text b,
.gd-help b {
  font-weight: 700;
}

.gd-text .gd-note {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(246, 241, 255, 0.04);
  color: var(--haze);
  font-size: 16px;
}

.gd-note b {
  color: var(--moon);
}

.gd-text .gd-do {
  margin-top: 20px;
}

/* ---- pictures */

.gd-pic {
  margin: 0;
  min-width: 0;
}

/* Over the line, where a picture runs across it on a phone. */
.gd-step > .gd-pic,
.gd-step > .gd-pair {
  position: relative;
  z-index: 2;
}

.gd-pic a {
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: 16px;
}

.gd-pic img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--ink);
  box-shadow: 0 18px 50px rgba(5, 2, 20, 0.45);
}

.gd-pic figcaption {
  margin-top: 10px;
  color: var(--dim);
  font-size: 14.5px;
}

.gd-pic + .gd-pic {
  margin-top: 4px;
}

.gd-text .gd-inline {
  margin: 16px 0 6px;
}

.gd-text .gd-inline img {
  border-radius: 12px;
  box-shadow: none;
}

.gd-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Tall pictures sit beside their words on wide screens, which stay in view while the picture scrolls by. */
@media (min-width: 980px) {
  .gd-side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    column-gap: 48px;
    align-items: start;
  }

  .gd-side.gd-narrow {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.75fr);
  }

  .gd-side .gd-text {
    position: sticky;
    top: calc(var(--nav-h) + 28px);
  }
}

/* ---- if it isn't working */

.gd-help {
  margin-top: 104px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
}

.gd-help h2 {
  font-size: clamp(32px, 4.2vw, 44px);
  font-weight: 800;
  font-stretch: 82%;
  line-height: 1;
}

.gd-help dl {
  margin: 30px 0 0;
}

.gd-help dl > div {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
  gap: 32px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.gd-help dt {
  font: 700 18px/1.35 var(--text);
}

.gd-where {
  display: block;
  margin-bottom: 6px;
  color: var(--dim);
  font: 600 14px/1.3 var(--text);
}

.gd-where kbd {
  min-width: 26px;
  height: 21px;
  font-size: 12.5px;
}

.gd-help dd {
  margin: 0;
  color: var(--haze);
  line-height: 1.65;
}

.gd-help dd .gd-pic {
  margin-top: 16px;
}

.gd-still {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--haze);
}

/* ---- narrow screens: the line map runs down the page, pictures use the full width */

@media (max-width: 760px) {
  .gd-route {
    padding: 18px 18px 16px;
  }

  .gd-line,
  .gd-need {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .gd-need {
    padding: 0 4px;
  }

  .gd-stations {
    grid-template-columns: minmax(0, 1fr);
  }

  .gd-stations li:not(:last-child)::before {
    top: 50%;
    left: 9px;
    width: 4px;
    height: 100%;
  }

  .gd-stations a {
    flex-direction: row;
    gap: 14px;
    min-height: 34px;
    padding: 5px 0;
    text-align: left;
    font-size: 15px;
  }

  .gd-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .gd-help dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .gd-page {
    padding-top: 32px;
  }

  .gd-lead {
    font-size: 17.5px;
  }

  .gd-step {
    padding: 0 0 48px 54px;
  }

  .gd-step::before {
    top: -4px;
    width: 36px;
    height: 36px;
    border-width: 4px;
    font-size: 16px;
  }

  .gd-step:not(:last-child)::after {
    top: 16px;
    left: 16px;
    width: 4px;
  }

  .gd-text h3 {
    font-size: 23px;
  }

  .gd-step > .gd-pic,
  .gd-step > .gd-pair {
    margin-left: -54px;
  }
}
