/* Project-specific components built on the shared case-study grids and tokens. */
.case-copy > .case-body,
.case-copy > .case-list {
  margin-top: 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.case-copy a,
.case-details a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.case-list {
  padding-left: 24px;
}

.case-list li + li {
  margin-top: 12px;
}

.case-section > .case-copy-grid:not(:first-child) {
  margin-top: 64px;
}

.case-section > .case-chapter:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.case-section > .case-chapter + .case-copy-grid {
  margin-top: 36px;
}

.case-chapter > .case-label {
  width: 100%;
  max-width: var(--case-text-width);
  margin: 0 auto 12px;
}

.case-insights:has(> .case-insight:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

img.case-insight-icon {
  width: 24px;
  height: 24px;
}

.case-insight--no-icon {
  grid-template-columns: minmax(0, 1fr);
}

.case-insight--no-icon > p {
  grid-column: 1;
}

.case-caption {
  max-width: var(--case-text-width);
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.case-solution-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.case-solution-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.case-solution-image:first-child {
  grid-row: 1 / span 2;
}

.case-impact-card,
.case-decision-card,
.case-interviews {
  width: 100%;
  max-width: var(--case-text-width);
  margin: 36px auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff66;
}

.case-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.case-metric-value {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.case-card-title {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.case-card-description {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.case-decision-card {
  padding: 24px;
}

.case-decision-image {
  width: 100%;
  height: auto;
  margin-top: 24px;
  border-radius: 8px;
}

.case-arrow {
  display: block;
  width: 40px;
  height: auto;
  margin: 24px auto;
}

.case-arrow + .case-decision-card {
  margin-top: 0;
}

.case-recording {
  margin-top: 36px;
  padding: 24px;
  border-radius: 16px;
  background: var(--soft);
}

.case-video-frame {
  overflow: hidden;
  border-radius: 12px;
}

.case-video,
.case-video-frame video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* All branded heroes share checkout's desktop height and responsive geometry. */
.case-page:has(.case-branded-hero) main {
  overflow: visible;
}

.case-branded-hero {
  --hero-font-size: clamp(38px, 4.2vw, 60px);
  --hero-line-height: 1.15;
  --hero-title-lines: 2;
  --hero-top: 84px;
  --hero-gap: 84px;
  --hero-grid-width: min(var(--page-max-width), calc(100vw - var(--page-gutters)));
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--hero-gap);
  height: calc(var(--hero-top) + var(--hero-gap) + var(--hero-font-size) * var(--hero-line-height) * var(--hero-title-lines) + var(--hero-grid-width) * .882 * 1330 / 2138);
  padding-top: var(--hero-top);
}

.case-branded-hero > .project-background {
  position: absolute;
  z-index: -1;
  top: -120px;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--hero-background) center / cover no-repeat;
  pointer-events: none;
}

.case-branded-hero h1,
.case-branded-hero .case-project-name {
  color: #fff;
}

.case-hero-copy {
  min-width: 0;
}

.case-hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  min-height: 0;
  margin: 0;
}

.case-hero-stage > img {
  grid-area: 1 / 1;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  justify-self: center;
  object-fit: contain;
  object-position: center bottom;
}

.case-hero-stage > .case-checkout-desktop {
  justify-self: start;
  max-width: 88.2%;
}

.case-hero-stage > .case-checkout-mobile {
  position: relative;
  justify-self: end;
  max-width: 26.9%;
}

@media (min-width: 701px) and (max-width: 1100px) {
  .case-branded-hero {
    --hero-title-lines: 3;
  }
}

@media (max-width: 700px) {
  .case-branded-hero {
    --hero-font-size: clamp(32px, 6.8vw, 44px);
    --hero-line-height: 1.2;
    --hero-title-lines: 6;
    --hero-top: 56px;
    --hero-gap: 48px;
  }
}

/* Existing compliance diagram zoom remains available and keyboard accessible. */
.cs-zoom {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
}

.cs-zoom img {
  width: 100%;
}

.cs-zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #272d35cc;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
}

.cs-zoom-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.cs-zoom-dialog::backdrop {
  background: #000000d9;
}

.cs-zoom-scroll {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 56px 24px;
}

.cs-zoom-scroll img {
  flex-shrink: 0;
  width: 2000px;
  max-width: none;
  height: auto;
  margin: auto;
  border-radius: 12px;
  background: #fff;
}

.cs-zoom-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

html:has(.cs-zoom-dialog[open]) {
  overflow: hidden;
}

@media (max-width: 700px) {
  .case-copy > .case-body,
  .case-copy > .case-list {
    margin-top: 20px;
    line-height: 1.75;
  }

  .case-section > .case-copy-grid:not(:first-child) {
    margin-top: 48px;
  }

  .case-solution-grid,
  .case-metrics {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .case-solution-image,
  .case-solution-image:first-child {
    grid-row: auto;
    height: auto;
  }

  .case-impact-card,
  .case-interviews {
    padding: 22px;
  }

  .case-card-title {
    font-size: 22px;
  }

  .case-recording {
    padding: 16px;
  }

}

.case-copy > .case-body {
  margin-top: 16px;
}

.checkout-prototype-video {
  border: var(--case-image-border);
  border-radius: var(--case-image-radius);
}

.case-study .case-decision-image--unframed {
  border: 0;
  border-radius: 0;
}

.case-study .case-decision-image--padded {
  box-sizing: border-box;
  padding: 24px;
  background: #fff;
}

@media (max-width: 700px) {
  .case-study .case-decision-image--padded { padding: 16px; }
}
