/* V2 Sites page
   ------------------------------------------------------------------
   Open white space and one huge word to start, the statement on a
   band of machine blue, then the two sites built as two different
   places:
   - Trebartha on white: two full-bleed strips, a tall one led by the
     wide intake shot, then a lower one of three landscapes.
   - De Lank on black: the tall weir portrait runs off the left edge
     against a tight set of four, then the moorland as a panorama.
   Text that is not a photo hangs on column 7 of the grid throughout. */

:root {
  --sites-title: clamp(8rem, 1rem + 21vw, 21rem);
  --sites-statement: clamp(2.375rem, 0.9rem + 5vw, 6rem);
  --sites-place: var(--text-h1);
}

/* ------------------------------------------------------------------
   Opening: "Sites" as a sign on the wall, the text set beside it
   ------------------------------------------------------------------ */

.sites-intro {
  padding-block: var(--section-m) var(--section-l);
}

.sites-intro__grid {
  row-gap: var(--space-6);
}

.sites-intro__title {
  margin-left: -0.02em; /* optical: sit the S on the grid edge */
  font-size: var(--sites-title);
  line-height: 0.8;
  text-box: trim-both cap alphabetic;
}

.sites-intro__body {
  max-width: var(--measure);
}

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

@media (min-width: 56rem) {
  .sites-intro__title {
    grid-column: 1 / span 6;
    grid-row: 1 / span 2;
  }

  .sites-intro__lede {
    grid-column: 7 / -1;
    grid-row: 1;
    text-box: trim-start cap alphabetic;
  }

  .sites-intro__body {
    grid-column: 7 / -1;
    grid-row: 2;
  }
}

@media (min-width: 72rem) {
  .sites-intro__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    max-width: none;
  }

  .sites-intro__body > * + * {
    margin-top: 0;
  }
}

/* ------------------------------------------------------------------
   Statement: the only thing on its band
   ------------------------------------------------------------------ */

.sites-statement {
  padding-block: var(--section-l);
}

.sites-statement__text {
  max-width: 28ch;
  font-size: var(--sites-statement);
  line-height: 0.98;
}

/* ------------------------------------------------------------------
   Site headings
   ------------------------------------------------------------------ */

.sites-place {
  font-size: var(--sites-place);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
  text-box: trim-both cap alphabetic;
}

/* ------------------------------------------------------------------
   Trebartha: two strips of different heights
   ------------------------------------------------------------------ */

.sites-trebartha {
  padding-block: var(--section-l) var(--section-m);
}

.sites-trebartha__title {
  margin-bottom: var(--space-7);
}

.sites-trebartha__strip + .sites-trebartha__strip {
  margin-top: var(--space-6);
}

.sites-trebartha figcaption,
.sites-delank figcaption {
  text-wrap: balance;
}

/* Crops. --ar is the strip proportion on wide screens. */
.sites-photo--oaks { --ar: 1.7; }
.sites-photo--pool { --ar: 0.75; }
.sites-photo--gorse { --ar: 0.75; }
.sites-photo--spill { --ar: 1.78; }
.sites-photo--spate { --ar: 1.333; }
.sites-photo--hall { --ar: 1.333; }

.sites-photo--oaks img { object-position: 50% 62%; }
.sites-photo--pool img { object-position: 30% 50%; }
.sites-photo--gorse img { object-position: 44% 50%; }
.sites-photo--spate img { object-position: 55% 50%; }
.sites-photo--hall img { object-position: 72% 50%; }

/* Phones: the first photo spans both columns, the pair below shares
   one proportion so the two plates line up. */
@media (max-width: 47.99rem) {
  .sites-photo--oaks { --ar: 1.333; }
  .sites-photo--spill { --ar: 1.6; }
  .sites-photo--spate,
  .sites-photo--hall { --ar: 0.9; }
}

/* ------------------------------------------------------------------
   De Lank: the weir against a set of four, then the moorland
   ------------------------------------------------------------------ */

.sites-delank {
  padding-block: var(--section-m);
}

.sites-delank__grid {
  display: grid;
  gap: var(--space-6) var(--grid-gap);
}

.sites-delank__weir {
  margin-inline: calc(-1 * var(--page-gutter));
}

.sites-delank__weir img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 60% 50%;
}

.sites-delank__set {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--seam);
  align-items: start;
}

.sites-delank__set img {
  aspect-ratio: 1;
  object-fit: cover;
}

.sites-photo--footbridge img { object-position: 50% 62%; }
.sites-photo--screen img { object-position: 50% 58%; }
.sites-photo--leat img { object-position: 30% 50%; }
.sites-photo--units img { object-position: 42% 50%; }

.sites-delank__moor {
  margin-top: var(--space-8);
}

.sites-delank__moor img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 76%;
}

@media (min-width: 48rem) {
  .sites-delank__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    row-gap: var(--space-7);
  }

  .sites-delank__title {
    grid-column: 7 / -1;
    grid-row: 1;
  }

  /* The weir runs from the window edge to column 5 and takes its
     height from the title and the set beside it. */
  .sites-delank__weir {
    display: flex;
    flex-direction: column;
    grid-column: 1 / span 6;
    grid-row: 1 / span 2;
    margin-inline: calc(-1 * var(--edge)) 0;
    contain: size;
  }

  .sites-delank__weir img {
    flex: 1 1 0;
    min-height: 0;
    aspect-ratio: auto;
  }

  .sites-delank__weir figcaption {
    align-self: flex-start;
  }

  .sites-delank__set {
    grid-column: 7 / -1;
    grid-row: 2;
    align-self: end;
  }

  .sites-delank__moor img {
    aspect-ratio: 3 / 1;
  }
}

/* Wide screens: an empty column between the weir and the set */
@media (min-width: 64rem) {
  .sites-delank__weir {
    grid-column: 1 / span 5;
  }
}

/* Very wide screens: the weir gains width from the margin, so the set
   grows taller to keep the weir a portrait. */
@media (min-width: 110rem) {
  .sites-delank__set img {
    aspect-ratio: 4 / 5;
  }
}

/* ------------------------------------------------------------------
   Closing
   ------------------------------------------------------------------ */

.sites-close {
  padding-block: var(--section-s);
}

.sites-close__body > * + * {
  margin-top: var(--space-6);
}

@media (min-width: 56rem) {
  .sites-close__body {
    grid-column: 7 / -1;
  }
}
