/* REV014: only Community and Research retain explanatory diagrams. Each is
   in its existing reading column. Portrait places explanation after prose.
   This layer contains no scene-wide illustration positioning or light effects. */
#stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 16px;
}
#stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] > .narrative-graphic {
  position: relative;
  inset: auto;
  grid-area: auto;
  align-self: start;
  justify-self: start;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  transform: none;
  overflow: visible;
  pointer-events: none;
}
#stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) .narrative-art {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
}
#stage[data-sitewide-revision="true"] #research.copy > [data-editorial-content] > .narrative-graphic {
  width: min(100%, 500px);
}

@media (min-width: 761px) {
  /* Preserve the established right reading edge, opposite the filmed map and
     cube. Diagrams share this column rather than borrowing the subject area. */
  #stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] {
    left: auto;
    right: calc(var(--gutter) + 76px);
    width: min(550px, 40vw);
  }
}

@media (min-width: 761px) and (max-height: 850px) {
  /* A short desktop needs enough clearance below the fixed hero/subtitle.
     These diagram dimensions preserve meaningful labels without shrinking
     the approved prose or adding a second content step. */
  #stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] {
    gap: 12px;
  }
  #stage[data-sitewide-revision="true"] #research.copy > [data-editorial-content] {
    bottom: 64px;
  }
  #stage[data-sitewide-revision="true"] #research.copy > [data-editorial-content] > .narrative-graphic {
    width: min(100%, 380px);
  }
}

@media (max-width: 760px) {
  #stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] {
    position: relative;
    inset: auto;
    width: 100%;
    margin-top: auto;
    gap: 14px;
    transform: none;
  }
  #stage[data-sitewide-revision="true"] #research.copy > [data-editorial-content] > .narrative-graphic {
    width: min(100%, 440px);
  }
}

/* Native draft-research-390.png showed the first-child diagram crossing the
   crystal. In portrait the complete argument leads and its compact explanation
   closes the lower reading group, on the same left alignment as the prose. */
@media (max-width: 760px) and (orientation: portrait) {
  #stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] > .story-unit:not(.narrative-graphic) {
    order: 0;
  }
  #stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] > .narrative-graphic {
    order: 2;
    justify-self: start;
  }
  #stage[data-sitewide-revision="true"] #research.copy > [data-editorial-content] > .narrative-graphic {
    width: min(100%, 280px);
  }
  #stage[data-sitewide-revision="true"] #research.copy .narrative-label {
    font-size: 26px;
  }
}

@media (max-width: 760px) and (max-height: 740px) and (orientation: portrait) {
  #stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] {
    gap: 12px;
  }
  /* final-research-360x740.png: a separate link row lifted the reading group
     across the crystal. Pair the existing title/action and retain whole prose.
     The bottom anchor then lowers the group by about48px without smaller type. */
  #stage[data-sitewide-revision="true"] #research.copy .research-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
  }
  #stage[data-sitewide-revision="true"] #research.copy .research-feature > h3 {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }
  #stage[data-sitewide-revision="true"] #research.copy .research-feature > .new-scene-detail {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    min-height: 44px;
    margin: 0;
  }
  #stage[data-sitewide-revision="true"] #research.copy .research-feature > p {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
}

@media (max-width: 760px) and (max-height: 560px) and (orientation: landscape) {
  #stage[data-sitewide-revision="true"] :is(#company-overview.copy, #research.copy) > [data-editorial-content] {
    grid-column: 2;
    grid-row: 1 / 4;
    margin: 0;
    gap: 10px;
    align-self: start;
  }
  #stage[data-sitewide-revision="true"] #company-overview.copy > [data-editorial-content] > .narrative-graphic + .story-unit--copy {
    margin-top: 50px;
  }
  /* Native740 trial: the complete article sits beyond the cube's right edge.
     Its title/action share one row; the original-aspect explanation follows
     below at the reading rail's right edge, clear of the navigation buttons. */
  #stage[data-sitewide-revision="true"] #research.copy > [data-editorial-content] > .story-unit:not(.narrative-graphic) {
    order: 0;
  }
  #stage[data-sitewide-revision="true"] #research.copy > [data-editorial-content] > .narrative-graphic {
    order: 2;
    width: min(100%, 260px);
    margin-left: 0;
    justify-self: end;
  }
  #stage[data-sitewide-revision="true"] #research.copy .narrative-label {
    font-size: 28px;
  }
  #stage[data-sitewide-revision="true"] #research.copy .research-feature {
    width: min(100%, 224px);
    justify-self: end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
  }
  #stage[data-sitewide-revision="true"] #research.copy .research-feature > h3 {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }
  #stage[data-sitewide-revision="true"] #research.copy .research-feature > .new-scene-detail {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    min-height: 44px;
    margin: 0;
  }
  #stage[data-sitewide-revision="true"] #research.copy .research-feature > p {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
}
