/* Final visual-review corrections for Story, Career and the pre-accident archive. */

@media (min-width: 70.001rem) {
  .page-slug-stevens-story .story-editorial__chapter > .eyebrow,
  .page-slug-career .career-record-card > .eyebrow {
    grid-column: 1;
    grid-row: 1;
  }

  .page-slug-stevens-story .story-editorial__chapter > h2,
  .page-slug-career .career-record-card > h2 {
    grid-column: 2;
    grid-row: 1;
  }

  .page-slug-stevens-story .story-editorial__chapter > p:not(.eyebrow),
  .page-slug-career .career-record-card > p:not(.eyebrow) {
    grid-column: 3;
  }
}

@media (min-width: 48.001rem) and (max-width: 70rem) {
  .page-slug-stevens-story .story-editorial__chapter > .eyebrow,
  .page-slug-career .career-record-card > .eyebrow {
    grid-column: 1;
  }

  .page-slug-stevens-story .story-editorial__chapter > h2,
  .page-slug-stevens-story .story-editorial__chapter > p:not(.eyebrow),
  .page-slug-career .career-record-card > h2,
  .page-slug-career .career-record-card > p:not(.eyebrow) {
    grid-column: 2;
  }
}

@media (max-width: 48rem) {
  .page-slug-stevens-story .story-editorial__chapter > .eyebrow,
  .page-slug-stevens-story .story-editorial__chapter > h2,
  .page-slug-stevens-story .story-editorial__chapter > p:not(.eyebrow),
  .page-slug-career .career-record-card > .eyebrow,
  .page-slug-career .career-record-card > h2,
  .page-slug-career .career-record-card > p:not(.eyebrow) {
    grid-column: 1;
  }
}

/*
 * Steven's Story: keep the introduction separate from the navigation cards.
 * The previous side-by-side composition allowed the display heading to collide
 * with the card column at common desktop widths.
 */
.page-slug-stevens-story .story-record-callout.record-callout {
  display: grid !important;
  grid-template-columns: minmax(16rem, .78fr) minmax(22rem, 1.22fr) !important;
  grid-template-rows: auto auto !important;
  gap: clamp(1.25rem, 2.5vw, 2.25rem) clamp(2.5rem, 6vw, 6rem) !important;
  align-items: end;
  overflow: hidden;
  padding: clamp(2.25rem, 5vw, 4.75rem) !important;
}

.page-slug-stevens-story .story-record-callout > h2 {
  grid-column: 1 !important;
  grid-row: 1 !important;
  max-width: 11ch !important;
  margin: 0 !important;
  font-size: clamp(2.5rem, 4.15vw, 4.25rem) !important;
  line-height: .98 !important;
  text-wrap: balance;
}

.page-slug-stevens-story .story-record-callout > p {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: end;
  max-width: 46rem !important;
  margin: 0 0 .35rem !important;
  padding: 0 !important;
  font-size: clamp(1rem, 1.25vw, 1.16rem) !important;
  line-height: 1.72 !important;
}

.page-slug-stevens-story .story-record-callout > .editorial-link-grid {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(1.25rem, 2.5vw, 2rem) !important;
  width: 100%;
  margin: .4rem 0 0 !important;
}

.page-slug-stevens-story .story-record-callout .editorial-link-group {
  min-height: 100%;
  padding: clamp(1.6rem, 3vw, 2.5rem) !important;
}

.page-slug-stevens-story .story-record-callout .editorial-link-group h3 {
  max-width: 16ch;
  margin-bottom: 1rem;
  font-size: clamp(.85rem, 1.1vw, 1rem);
  line-height: 1.25;
}

.page-slug-stevens-story .story-record-callout .editorial-link-list a {
  padding-block: .82rem;
  padding-right: 2rem;
}

/*
 * Pre-accident archive: use a calm, consistent museum-style grid instead of
 * an oversized masonry mosaic. Every photograph receives equal visual weight.
 */
.page-slug-pre-accident-photos .prose-entry {
  width: 100%;
  max-width: 78rem !important;
  margin-inline: auto;
}

.page-slug-pre-accident-photos .prose-entry > p:first-child {
  max-width: 60rem;
  margin-inline: auto;
  text-align: center;
}

.page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-rows: auto !important;
  gap: clamp(1rem, 2vw, 1.5rem) !important;
  width: 100% !important;
  max-width: 78rem !important;
  margin: 0 auto clamp(3rem, 7vw, 6rem) !important;
  padding: 0 !important;
  align-items: stretch;
}

.page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure,
.page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure:nth-child(n) {
  position: relative;
  overflow: hidden;
  grid-column: auto !important;
  grid-row: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  aspect-ratio: 4 / 3 !important;
  margin: 0 !important;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(16, 27, 43, .07);
}

.page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure > a,
.page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure img {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure img {
  object-fit: cover !important;
  object-position: center;
}

@media (max-width: 64rem) {
  .page-slug-stevens-story .story-record-callout.record-callout {
    grid-template-columns: 1fr !important;
    align-items: start;
  }

  .page-slug-stevens-story .story-record-callout > h2,
  .page-slug-stevens-story .story-record-callout > p,
  .page-slug-stevens-story .story-record-callout > .editorial-link-grid {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .page-slug-stevens-story .story-record-callout > h2 {
    max-width: 14ch !important;
  }

  .page-slug-stevens-story .story-record-callout > p {
    max-width: 44rem !important;
    margin-bottom: .5rem !important;
  }
}

@media (max-width: 52rem) {
  .page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 42rem) {
  .page-slug-stevens-story .story-record-callout.record-callout {
    padding: 1.4rem !important;
  }

  .page-slug-stevens-story .story-record-callout > .editorial-link-grid {
    grid-template-columns: 1fr !important;
  }

  .page-slug-stevens-story .story-record-callout .editorial-link-group {
    padding: 1.35rem !important;
  }

  .page-slug-pre-accident-photos .prose-entry > p:first-child {
    text-align: left;
  }

  .page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure,
  .page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure:nth-child(n) {
    aspect-ratio: 4 / 3 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-slug-pre-accident-photos .prose-entry :is(.migration-gallery, .sfr-lightbox-gallery, .wp-block-gallery.has-nested-images) > figure img {
    transition: none !important;
  }
}