/* Sites page composition.
   The river pool above the Trebartha intake opens the page. The
   introduction is set large on the paper, with the two short paragraphs
   beside it. Trebartha and De Lank follow as two differently arranged
   groups of photographs: Trebartha led by a wide picture running off the
   right edge, De Lank by a tall one on the left. The statement closes the
   argument on the blueprint sheet, with the moorland print dropped across
   its torn lower edge, before the closing question. */

/* ------------------------------------------------------------------
   Photo band: the river pool. Crop keeps the trees and water, and puts
   the pale gap in the canopy left of the navigation.
   ------------------------------------------------------------------ */

.sites-band {
  --focus: 50% 46%;
}

@media (max-width: 47.99rem) {
  .sites-band {
    --focus: 38% 50%;
  }
}

/* ------------------------------------------------------------------
   Introduction: the lede at statement size, the paragraphs beside it
   ------------------------------------------------------------------ */

.sites-intro {
  padding-block: var(--section-m) var(--section-s);
  overflow: clip;
}

.sites-intro__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: var(--space-6);
}

.sites-intro__lede,
.sites-intro__prose {
  grid-column: 1 / -1;
}

.sites-intro__lede {
  max-width: 21em;
  font-size: var(--text-statement);
  line-height: 1.28;
  letter-spacing: -0.005em;
}

@media (min-width: 48rem) {
  .sites-intro__lede {
    grid-column: 1 / span 10;
  }

  .sites-intro__prose {
    grid-column: 5 / -1;
  }
}

@media (min-width: 64rem) {
  .sites-intro__lede {
    grid-column: 1 / span 7;
  }

  .sites-intro__prose {
    grid-column: 9 / -1;
    padding-top: var(--space-8);
  }
}

/* ------------------------------------------------------------------
   The two sites: shared grid, each arranged in its own way
   ------------------------------------------------------------------ */

.sites-trebartha__grid,
.sites-delank__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: var(--space-7);
}

.sites-trebartha__grid > *,
.sites-delank__grid > * {
  grid-column: 1 / -1;
}

.sites-site__title {
  font-size: var(--text-h1);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
}

/* On a tablet the name has only four columns beside the wide picture */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .sites-site__title {
    font-size: var(--text-h2);
  }
}

/* Trebartha -------------------------------------------------------- */

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

/* On a phone the intake runs edge to edge; the caption stays in the gutter */
.sites-trebartha__lead {
  margin-inline: calc(-1 * var(--page-gutter));
}

.sites-trebartha__lead figcaption {
  padding-inline: var(--page-gutter);
}

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

.sites-trebartha__gorse {
  grid-column: 1 / span 10;
}

.sites-trebartha__hall {
  grid-column: 3 / -1;
}

@media (min-width: 48rem) {
  .sites-trebartha__grid {
    row-gap: var(--space-8);
  }

  .sites-trebartha__title {
    grid-column: 1 / span 4;
    grid-row: 1;
    align-self: start;
  }

  /* Wide picture: from column 5 off the right edge of the page */
  .sites-trebartha__lead {
    grid-column: 5 / -1;
    grid-row: 1 / span 2;
    margin-left: 0;
    margin-right: calc(-1 * ((100vw - min(100vw, var(--page-max) + 2 * var(--page-gutter))) / 2 + var(--page-gutter)));
  }

  .sites-trebartha__lead figcaption {
    padding-inline: 0;
  }

  .sites-trebartha__lead img {
    aspect-ratio: 3 / 2;
  }

  .sites-trebartha__gorse {
    grid-column: 1 / span 4;
    grid-row: 2;
    align-self: end;
  }

  /* The river in spate beside a column of two smaller pictures */
  .sites-trebartha__spate {
    grid-column: 1 / span 7;
    grid-row: 3 / span 2;
    align-self: start;
  }

  .sites-trebartha__hall {
    grid-column: 9 / -1;
    grid-row: 3;
    margin-top: var(--space-6);
  }

  .sites-trebartha__weir {
    grid-column: 9 / -1;
    grid-row: 4;
    margin-top: calc(var(--space-6) - var(--space-8));
  }
}

/* De Lank ---------------------------------------------------------- */

.sites-delank {
  padding-block: var(--section-s) calc(var(--section-m) + var(--space-4));
}

.sites-delank__weir {
  grid-column: 1 / span 10;
}

.sites-delank__bridge {
  grid-column: 1 / span 6;
}

.sites-delank__screen {
  grid-column: 7 / -1;
  margin-top: var(--space-8);
}

.sites-delank__leat {
  grid-column: 3 / -1;
}

@media (max-width: 47.99rem) {
  /* the two small portraits sit side by side on a phone */
  .sites-delank__bridge,
  .sites-delank__screen {
    grid-row: 3;
  }

  .sites-delank__leat {
    grid-row: 4;
  }
}

@media (min-width: 48rem) {
  .sites-delank__grid {
    row-gap: var(--space-8);
  }

  .sites-delank__weir {
    grid-column: 1 / span 5;
    grid-row: 1 / span 2;
  }

  .sites-delank__title {
    grid-column: 7 / -1;
    grid-row: 1;
    align-self: start;
    padding-top: var(--space-5);
  }

  .sites-delank__bridge {
    grid-column: 7 / span 3;
    grid-row: 2;
    align-self: end;
  }

  .sites-delank__screen {
    grid-column: 10 / span 3;
    grid-row: 2;
    align-self: end;
    margin-top: 0;
    margin-bottom: var(--space-8);
  }

  .sites-delank__leat {
    grid-column: 1 / span 5;
    grid-row: 3;
    margin-top: var(--space-9);
  }

  .sites-delank__hall {
    grid-column: 6 / -1;
    grid-row: 3;
  }
}

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

/* ------------------------------------------------------------------
   The statement on the blueprint sheet. The moorland print hangs over
   the sheet's torn lower edge into the closing section, so its caption
   always lies on the paper below.
   ------------------------------------------------------------------ */

.sites-statement {
  --sites-hang: calc(var(--tear-height) + var(--space-10));
  padding-block: calc(var(--tear-height) + var(--space-8)) calc(var(--tear-height) + var(--space-7));
}

.sites-statement__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: var(--space-7);
  align-items: center;
}

.sites-statement__text,
.sites-statement__photo {
  grid-column: 1 / -1;
}

.sites-statement__photo {
  --tilt: 2deg;
  grid-column: 3 / -1;
  margin-bottom: calc(-1 * var(--sites-hang));
}

/* The caption falls on the cream paper below the sheet */
.on-dark .sites-statement__photo figcaption {
  color: var(--ink-600);
}

@media (min-width: 48rem) {
  .sites-statement__text {
    grid-column: 1 / span 7;
    padding-block: var(--space-6);
  }

  .sites-statement__photo {
    grid-column: 8 / -1;
    align-self: end;
  }
}

@media (min-width: 64rem) {
  .sites-statement__text {
    grid-column: 1 / span 7;
  }

  .sites-statement__photo {
    grid-column: 8 / -1;
    margin-right: calc(-1 * var(--space-4));
  }
}

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

.sites-close {
  padding-block: calc(var(--space-9) + var(--space-7)) var(--section-l);
}

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

.sites-close__title {
  max-width: 12em;
}

@media (min-width: 48rem) {
  .sites-close {
    padding-top: var(--section-m);
  }

  .sites-close__title {
    max-width: min(12em, 56%);
  }
}
