/* V2 home page
   ------------------------------------------------------------------
   Rhythm from top to bottom:
   1. Hero: the one bold moment. A machine-blue block carrying the
      headline, butted against the De Lank turbine hall, where the
      pipework is painted the same blue. This is the page's only split.
   2. "Riverpower sites": open white space, big type, one photograph.
   3. Technical information and FAQ: a pair of data-sheet entries on
      the concrete floor.
   4. Trebartha and De Lank: a full-bleed strip of site photographs.
   5. A short black sign-off that runs into the black footer.

   The hero split (7:5) puts its seam at seven-twelfths of the window.
   Sections 2, 3 and 5 hang their second column on that same line, so
   the intake photo, the sheet text and the contact button all stand
   directly under the edge of the turbine-hall photograph, and every
   heading starts on the left edge of the headline. */

.home-page {
  /* Page-only sizes, built from the shared scale */
  --home-hero-type: clamp(4rem, 1rem + 16vw, 8rem);
  --home-lead-type: clamp(1.375rem, 1rem + 1vw, 1.875rem);
}

/* ------------------------------------------------------------------
   The 7:5 line
   ------------------------------------------------------------------ */

.home-cols {
  padding-inline: var(--page-gutter);
}

@media (min-width: 56rem) {
  .home-cols {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 0;
    padding-inline: 0;
  }

  /* Same insets as the hero block, so text lines up with the headline */
  .home-cols__main {
    grid-column: 1;
    padding-right: var(--space-7);
    padding-left: var(--edge);
  }

  .home-cols__side {
    grid-column: 2;
    padding-right: var(--edge);
  }
}

/* ------------------------------------------------------------------
   1. Hero
   ------------------------------------------------------------------ */

/* While the split is stacked the block is the full window width, so
   the headline runs larger than --text-display: on a phone it sets a
   word or two to a line, like lettering on a machine housing. Beside
   the photograph it uses --text-display. */

.home-hero__block {
  padding-block: var(--space-7);
}

/* A touch more leading than --leading-display, so the g of "energy"
   clears the dot of the i in "rivers" below it */
.home-hero__title {
  font-size: var(--home-hero-type);
  line-height: var(--leading-heading);
}

/* Stacked on a phone: a square crop that keeps two units and the big pipe */
.home-hero__media img {
  aspect-ratio: 1;
  object-position: 72% 50%;
}

@media (min-width: 40rem) and (max-width: 55.99rem) {
  .home-hero__media img {
    aspect-ratio: 3 / 2;
    object-position: 50% 55%;
  }
}

@media (min-width: 56rem) {
  .home-hero {
    min-height: clamp(32rem, 50vw, 46rem);
  }

  .home-hero__block {
    padding-block: var(--space-8);
  }

  .home-hero__title {
    font-size: var(--text-display);
  }

  .home-hero__media img {
    aspect-ratio: auto;
    object-position: 66% 50%;
  }
}

/* ------------------------------------------------------------------
   2. Riverpower sites: big type in open white space
   ------------------------------------------------------------------ */

.home-lead__title {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
}

.home-lead__text > * + * {
  margin-top: var(--space-5);
}

.home-lead__title + .home-lead__lede {
  margin-top: var(--space-6);
}

.home-lead__lede {
  max-width: 40rem;
  font-size: var(--home-lead-type);
  line-height: 1.4;
}

.home-lead__photo {
  margin-top: var(--space-7);
}

.home-lead__photo img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* On a phone the photograph runs to both edges of the window */
@media (max-width: 55.99rem) {
  .home-lead__photo {
    margin-inline: calc(var(--page-gutter) * -1);
  }
}

@media (min-width: 56rem) {
  .home-lead__photo {
    margin-top: 0;
  }
}

/* ------------------------------------------------------------------
   3. Technical information and FAQ: two parallel entries side by side,
      each opening on a heavy black rule like the schedules elsewhere.
      Heading, text and link stay together so no column is left empty.
   ------------------------------------------------------------------ */

.home-more__grid {
  display: grid;
  gap: var(--space-8) var(--grid-gap);
}

.home-more__item {
  padding-top: var(--space-5);
  border-top: var(--rule-heavy) solid var(--black);
}

.home-more__item > * + * {
  margin-top: var(--space-4);
}

.home-more__title {
  font-size: var(--text-h2);
}

.home-more__text {
  max-width: var(--measure);
  font-size: var(--text-lede);
  line-height: 1.45;
}

@media (min-width: 48rem) {
  .home-more__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-8);
  }
}

/* ------------------------------------------------------------------
   4. Trebartha and De Lank: a full-bleed strip
   ------------------------------------------------------------------ */

.home-strip {
  margin-top: var(--space-6);
  /* Rows need room for the label plates that hang under each photo */
  row-gap: var(--space-5);
}

.home-strip__weir { --ar: 1.5; }
.home-strip__spate { --ar: 0.75; }
.home-strip__runner { --ar: 0.75; }
.home-strip__bridge { --ar: 1.3333; }

.home-strip__weir img { object-position: 50% 45%; }
.home-strip__bridge img { object-position: 30% 50%; }

/* Phone: wide photo, a pair of portraits, wide photo */
@media (max-width: 47.99rem) {
  .home-strip .strip__item:last-child {
    grid-column: 1 / -1;
  }
}

/* Tablet: one row would be too low, so the strip folds into two rows,
   each with its own height so neither portrait is cropped */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .home-strip {
    flex-wrap: wrap;
  }

  .home-strip .strip__item {
    flex: 0 0 calc((100% - var(--seam)) * var(--ar) / var(--row));
  }

  .home-strip__weir,
  .home-strip__spate {
    --row: 2.25;
  }

  .home-strip__runner,
  .home-strip__bridge {
    --row: 2.0833;
  }
}

.home-sites__action {
  margin-top: var(--space-7);
}

/* ------------------------------------------------------------------
   5. Tell us about your site: black, running into the footer
   ------------------------------------------------------------------ */

.home-contact__inner {
  position: relative;
  display: grid;
  gap: var(--space-6);
  padding-block: var(--section-m);
}

/* The hairline that parts the sign-off from the footer, inset like the
   footer's own rule */
.home-contact__inner::after {
  content: "";
  position: absolute;
  right: var(--edge);
  bottom: 0;
  left: var(--edge);
  border-bottom: 1px solid var(--steel-700);
}

.home-contact__title {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
}

@media (min-width: 56rem) {
  .home-contact__action {
    align-self: end;
  }
}
