.clearview-case .case-hero .case-media-frame,
.clearview-case .gov-image-frame {
  background: var(--color-surface);
}

.clearview-case .case-facts > div:nth-child(3) { grid-column: 1 / -1; }
.clearview-case .case-subheading + .case-copy + .case-gallery { margin-top: 24px; }
.clearview-case .case-artifact .gov-media-image figcaption { display: none; }
.clearview-case .case-artifact { display: flex; flex-direction: column; }
.clearview-case .case-artifact > .case-media { margin-top: auto; padding-top: 24px; }
.clearview-case .gov-media-image figcaption { font-size: 14px; line-height: 22px; }
.clearview-case [data-media-slot="13"],
.clearview-case [data-media-slot="16"],
.clearview-case [data-media-slot="38"] { max-width: 720px; }

.clearview-case .case-journey {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 24px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.clearview-case .case-journey li {
  position: relative;
  min-width: 0;
  border-radius: 12px;
  padding: 16px;
  background: var(--color-surface);
}
.clearview-case .case-journey li:not(:last-child)::after {
  content: '→';
  position: absolute;
  top: 16px;
  left: calc(100% + 4px);
  color: var(--color-text-secondary);
}
.clearview-case .case-journey h3 { font: 600 16px/24px var(--font-heading); }
.clearview-case .case-journey p { margin-top: 8px; font-size: 14px; line-height: 22px; }

.clearview-case .case-media-phone { max-width: 320px; }
.clearview-case .case-media-phone .gov-image-frame {
  background: #121314;
  border: 2px solid #505155;
  padding: 5px;
  border-radius: 30px;
  box-shadow: inset 0 0 0 1px #76787a;
}
.clearview-case .case-media-phone img { border-radius: 23px; }
@media (min-width: 1024px) {
  .clearview-case .case-media-phone {
    max-width: clamp(150px, calc((100svh - var(--nav-height) - 130px) * 390 / 844), 280px);
  }
  .clearview-case [aria-labelledby="case-mobile"] .case-gallery-3 {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}
@media (max-width: 1023px) {
  .clearview-case .case-journey { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .clearview-case .case-journey li:not(:last-child)::after { content: '↓'; top: 100%; left: 16px; }
}

/* Show the original two exported halves as one continuous desktop screen. */
.clearview-case .case-screen-pair { margin-top: 24px; }
.screen-pair-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gov-lightbox-scroll > img[hidden] { display: none; }
.gov-lightbox-scroll .screen-pair-tiles {
  width: min(100%, 142dvh);
  margin-inline: auto;
}
.gov-lightbox-scroll .screen-pair-tiles img {
  width: 100%;
  max-height: none;
}
.gov-lightbox-scroll .screen-pair-tiles.is-zoomed {
  width: max(1440px, 125%);
  margin: 0;
}

/* Research evidence stays close to the decision it illustrates. */
.clearview-case .case-copy + .case-copy { margin-top: 18px; }
.clearview-case .case-copy + .case-gallery,
.clearview-case .case-gallery + .case-gallery { margin-top: 24px; }
.clearview-case .case-gallery + .case-copy { margin-top: 28px; }
.clearview-case .case-gallery .case-screen-pair { margin-top: 0; }
.clearview-case .case-gallery-research {
  padding: clamp(12px, 2vw, 24px);
  border-radius: 16px;
  background: var(--color-surface);
  align-items: start;
}
@media (min-width: 768px) and (max-width: 1023px) {
  .clearview-case .case-gallery-3.case-gallery-research { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

.clearview-case [aria-labelledby="case-publishing"] .case-journey {
  grid-template-columns: repeat(3,minmax(0,1fr));
}
.clearview-case [aria-labelledby="case-analysis"] .case-columns {
  margin-bottom: 40px;
}
@media (min-width: 1024px) {
  .clearview-case :is(
    [aria-labelledby="case-task"], [aria-labelledby="case-concept"],
    [aria-labelledby="case-dashboards"], [aria-labelledby="case-filters"],
    [aria-labelledby="case-interface-scale"], [aria-labelledby="case-mobile"],
    [aria-labelledby="case-design-review"]
  ) .case-insights {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}
@media (max-width: 767px) {
  .clearview-case [aria-labelledby="case-publishing"] .case-journey {
    grid-template-columns: minmax(0,1fr);
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .clearview-case [aria-labelledby="case-publishing"] .case-journey li:not(:last-child)::after {
    content: '→';
    top: 16px;
    left: calc(100% + 4px);
  }
}

@media (max-width: 767px) {
  .clearview-case .diagram-ready.diagram-journey .diagram-viewport {
    aspect-ratio: auto;
    max-height: none;
    border: 0;
    background: none;
    overflow: visible;
  }
  .clearview-case .diagram-ready.diagram-journey .diagram-viewport > .diagram-content {
    position: static;
    width: auto;
    transform: none;
  }
  .clearview-case :is(.diagram-journey .diagram-content, [aria-labelledby="case-publishing"]) .case-journey li:not(:last-child)::after {
    left: 50%;
    transform: translateX(-50%);
  }
}
