/* ==========================================================================
   project-story — editorial text (lead + two paragraphs) and a small
   asymmetric gallery of three photos. Photos are cropped to their cell, so
   mixed source ratios never break the layout.
   Mobile: stacked. Desktop: text beside a 2-column gallery.
   ========================================================================== */
.project-story {
  padding-block: var(--space-xl) var(--space-2xl);
  border-top: var(--border-hairline);
}

.project-story__layout {
  display: grid;
  gap: var(--space-lg);
}

.project-story__page {
  font-variant-numeric: tabular-nums;
  text-transform: none; /* keep the lowercase "p." */
}

.project-story__lead {
  margin-top: var(--space-xs);
}

.project-story__text {
  display: grid;
  gap: var(--space-sm);
  max-width: 46ch;
}

.project-story__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm) var(--grid-gutter);
  margin-top: var(--space-xl);
  padding: 0;
}

.project-story__figure {
  min-width: 0;
  margin: 0;
}

.project-story__figure .image {
  --image-ratio: 4 / 5;
}

.project-story__figure:first-child {
  grid-column: 1 / -1;
}

.project-story__figure:first-child .image {
  --image-ratio: 3 / 2;
}

@media (min-width: 64em) {
  .project-story__layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 5fr);
    gap: var(--grid-gutter);
    align-items: start;
  }

  .project-story__gallery {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
  }

  .project-story__figure:first-child {
    grid-column: auto;
  }

  .project-story__figure:nth-child(2) {
    margin-top: var(--space-2xl);
  }

  .project-story__figure:nth-child(3) {
    grid-column: 1 / -1;
  }

  .project-story__figure:nth-child(3) .image {
    --image-ratio: 16 / 9;
  }
}
