/* Keep the measure of the text independent of the width of the photos. */
.editorial-story {
  --story-space: clamp(34px, 5vw, 80px);
  --story-gutter: clamp(20px, 4.4vw, 72px);
  --image-space: clamp(18px, 2.8vw, 42px);
  display: grid;
  gap: var(--story-space);
  padding-block: var(--story-space);
}
.editorial-story:has(> :last-child:is([class*="layout-photo-"], .editorial-work)) {
  padding-bottom: 0;
}

.editorial-story .editorial-section {
  width: min(100% - 2 * var(--story-gutter), 1480px);
  max-width: none;
  min-height: 0;
  padding: 0;
  margin: 0 auto;
  display: grid;
  gap: var(--image-space);
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}
.editorial-story .editorial-section[class*="layout-photo-"] {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}
.editorial-story .section-copy,
.editorial-story .section-visual {
  min-width: 0;
  order: 0;
  margin: 0;
  padding: 0;
}
.editorial-story [class*="layout-photo-"] .section-copy {
  width: min(100% - 2 * var(--story-gutter), 1480px);
  margin-inline: auto;
}
.editorial-story .section-copy {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 14px clamp(28px, 5vw, 96px);
}
.editorial-story .section-copy h2 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(31px, 4.15vw, 64px);
  line-height: 1.03;
  text-wrap: balance;
}
.editorial-story .section-copy p {
  max-width: 58ch;
  margin: 0;
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.62;
}
.editorial-story .section-copy p + p { margin-top: .85em; }
.editorial-story .layout-copy { width: min(100% - 2 * var(--story-gutter), 980px); }
.editorial-story .layout-copy .section-copy { align-items: baseline; }
.editorial-story .layout-copy h2 { font-size: clamp(30px, 3.2vw, 52px); }
.editorial-story .layout-photo-panorama .section-visual { grid-row: 1; }

.editorial-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}
.editorial-spread:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.editorial-offset:has(> :nth-child(2)) { grid-template-columns: 3fr 2fr; }
.editorial-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.editorial-image { min-width: 0; margin: 0; }
.editorial-image img { display: block; width: 100%; height: auto; }
.editorial-spread:has(> :nth-child(2)) img {
  height: clamp(260px, 41vw, 660px);
  object-fit: cover;
}
.editorial-spread:has(> :only-child) .editorial-image:not(.artifact) img {
  max-height: 76svh;
  object-fit: cover;
}
.editorial-panorama .editorial-image img { aspect-ratio: 5 / 2; object-fit: cover; }
.editorial-spread .artifact img { max-height: none; }
.editorial-photo-credit {
  width: min(100% - 40px, 1480px);
  margin: 0 auto;
  padding-block: 12px 18px;
  color: var(--cream);
  font-size: .76rem;
  line-height: 1.5;
}
.editorial-photo-credit a { text-decoration: underline; text-underline-offset: .15em; }

.editorial-bilingual { width: 100%; margin: 0; }
.hero:has(+ .editorial-bilingual) { padding-bottom: clamp(24px, 3vw, 46px); }
.paper:has(+ .editorial-bilingual) .qa-story { padding-bottom: clamp(24px, 4vw, 56px); }
.editorial-bilingual + .result { padding-top: clamp(30px, 4vw, 64px); }
.editorial-bilingual + .result .result-heading { margin-top: 0; }
.editorial-bilingual + .paper .market-story { padding-top: clamp(36px, 5vw, 72px); }

.layout-photo-feature .hf-panel,
.layout-photo-feature .hf-pad { padding: 0; }
.layout-photo-feature .hf-materials { gap: 0; }
.layout-photo-feature .hf-photo { margin: 0; }

.editorial-work { width: 100%; }
.editorial-work-grid { columns: 3; column-gap: 0; }
.editorial-work-grid > figure { break-inside: avoid; }
.editorial-work-shoot .editorial-work-grid { columns: 2; }
.editorial-work-film .editorial-work-grid { columns: 4; }
.editorial-work-film .editorial-image img { aspect-ratio: 9 / 16; object-fit: cover; }

@media (max-width: 760px) {
  .editorial-story .editorial-section,
  .editorial-story .section-copy { grid-template-columns: minmax(0, 1fr); }
  .editorial-story .section-copy { gap: 14px; }
  .editorial-story .section-copy h2 { max-width: 22ch; }
  .editorial-spread,
  .editorial-offset:has(> :nth-child(2)),
  .editorial-trio { grid-template-columns: minmax(0, 1fr); }
  .editorial-spread:has(> :nth-child(2)) img,
  .editorial-spread:has(> :only-child) .editorial-image:not(.artifact) img {
    aspect-ratio: auto;
    height: auto;
    max-height: none;
  }
  .editorial-panorama .editorial-image img { aspect-ratio: auto; }
  .editorial-work .editorial-work-grid { columns: 1; }
  .layout-photo-feature .hf-materials { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 761px) {
  .case-grid.editorial-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(32px, 5vw, 76px) clamp(14px, 2.2vw, 34px);
  }

  .editorial-index .case-tile { grid-column: auto; }
}

@media (max-width: 760px) {
  .editorial-story .editorial-section:has(iframe[data-auto-size]) {
    width: 100%;
  }

  .editorial-story .editorial-section:has(iframe[data-auto-size]) .section-copy {
    width: calc(100% - 2 * var(--story-gutter));
    margin-inline: auto;
  }

  .editorial-story .section-visual iframe[data-auto-size] {
    min-height: 0;
  }

  .market-story .language-showcase,
  .paper .qa-story {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
  }

  .market-story .language-showcase .preview-controls,
  .paper .qa-story .chapter-copy {
    width: calc(100% - 2 * var(--gutter));
    margin-inline: auto;
  }

  .qa-story .mobile-visual {
    width: 100%;
    padding-inline: 0;
  }

  .qa-story .phone {
    width: 100%;
    border: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .qa-story .phone-view {
    border-radius: 0;
  }
}

@media (max-width: 760px) {
  /* The next section starts with a photo before its copy. Close just that seam. */
  .editorial-story > [class*="layout-photo-"]:not(.layout-photo-panorama)
    + :is(.layout-photo-panorama, .editorial-work) {
    margin-block-start: calc(-1 * var(--story-space));
  }
}

.editorial-bank-proof:has(> :nth-child(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.editorial-bank-proof:has(> :nth-child(2)) img {
  height: auto;
  aspect-ratio: 1.15;
  object-fit: cover;
  object-position: center 28%;
}
.editorial-bank-proof:not(:has(> :nth-child(3))) img {
  aspect-ratio: 3.7 / 1;
  object-fit: cover;
}

@media (max-width: 760px) {
  .editorial-bank-proof:has(> :nth-child(3)) {
    grid-template-columns: minmax(0, 1fr);
  }
  .editorial-bank-proof:has(> :nth-child(2)) img {
    aspect-ratio: auto;
  }
}

@media (max-width: 760px) {
  .layout-mark-feature .hf-marks,
  .layout-photo-feature .hf-two {
    gap: 0;
  }

  .editorial-story:has(> :last-child:is([class*="layout-photo-"], .editorial-work))
    + .story-outcome {
    padding-block-start: 36px;
  }
}
