/* Sites page composition
   ------------------------------------------------------------------
   Opening: the diagonal panel (h1 + lede against the river pool).
   Then the payback statement set large on paper beside the two
   paragraphs about agreements and metering, and one gallery per site:
   Trebartha on a white band (one large photo with two stacked beside
   it, then a short and a wide photo), De Lank on paper (three upright
   photos, a pair, then the moorland panorama). */

/* Opening panel: crop on the pool and the far bank */
.sites-intro__img {
  object-position: 50% 58%;
}

/* ------------------------------------------------------------------
   Statement and paragraphs
   ------------------------------------------------------------------ */

.sites-why__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.sites-why__text {
  color: var(--color-text);
}

@media (min-width: 56rem) {
  .sites-why__inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    align-items: center;
  }

  .sites-why__statement {
    grid-column: 1 / 8;
  }

  .sites-why__text {
    grid-column: 8 / -1;
    padding-block: var(--space-2);
    padding-left: clamp(1.5rem, 3vw, 3rem);
    border-left: var(--border-hair) solid var(--color-rule);
  }
}

/* Keep the long opening caption from leaving one word on its own line */
.sites-intro .panel__caption {
  text-wrap: balance;
}

/* ------------------------------------------------------------------
   Site galleries
   ------------------------------------------------------------------ */

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

/* Shared: captioned photos in a grid, two across on small screens */
.sites-trebartha,
.sites-delank {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-4);
}

.sites-trebartha img,
.sites-delank img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

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

.sites-trebartha__oaks {
  grid-column: 1 / -1;
}

.sites-trebartha__oaks img {
  object-position: 50% 70%;
}

.sites-trebartha__spate img {
  object-position: 60% 50%;
}

.sites-trebartha__hall img {
  object-position: 65% 50%;
}

.sites-trebartha__weir img {
  object-position: 55% 50%;
}

@media (min-width: 36rem) {
  .sites-trebartha,
  .sites-delank {
    gap: var(--space-6) var(--grid-gap);
  }
}

/* Wide screens: the intake under the oaks fills the height of the two
   photos stacked beside it; the weir fills the height of the hall. */
@media (min-width: 56rem) {
  .sites-trebartha {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .sites-trebartha__oaks {
    grid-column: 1 / 9;
    grid-row: 1 / 3;
  }

  .sites-trebartha__spate {
    grid-column: 9 / -1;
    grid-row: 1;
  }

  .sites-trebartha__gorse {
    grid-column: 9 / -1;
    grid-row: 2;
  }

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

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

  .sites-trebartha__spate img,
  .sites-trebartha__gorse img {
    aspect-ratio: 3 / 2;
  }

  .sites-trebartha__oaks,
  .sites-trebartha__weir {
    display: flex;
    flex-direction: column;
  }

  .sites-trebartha__frame {
    position: relative;
    flex: 1 1 auto;
    min-height: 12rem;
  }

  .sites-trebartha__frame img {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
  }
}

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

/* Small screens: pairs of equal crops */
.sites-delank__weir img,
.sites-delank__bridge img {
  aspect-ratio: 3 / 4;
}

.sites-delank__screen img,
.sites-delank__hall img {
  aspect-ratio: 1;
}

.sites-delank__weir img {
  object-position: 50% 40%;
}

.sites-delank__hall img {
  object-position: 40% 60%;
}

.sites-delank__moor img {
  object-position: 50% 62%;
}

/* From 48rem: three upright photos of the intake, the hall and the
   leat as a pair, then the moorland as a panorama. */
@media (min-width: 48rem) {
  .sites-delank {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .sites-delank__weir,
  .sites-delank__bridge,
  .sites-delank__screen {
    grid-column: span 2;
  }

  .sites-delank__hall,
  .sites-delank__leat {
    grid-column: span 3;
  }

  .sites-delank__moor {
    grid-column: 1 / -1;
  }

  .sites-delank__weir img,
  .sites-delank__bridge img,
  .sites-delank__screen img {
    aspect-ratio: 4 / 5;
  }

  .sites-delank__hall img,
  .sites-delank__leat img {
    aspect-ratio: 4 / 3;
  }

  .sites-delank__moor img {
    aspect-ratio: 3 / 1;
    object-position: 50% 72%;
  }
}
