/* One singular Project / Case mode. Archives and other viewers are unchanged. */
.case-detail {
  padding-block-start: clamp(4.375rem, 6vw, 5.625rem);
}

.case-detail--exhibition,
.case-detail--commission,
.case-detail--collaboration {
  --bf-case-label-column: clamp(6.5rem, 8.5vw, 8.5rem);
  --bf-case-label-gap: 1rem;
}

.case-detail .case-detail__hero {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: start !important;
  gap: clamp(2rem, 5vw, 5rem) !important;
  margin-block-end: clamp(3.5rem, 5vw, 5rem) !important;
}

.case-detail__hero > .wp-block-column { margin: 0; }

.case-detail .case-detail__heading h1 {
  font-size: clamp(4rem, 5.2vw, 4.75rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.04;
  max-width: none;
  overflow-wrap: break-word;
}

.case-detail__heading .eyebrow { margin-block: 0 1.25rem; }

.case-detail .case-detail__meta {
  border: 0;
  margin-block: clamp(1.75rem, 2.5vw, 2.5rem) 0;
  padding: 0;
  font-size: .8125rem;
}

.case-detail .case-detail__meta-row {
  grid-template-columns: var(--bf-case-label-column, minmax(6.5rem, .3fr)) minmax(0, 1fr);
  gap: var(--bf-case-label-gap, 1rem);
  padding-block: .5rem;
  line-height: 1.6;
}

.case-detail__meta dd { overflow-wrap: break-word; }
.case-detail__cover figure { margin: 0; background: transparent; }

.wp-site-blocks .case-detail .case-detail__cover img {
  display: block;
  width: auto;
  height: auto !important;
  max-width: 100% !important;
  max-height: 68vh !important;
  max-height: 68svh !important;
  margin-inline: auto;
  object-fit: contain !important;
}

.case-detail .case-detail__content {
  max-width: 70ch;
  margin-inline: auto;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.75;
}

.case-detail .case-detail__content { margin-block-end: clamp(3.5rem, 5vw, 5rem); }
.case-detail__content p { font-size: inherit; line-height: inherit; }

.case-detail .commission-story {
  width: 100%;
  max-width: var(--wp--style--global--wide-size);
  margin-inline: auto;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.75;
  gap: 2.5rem;
  margin-block-end: clamp(3.5rem, 5vw, 5rem);
}

.case-detail .commission-story__section {
  border: 0;
  padding: 0;
  grid-template-columns: var(--bf-case-label-column, 6.5rem) minmax(0, 1fr);
  gap: var(--bf-case-label-gap, 1rem);
}

.case-detail .commission-story__copy { max-width: none; min-width: 0; }
.case-detail .commission-story__copy p { font-size: inherit; line-height: inherit; margin-block: 0 1.2em; }
.case-detail .commission-story__copy > :last-child { margin-block-end: 0; }

.case-media-links {
  display: grid;
  grid-template-columns: var(--bf-case-label-column, 6.5rem) minmax(0, 1fr);
  gap: var(--bf-case-label-gap, 1rem);
  margin-block-end: clamp(3rem, 4vw, 4rem);
}
.case-media-links h2 { margin: 0; font-size: .75rem; font-weight: 500; line-height: 1.7; letter-spacing: .1em; text-transform: uppercase; }
.case-detail__hero:not(:has(.case-detail__cover)) { grid-template-columns: minmax(0, 1fr); }

.case-detail .project-viewer {
  --bf-project-image-height: 80vh;
  --bf-project-image-height: 80svh;
  display: block;
  width: 90%;
  max-width: 100%;
  margin-inline: auto;
  background: transparent;
}

.project-viewer__stage { position: relative; background: transparent; }

.project-viewer .case-detail__image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: transparent;
}

.project-viewer[data-project-ready] .project-viewer__stage,
.project-viewer[data-project-ready] .case-detail__image-frame:not([hidden]) {
  height: var(--bf-project-image-height);
}

.project-viewer [data-project-slide][hidden],
.project-viewer [data-project-controls][hidden] { display: none; }

/* Both dimensions remain automatic: max-height never stretches the width. */
.wp-site-blocks .case-detail .project-viewer img.case-detail__image {
  display: block;
  width: auto;
  height: auto !important;
  max-width: 100% !important;
  max-height: var(--bf-project-image-height) !important;
  margin-inline: auto !important;
  object-fit: contain !important;
}

.project-viewer__controls { margin-block-start: .75rem; }

@media (max-width: 1023px) {
  .case-detail { padding-block-start: clamp(2.8125rem, 8vw, 3.75rem); }
  .case-detail .case-detail__hero { grid-template-columns: minmax(0, 1fr); gap: 2.5rem !important; }
  .case-detail .case-detail__heading h1 { font-size: clamp(2.15rem, 7vw, 3.25rem); line-height: 1.08; }
  .case-detail .case-detail__cover { margin: 0; }
  .case-detail .commission-story__section { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .case-media-links { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .case-detail .project-viewer { width: 100%; }
  .project-viewer[data-project-ready] .project-viewer__stage,
  .project-viewer[data-project-ready] .case-detail__image-frame:not([hidden]) { height: auto; }
}
