/* ==========================================================================
   TUOIL — stages
   Four cards in a row: a photograph ending on a point
   to the right, a heading, the text, and under a short hairline a one-line
   summary. The points all face the same way, so the row reads left to right
   as a sequence -- raw material, processing, testing, consistency.

   Each card is a subgrid of the row's four lines, so the headings, the texts
   and the summaries start level across the cards whatever their lengths. A
   card with no summary simply leaves its last line empty.
   ========================================================================== */

.s-stages {
  padding-block: 6rem;
  background: var(--c-cream);
}

.s-stages__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(24px, 2.6vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.s-stages__card {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
  align-content: start;
}

/* the point reaches a fifth of the picture's height, as on the pages' other
   photographs; at 3:2 that is 15% of the width */
.s-stages__media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%);
}

.s-stages__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s-stages__title {
  margin-top: var(--sp-4);
  font-size: 1.5rem;
  line-height: 1.2;
  text-wrap: balance;
}

.s-stages__text {
  margin-top: var(--sp-2);
  font-size: var(--fs-small);
  color: var(--c-ink);
}

.s-stages__text p { margin-bottom: var(--sp-2); }
.s-stages__text p:last-child { margin-bottom: 0; }

.s-stages__text strong { font-weight: var(--fw-semibold); }

/* A card with no summary: its text runs on into the summary's line, so the
   other cards' summaries line up under their own, shorter texts. */
.s-stages__text--long { grid-row: span 2; }

.s-stages__summary {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  position: relative;
}

.s-stages__summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 1px;
  background: var(--c-border-strong);
}

.s-stages__summary-title {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-heading);
}

.s-stages__summary-text {
  margin-top: var(--sp-1);
  font-size: var(--fs-small);
  color: var(--c-muted);
}

@media (max-width: 1200px) {
  .s-stages__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--sp-6);
  }
}

@media (max-width: 768px) {
  .s-stages { padding-block: var(--sp-6); }
}

@media (max-width: 600px) {
  .s-stages__list { grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-5); }
}
