/* Technical page composition
   ------------------------------------------------------------------
   Opening: the diagonal panel (h1 + lede against the De Lank hall).
   Then the two efficiency paragraphs beside the tall pipework photo,
   the carbon statement in the mirrored panel with the Trebartha hall,
   the 2025 generator replacement as dated cards laid out in rows of
   equal height (read left to right, top to bottom), and the 2017
   construction photos as one strip on a white band. */

/* Opening panel: keep the arched pipes in view */
.tech-intro__img {
  object-position: 62% 50%;
}

/* ------------------------------------------------------------------
   Efficiency paragraphs and the pipework photo
   ------------------------------------------------------------------ */

.tech-facts__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
}

.tech-facts__text {
  font-size: var(--text-lede);
  line-height: 1.5;
}

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

.tech-facts__photo img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
}

@media (min-width: 36rem) and (max-width: 55.99rem) {
  .tech-facts__photo {
    width: 70%;
    margin-left: auto;
  }
}

/* Wide screens: the paragraphs carry straight on from the lede above,
   with the photo standing to the right and running lower. */
@media (min-width: 56rem) {
  .tech-facts {
    padding-top: var(--section-s);
  }

  .tech-facts__inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    align-items: start;
  }

  .tech-facts__text {
    grid-column: 1 / 7;
    padding-top: var(--space-7);
  }

  .tech-facts__photo {
    grid-column: 8 / 12;
  }
}

/* ------------------------------------------------------------------
   The statement in the mirrored panel
   ------------------------------------------------------------------ */

.tech-statement__img {
  object-position: 66% 50%;
}

@media (min-width: 56rem) {
  .tech-statement {
    --split: 0.46;
    min-height: clamp(24rem, 30vw, 30rem);
  }
}

/* ------------------------------------------------------------------
   Generator replacement, 2025: dated cards
   The text comes first in the source (date, then title, then photo)
   and the photo is drawn at the top of each card.
   ------------------------------------------------------------------ */

.tech-log__photo {
  order: -1;
}

.tech-log__photo img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Phones: the upright photos are cropped square so the list stays short */
.tech-log__item--pelton .tech-log__photo img,
.tech-log__item--pallet .tech-log__photo img,
.tech-log__item--installed .tech-log__photo img {
  aspect-ratio: 1;
}

.tech-log__item--pelton .tech-log__photo img {
  object-position: 50% 62%;
}

.tech-log__item--pallet .tech-log__photo img {
  object-position: 50% 78%;
}

.tech-log__item--installed .tech-log__photo img {
  object-position: 50% 30%;
}

/* Two across: the first card runs the full width, then pairs with
   matching crops so each row lines up. */
@media (min-width: 36rem) and (max-width: 63.99rem) {
  .tech-log {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-log__item--kiosk {
    grid-column: 1 / -1;
  }

  .tech-log__item--kiosk .tech-log__photo img {
    aspect-ratio: 16 / 9;
    object-position: 50% 60%;
  }

  .tech-log__item--stands .tech-log__photo img,
  .tech-log__item--pelton .tech-log__photo img {
    aspect-ratio: 1;
  }

  .tech-log__item--pallet .tech-log__photo img,
  .tech-log__item--installed .tech-log__photo img {
    aspect-ratio: 3 / 4;
  }
}

/* Wide screens: two rows of equal-height photos, widths set by each
   photo's shape. The row height follows the list's own width. */
@media (min-width: 64rem) {
  .tech-log {
    container-type: inline-size;
    grid-template-columns: repeat(24, minmax(0, 1fr));
  }

  .tech-log__item--kiosk,
  .tech-log__item--stands {
    grid-column: span 9;
  }

  .tech-log__item--pelton {
    grid-column: span 6;
  }

  .tech-log__item--crane,
  .tech-log__item--workshop {
    grid-column: span 7;
  }

  .tech-log__item--pallet,
  .tech-log__item--installed {
    grid-column: span 5;
  }

  .tech-log .tech-log__photo img {
    aspect-ratio: auto;
    height: clamp(15rem, 23vw, 21rem);
    height: 27cqi;
  }

  .tech-log__item--crane .tech-log__photo img,
  .tech-log__item--workshop .tech-log__photo img,
  .tech-log__item--pallet .tech-log__photo img,
  .tech-log__item--installed .tech-log__photo img {
    height: clamp(12rem, 18vw, 17rem);
    height: 21.5cqi;
  }

  /* A little less side padding so the narrow cards keep their titles
     to two lines on smaller laptops */
  .tech-log .entry__text {
    padding-inline: clamp(1rem, 1.6vw, 1.5rem);
  }
}

/* ------------------------------------------------------------------
   Trebartha under construction: one strip of three photos
   ------------------------------------------------------------------ */

.tech-build__title {
  margin-bottom: var(--space-6);
}

.tech-build__strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5) var(--grid-gap);
}

.tech-build__photo img {
  aspect-ratio: 1600 / 897;
  object-fit: cover;
}

.tech-build__photo--turbine img {
  aspect-ratio: 4 / 3;
}

@media (min-width: 36rem) {
  .tech-build__strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-6);
  }

  .tech-build__photo--turbine {
    grid-column: 1 / -1;
  }

  .tech-build__photo--turbine img {
    aspect-ratio: 16 / 9;
    object-position: 50% 60%;
  }
}

/* Wide screens: equal heights, each photo as wide as its shape needs */
@media (min-width: 64rem) {
  .tech-build__strip {
    display: flex;
    align-items: flex-start;
    gap: var(--grid-gap);
  }

  .tech-build__photo {
    flex: 1.784 1 0;
    min-width: 0;
  }

  .tech-build__photo--turbine {
    flex-grow: 1.333;
  }

  .tech-build__photo--turbine img {
    aspect-ratio: 4 / 3;
  }
}

/* The closing strip is white like the band above it: a hairline
   keeps the two apart. */
.tech-next {
  border-top: var(--border-hair) solid var(--color-rule);
}

/* Two actions beside a heading and a sentence crowd the strip until
   the screen is wide: drop them under the text until then. */
@media (min-width: 48rem) and (max-width: 74.99rem) {
  .tech-next .cta-strip__actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}
