/* River Power V3: Technical page.
   The page head, then six reaches. The river rises under the right edge of
   the lede and runs straight down between the facts and the De Lank turbine
   hall (the first reach has no bend), swings out past the statement, then
   carries the 2025 generator
   replacement in date order: each entry sits on alternate banks, its date and
   title set beside the photograph as a map label (no dots, numbers or spine:
   the river is the sequence). Spring and summer take one reach, October the
   next. It ends past the construction photographs and the closing questions.
   Lane positions (--x1 to --x6) are set once on the walk. */

.walk {
  /* Lane centres of reaches 1 to 6. Reach 1 sits under the lede's right edge. */
  --x1: 44%;
  --x2: 62%;
  --x3: 46%;
  --x4: 57%;
  --x5: 30%;
  --x6: 60%;
}

/* Map labels on this page wrap evenly (no single word left on a line) */
.walk .label {
  text-wrap: balance;
}

/* ---------- The reaches ---------- */

/* No bend: the river rises in its lane and the banks open a little lower */
.tech-reach--hall {
  --at: var(--x1);
  --river-w: var(--river-1);
  padding-top: var(--space-2xl);
}

.tech-reach--statement {
  --from: var(--x1);
  --at: var(--x2);
  --dir: 1;
  --bend: 7rem;
  --river-w: var(--river-2);
}

.tech-reach--spring {
  --from: var(--x2);
  --at: var(--x3);
  --dir: -1;
  --bend: 8.5rem;
  --river-w: var(--river-2);
}

.tech-reach--autumn {
  --from: var(--x3);
  --at: var(--x4);
  --dir: 1;
  --bend: 7.5rem;
  --river-w: var(--river-3);
}

.tech-reach--build {
  --from: var(--x4);
  --at: var(--x5);
  --dir: -1;
  --bend: 9.5rem;
  --river-w: var(--river-4);
}

.tech-reach--next {
  --from: var(--x5);
  --at: var(--x6);
  --dir: 1;
  --bend: 7rem;
  --river-w: var(--river-5);
}

/* ---------- Reach 1: the facts and the pipework on the left; the hall on the right ---------- */

.tech-facts {
  display: grid;
  align-content: start;
  gap: var(--space-2xl);
  padding-top: var(--space-2xs);
}

.tech-place--pipework {
  --photo-max: 16rem;
}

.tech-place--wide {
  max-width: 40rem;
}

/* ---------- Reach 2: the statement, beside the Trebartha turbine hall ---------- */

.tech-statement {
  align-self: center;
}

.tech-statement__text {
  max-width: 13em;
  font-size: var(--text-h2-large);
  font-weight: var(--weight-medium);
  line-height: var(--leading-heading);
  text-wrap: balance;
}

.tech-place--trebartha-hall {
  max-width: 26rem;
}

/* ---------- The generator replacement ---------- */

.tech-works__head {
  max-width: var(--measure);
}

.tech-works__head > * + * {
  margin-top: var(--space-s);
}

/* Entries step down the river in date order, two to a row: in each row the
   right-bank entry sits high and the left-bank entry lower, so the eye
   zigzags downstream. In the spring reach the heading takes the first
   right-bank place: the list shares the reach's rows (subgrid), so the
   kiosk sits beside the heading and the next two entries share row 2. */
.tech-reach--spring .tech-dated {
  grid-row: 1 / span 2;
  grid-template-rows: subgrid;
}

.tech-dated > .tech-entry--kiosk {
  --photo-max: 21rem;
  grid-row: 1;
  margin-top: var(--space-2xl);
}

.tech-dated > .tech-entry--stands {
  --photo-max: 22rem;
  grid-row: 2;
}

.tech-dated > .tech-entry--pelton {
  --photo-max: 16rem;
  grid-row: 2;
  margin-top: var(--space-3xl);
}

.tech-dated > .tech-entry--crane {
  --photo-max: 20rem;
  grid-row: 1;
}

.tech-dated > .tech-entry--workshop {
  --photo-max: 26rem;
  grid-row: 1;
  margin-top: var(--space-3xl);
}

.tech-dated > .tech-entry--pallet {
  --photo-max: 15rem;
  grid-row: 2;
}

.tech-dated > .tech-entry--installed {
  --photo-max: 18rem;
  grid-row: 2;
  margin-top: var(--space-3xl);
}

/* ---------- Construction ---------- */

.tech-build {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
  gap: var(--space-xl) var(--space-m);
}

.tech-place--install {
  --photo-max: 30rem;
  grid-column: 1 / -1;
}

.tech-place--channel {
  margin-top: var(--space-2xl);
}

/* ---------- Last reach: questions about your site ---------- */

.tech-next {
  max-width: var(--measure-lede);
  padding-top: var(--space-s);
}

.tech-next > * + * {
  margin-top: var(--space-m);
}

.tech-next__title {
  max-width: 9em;
  font-size: var(--text-h2-large);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}

.tech-next p {
  max-width: var(--measure);
  text-wrap: pretty;
}

.tech-next__actions {
  column-gap: var(--space-l);
}

/* ---------- Tablet: tamer meander, labels above or below the photos ---------- */

@media (max-width: 68.6875rem) {
  .walk {
    --x1: 46%;
    --x2: 62%;
    --x3: 48%;
    --x4: 56%;
    --x5: 34%;
    --x6: 62%;
  }

  .tech-facts {
    gap: var(--space-xl);
  }

  /* Every place on this page stacks: the dated labels head their photos,
     the captions sit below */
  .tech-place--pipework,
  .tech-place--install,
  .tech-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .tech-place--pipework > *,
  .tech-place--install > *,
  .tech-place--install > .label,
  .tech-entry > *,
  .tech-entry.place--label-end > .label {
    grid-column: 1;
    grid-row: auto;
  }

  .tech-place--pipework {
    max-width: 15rem;
    margin-left: auto;
  }

  .tech-entry {
    width: 100%;
    max-width: 22rem;
  }

  .tech-entry.bank--left {
    justify-self: end;
  }

  .tech-entry--pelton,
  .tech-entry--pallet,
  .tech-entry--installed {
    max-width: 16rem;
  }

  .tech-dated > .tech-entry--kiosk,
  .tech-dated > .tech-entry--pelton,
  .tech-dated > .tech-entry--workshop,
  .tech-dated > .tech-entry--installed {
    margin-top: var(--space-2xl);
  }

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

  .tech-place--channel {
    max-width: 18rem;
    margin-top: 0;
  }
}

/* ---------- Phone: the river runs down the left edge ---------- */

@media (max-width: 44.9375rem) {
  .tech-reach--hall {
    padding-top: var(--space-l);
  }

  .tech-facts {
    gap: var(--space-l);
    padding-top: 0;
  }

  .tech-reach--hall .bank--right {
    margin-top: var(--space-l);
  }

  .tech-place--pipework {
    width: 64%;
    max-width: none;
    margin-left: 0;
  }

  .tech-reach--statement .bank--right {
    margin-top: var(--space-l);
  }

  .tech-place--trebartha-hall {
    width: 86%;
    margin-left: auto;
  }

  /* One entry after another, in date order, below the heading */
  .tech-reach--spring .tech-dated {
    grid-row: 2;
    grid-template-rows: none;
    margin-top: var(--space-l);
  }

  .tech-dated > .tech-entry {
    grid-row: auto;
    margin-top: 0;
  }

  .tech-entry,
  .tech-entry--pelton,
  .tech-entry--pallet,
  .tech-entry--installed {
    max-width: none;
  }

  .tech-entry.bank--left {
    justify-self: stretch;
  }

  .tech-entry--kiosk,
  .tech-entry--crane,
  .tech-entry--workshop {
    width: 90%;
  }

  .tech-entry--stands {
    width: 84%;
    margin-left: auto;
  }

  .tech-entry--pelton,
  .tech-entry--installed {
    width: 70%;
  }

  .tech-entry--pallet {
    width: 66%;
    margin-left: auto;
  }

  .tech-reach--build .tech-build {
    margin-top: var(--space-m);
    gap: var(--space-l);
  }

  .tech-place--intake {
    width: 86%;
    margin-left: auto;
  }

  .tech-place--channel {
    width: 70%;
    max-width: none;
  }

  .tech-next {
    padding-top: 0;
  }
}
