/* Open chapters share one reading axis; images can move beyond it. */
.editorial-case {
  --editorial-media-width: calc(var(--page-max) - 2 * var(--gutter));
  --editorial-column-gap: 24px;
}
/* The opening and media share the exhibitions' page frame and gutters. */
.editorial-case > header,
.editorial-case .opening,
.editorial-case .fileline,
.editorial-case .case-cover {
  --paper: #fff; --ink: #111;
  background: #fff; color: #111;
}
.editorial-case > header { --progress-track: rgba(17,17,17,.18); }
.editorial-case .cover-stage { background: #fff; }
.editorial-case .intro-details .project-meta dl > div { border-bottom-color: #ddd; }
.editorial-case .cover-stage .fileline { background: transparent; text-shadow: none; }
.editorial-case .cover-stage .full-width-image::before { content: none; }
/* Invert the lettering over the photograph and the white reveal surround. */
.editorial-case .cover-lettering { color: #fff; mix-blend-mode: difference; }
.editorial-chapter { position: relative; margin: 0; padding: 0; scroll-margin-top: -24px; }
.editorial-chapter > details > summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 20px 70px;
  list-style: none;
  background: #fff;
  cursor: pointer;
}
.editorial-chapter > details > summary::-webkit-details-marker { display: none; }
.editorial-chapter > details > summary::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 100vw;
  transform: translateX(-50%); border-top: var(--primary-rule) solid var(--ink);
}
.editorial-chapter > details > summary:focus-visible { outline-offset: -5px; }
.editorial-chapter > details > summary h2 {
  font-family: Trim, Arial, sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: clamp(24px, 2.5vw, 36px); line-height: 1.1; letter-spacing: -.025em; text-align: center;
}
.chapter-content { padding: 48px var(--gutter) var(--case-chapter-end); }
.editorial-chapter .prose { width: 100%; max-width: var(--reading-measure); margin-inline: auto; }
.chapter-kicker { text-align: center; font-size: 12px; text-transform: uppercase; margin: 0 0 28px; }
.chapter-object .object-gallery { width: min(100%, var(--reading-measure)); margin: 48px auto 0; }
.chapter-object .object-images { aspect-ratio: 3/2; }
.chapter-object .object-controls { justify-content: center; }
.chapter-object .object-gallery figcaption { text-align: center; }
.immersive-case .chapter-content > .chapter-breakout { margin-top: 64px; margin-bottom: -88px; }
.chapter-material .material-details {
  width: 100%; max-width: var(--editorial-media-width); margin: 56px auto 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--editorial-column-gap); align-items: start;
}
.chapter-material .material-details > figure { min-width: 0; margin: 0; }
.chapter-material .material-details img { display: block; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; }
.chapter-material .material-details > figure:nth-of-type(2) { --case-row-stagger: 64px; margin-top: var(--case-row-stagger); }
.chapter-material .material-details > figure:nth-of-type(3) { --case-row-stagger: 128px; margin-top: var(--case-row-stagger); }
.chapter-material .material-details figcaption { display: block; padding: 12px 0 0; }
.chapter-film .chapter-content { padding: 0 0 var(--case-chapter-end); }
.editorial-case .film-lettering { font-size: clamp(52px, 6.6vw, 106px); line-height: 1.02; }
.editorial-film { --paper: #fff; --ink: #111; background: #fff; color: #111; }
.editorial-film .film-lettering { max-width: var(--editorial-media-width); margin-inline: auto; }
.editorial-film .case-film { max-width: var(--editorial-media-width); }
.editorial-film .case-film video,
.editorial-film .case-film:fullscreen { background: #fff; }
.editorial-film .case-film:fullscreen { max-width: none; }
.editorial-case .film-scene.film-crop-reveal { height: auto; margin-bottom: 64px; }
.editorial-case .film-crop-reveal .film-stage {
  position: relative; top: auto; height: auto; display: block;
  padding: 0 var(--gutter); overflow: visible;
}
.editorial-case .film-crop-reveal .case-film {
  --film-expanded-width: min(var(--editorial-media-width), calc(100vw - 2 * var(--gutter)), max(var(--reading-measure), calc((100svh - var(--header-height) - 120px) * 1468 / 1080)));
  width: var(--film-expanded-width);
  margin: 0 auto; transform: none;
}
.film-motion .editorial-case .film-crop-reveal .case-film {
  width: min(100%, calc(var(--reading-measure) + (var(--film-expanded-width) - var(--reading-measure)) * var(--film-progress)));
}
.film-motion .editorial-case .film-crop-reveal .case-film:focus-within,
.film-motion .editorial-case .film-crop-reveal .case-film.is-playing { width: var(--film-expanded-width); }
.editorial-case .film-crop-reveal .case-film:fullscreen,
.film-motion .editorial-case .film-crop-reveal .case-film:fullscreen { width: 100%; }
.chapter-film .factory-copy { padding: 64px var(--gutter) var(--case-content-gap); }
.chapter-film .factory-copy h3 { max-width: var(--reading-measure); margin: 0 auto 24px; font-size: 22px; }
.chapter-film .factory-images {
  width: calc(100% - 2 * var(--gutter)); max-width: var(--editorial-media-width);
  margin: auto; padding: 0; gap: var(--editorial-column-gap); align-items: start;
}
.chapter-film .factory-images > figure { transform: none; }
.chapter-film .factory-images > figure:nth-child(2) { --case-row-stagger: 64px; margin-top: var(--case-row-stagger); }
.chapter-film .factory-images > figure:nth-child(3) { --case-row-stagger: 128px; margin-top: var(--case-row-stagger); }
.chapter-visitor .visitor-track {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%; max-width: var(--editorial-media-width); padding: 0;
  gap: var(--editorial-column-gap); margin: auto;
}
.chapter-visitor .visitor-track > figure { width: auto; min-width: 0; }
.chapter-visitor .prose + .visitor-track { margin-top: 56px; }
.chapter-visitor .visitor-track > figure:nth-child(1) { --case-row-stagger: 128px; margin-top: var(--case-row-stagger); }
.chapter-visitor .visitor-track > figure:nth-child(2) { --case-row-stagger: 64px; margin-top: var(--case-row-stagger); }
.chapter-visitor .visitor-track > figure:nth-child(3) { margin-top: 0; }
.chapter-perspective .chapter-content { padding-block: 48px 96px; }
.chapter-credits .credit-groups { max-width: var(--reading-measure); margin: auto; }
.chapter-credits .credit-groups h3 { font-size: 20px; }
.chapter-credits .credit-groups dl > div { grid-template-columns: 1fr 1.4fr; }
.chapter-credits .credit-groups dd { font-size: var(--editorial-credit-size); }
@media (max-width: 700px) {
  .editorial-case { --editorial-column-gap: 12px; }
  .editorial-chapter > details > summary { min-height: 68px; padding: 20px 48px; }
  .chapter-content { padding-block: 28px 48px; }
  .immersive-case .chapter-content > .chapter-breakout { margin-top: 40px; margin-bottom: -48px; }
  .chapter-object .object-gallery { margin-top: 32px; }
  .chapter-material .material-details { margin-top: 36px; }
  .editorial-case .film-lettering { font-size: clamp(36px, 9.2vw, 60px); }
  .chapter-film .chapter-content { padding-bottom: 48px; }
  .editorial-case .film-scene.film-crop-reveal { margin-bottom: 40px; }
  .editorial-case .film-crop-reveal .case-film { width: 100%; }
  .chapter-film .factory-copy { padding-block: var(--case-content-gap); }
  .chapter-material .material-details,
  .chapter-film .factory-images,
  .chapter-visitor .visitor-track { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .chapter-material .material-details > figure:nth-child(n),
  .chapter-film .factory-images > figure:nth-child(n),
  .chapter-visitor .visitor-track > figure:nth-child(n) { grid-column: auto; margin-top: 0; }
  .chapter-visitor .prose + .visitor-track { margin-top: 36px; }
  .chapter-perspective .chapter-content { padding-block: 28px 56px; }
}
@media screen and (min-width: 701px) and (min-height: 600px) and (prefers-reduced-motion: no-preference) {
  .editorial-case.film-motion .film-lettering {
    left: max(var(--gutter), calc((100% - var(--editorial-media-width)) / 2));
  }
}
@media screen and (min-width: 701px) and (prefers-reduced-motion: no-preference) {
  .editorial-case.case-rows-motion .editorial-chapter .exhibition-scroll-image {
    margin-top: 0;
    transform: translate3d(0, var(--exhibition-scroll-offset, 0px), 0);
  }
}
@media print {
  .chapter-content { display: block !important; }
}

/* Reusable chapters keep the case-file reading measure and deliberate photo frames. */
.case-photo-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px;
  width: calc(100% - 2 * var(--gutter)); max-width: 1120px; margin: var(--case-content-gap) auto 0;
}
.case-photo-grid.case-photo-single { max-width: var(--reading-measure); grid-template-columns: minmax(0, 1fr); }
.case-photo-grid figure { margin: 0; min-width: 0; }
.case-photo-frame { background: #f5f5f5; overflow: hidden; }
.case-photo-frame.frame-portrait { aspect-ratio: 4/5; }
.case-photo-frame.frame-landscape { aspect-ratio: 3/2; }
.case-photo-frame.frame-square { aspect-ratio: 1; }
.case-photo-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.case-photo-frame.fit-cover img { object-fit: cover; }
.case-photo-grid figcaption { padding: 12px 0 0; }
.chapter-flexible:not(.chapter-film) .case-photo-grid { width: 100%; }
.editorial-case {
  --case-content-gap: 48px;
  --case-chapter-end: 88px;
  --chapter-film-width: min(var(--editorial-media-width), calc(100vw - 2 * var(--gutter)), max(var(--reading-measure), calc((100svh - var(--header-height) - 120px) * 16 / 9)));
}
.editorial-case .film-crop-reveal .reusable-case-film { --film-expanded-width: var(--chapter-film-width); }
/* Pairs align with the fully expanded film without following its scroll animation. */
.chapter-flexible .case-photo-grid:not(.case-photo-single):not(.case-photo-trio) { max-width: var(--chapter-film-width); }
.reusable-case-film video { width: 100%; height: auto; object-fit: contain; }
@media (max-width: 700px) {
  .case-photo-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: var(--case-content-gap); }
  .chapter-flexible .case-photo-grid:not(.case-photo-single):not(.case-photo-trio) { max-width: none; }
}
/* Photo trios share the wider case-file media frame used by Supra Strata. */
.case-photo-grid.case-photo-trio {
  max-width: var(--editorial-media-width);
  column-gap: var(--editorial-column-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.film-stage .reusable-case-film video { aspect-ratio: auto 16/9; }
@media (max-width: 700px) {
  .case-photo-grid.case-photo-trio { grid-template-columns: minmax(0, 1fr); }
}

/* The left photograph leads; the shared case-file scroll controller aligns the row. */
@media screen and (min-width: 701px) and (prefers-reduced-motion: no-preference) {
  .case-photo-trio > figure:nth-child(2) { --case-row-stagger: 64px; margin-top: var(--case-row-stagger); }
  .case-photo-trio > figure:nth-child(3) { --case-row-stagger: 128px; margin-top: var(--case-row-stagger); }
}

/* Optional continuation keeps closing paragraphs within the same chapter. */
.chapter-closing-copy { margin-top: var(--case-content-gap); }
.chapter-film .chapter-closing-copy { padding-inline: var(--gutter); }

/* A single photograph can break out to the viewport while its credit stays inset. */
.chapter-flexible .case-photo-grid.case-photo-single.case-photo-fullbleed {
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
}
.case-photo-fullbleed figure { position: relative; }
.case-photo-fullbleed figure::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: clamp(80px, 18%, 180px);
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  pointer-events: none;
}
.case-photo-grid.case-photo-fullbleed figcaption {
  position: absolute;
  z-index: 1;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--overlay-caption-bottom);
  padding: 0;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* Standalone videos share the chapter film reveal and retain their own ratio. */
.editorial-case .standalone-film .case-film {
  --film-expanded-width: min(var(--editorial-media-width), calc(100vw - 2 * var(--gutter)), max(var(--reading-measure), calc((100svh - var(--header-height) - 120px) * 16 / 9)));
}
.standalone-film .film-stage .case-film video { aspect-ratio: auto 16/9; }

/* Shared rhythm for reusable chapters and grouped legacy media. */
.editorial-case .chapter-content { padding-bottom: var(--case-chapter-end); }
.editorial-case .chapter-content > .chapter-media {
  margin: var(--case-content-gap) auto 0;
}
.editorial-case .chapter-content > .chapter-media:first-child { margin-top: 0; }
.editorial-case .chapter-content > .standalone-film .film-stage { padding-inline: 0; }
.editorial-case .chapter-flexible .film-scene { margin-bottom: 0; }
.editorial-case .chapter-content > .image-pair.captioned-pair {
  width: 100%; max-width: var(--chapter-film-width); padding: 0; gap: 40px 24px;
}
.editorial-case .chapter-content > .image-pair.captioned-pair figcaption { padding: 12px 0 0; }
@media (max-width: 700px) {
  .editorial-case { --case-content-gap: 32px; --case-chapter-end: 48px; }
  .editorial-case .chapter-content > .image-pair.captioned-pair {
    grid-template-columns: minmax(0, 1fr); max-width: none; gap: 32px;
  }
}
