/* AZ Design System — single case-study body layout.
   Authored addition: ports the CaseStudy organism's CSS from the design
   system's React component (project/components/editorial/CaseStudy.jsx),
   renamed to the theme's class convention, so case-study post content can
   be authored as plain HTML/blocks instead of the `[az_case_*]` shortcodes
   the az-site-system plugin used to render. Asymmetric hero (dek + sticky
   fact rail), sticky-labelled numbered sections, video figures, and a
   related-work footer — all hairline rules, no shadows, matching the rest
   of the system. */

.az-case-study {
  color: var(--az-color-text);
  width: 100%;
  max-width: none;
  min-width: 0;
}
.az-case-study * {
  box-sizing: border-box;
}

.az-case-study__hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
  padding-block: 0 clamp(4rem, 8vw, 7rem);
}

.az-case-study__hero-main {
  grid-column: 1 / 9;
  display: grid;
  gap: clamp(1.75rem, 3vw, 2.75rem);
  min-width: 0;
}

.az-case-study__subtitle {
  margin: 0;
  max-width: var(--az-reading-measure);
  font-family: var(--az-font-h3-family);
  font-style: italic;
  font-weight: var(--az-font-h3-weight);
  font-size: var(--az-type-h3);
  line-height: var(--az-font-h3-line-height);
  color: var(--az-color-muted);
}

.az-case-study__lede {
  display: grid;
  gap: var(--az-space-20);
  max-width: var(--az-reading-measure);
  font-size: var(--az-type-body);
  line-height: var(--az-leading-body);
}
.az-case-study__lede p {
  margin: 0;
}

.az-case-study__meta {
  grid-column: 10 / 13;
  justify-self: end;
  width: 100%;
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 1.15rem;
  align-content: start;
}
.az-case-study__fact {
  display: grid;
  gap: 0.25rem;
  padding-top: var(--az-space-2);
  border-top: 1px solid var(--az-color-border);
  margin: 0;
}
.az-case-study__fact:first-child {
  padding-top: 0;
  border-top: 0;
}
.az-case-study__fact-label {
  font-family: var(--az-font-h6-family);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: var(--az-tracking-label-strong);
  text-transform: uppercase;
  color: var(--az-color-text);
}
.az-case-study__fact-value {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--az-color-muted);
  overflow-wrap: anywhere;
}

.az-case-study__flow {
  display: grid;
  gap: clamp(5rem, 9vw, 8rem);
}

.az-case-study__section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  padding-top: clamp(5rem, 9vw, 7.5rem);
  border-top: 1px solid var(--az-color-neutral-line);
}
.az-case-study__label-col {
  grid-column: 1 / 4;
  position: sticky;
  top: var(--az-space-80);
  align-self: start;
}
.az-case-study__label {
  margin: 0;
  max-width: 13rem;
  font-family: var(--az-font-h6-family);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: var(--az-tracking-label-strong);
  text-transform: uppercase;
  color: var(--az-color-muted);
  line-height: 1.35;
}
.az-case-study__main {
  grid-column: 5 / 13;
  min-width: 0;
  display: grid;
  gap: var(--az-space-20);
}
.az-case-study__section-title {
  margin: 0;
  font-family: var(--az-font-h2-family);
  font-weight: var(--az-font-h2-weight);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.az-case-study__body {
  display: grid;
  gap: var(--az-space-20);
  max-width: 44rem;
  font-size: var(--az-type-body);
  line-height: var(--az-leading-body);
}
.az-case-study__body p {
  margin: 0;
}
.az-case-study__body h3 {
  margin: var(--az-space-2) 0 0;
  font-family: var(--az-font-h4-family);
  font-weight: var(--az-font-h4-weight);
  font-size: var(--az-type-h4);
  line-height: var(--az-font-h4-line-height);
}
.az-case-study__section--dense .az-case-study__body {
  gap: var(--az-space-2);
}
.az-case-study__section--dense .az-case-study__body h3 {
  margin-top: var(--az-space-3);
}

.az-case-study__media {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
}
.az-case-study__media-slot {
  grid-column: 5 / 13;
  min-width: 0;
}

.az-case-study__video {
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.az-case-study__video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--az-color-border);
  background: var(--az-color-panel);
}
.az-case-study__video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.az-case-study__video-caption {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--az-color-muted);
}

.az-case-study__related {
  margin-top: var(--az-space-100);
  padding-block: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--az-color-neutral-line);
  border-bottom: 1px solid var(--az-color-neutral-line);
  display: grid;
  gap: var(--az-space-40);
}
.az-case-study__related-title {
  margin: 0;
  font-family: var(--az-font-h3-family);
  font-weight: var(--az-font-h3-weight);
  font-size: var(--az-type-h3);
  line-height: var(--az-font-h3-line-height);
}
.az-case-study__related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--az-space-40);
}
.az-case-study__related-item {
  display: grid;
  gap: var(--az-space-2);
  min-width: 0;
}
.az-case-study__related-kicker {
  margin: 0;
  font-family: var(--az-font-h6-family);
  font-size: var(--az-type-small);
  font-weight: 600;
  letter-spacing: var(--az-tracking-label);
  text-transform: uppercase;
  color: var(--az-color-muted);
}
.az-case-study__related-link {
  font-family: var(--az-font-h4-family);
  font-weight: var(--az-font-h4-weight);
  font-size: var(--az-type-h4);
  line-height: var(--az-font-h4-line-height);
  color: var(--az-color-text);
  text-decoration: none;
}
.az-case-study__related-link:hover,
.az-case-study__related-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}
.az-case-study__related-summary {
  margin: 0;
  font-size: 0.92rem;
  color: var(--az-color-muted);
  line-height: 1.55;
}

@media (max-width: 820px) {
  .az-case-study__hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--az-space-40);
    padding-block: 0 var(--az-space-60);
  }
  .az-case-study__hero-main,
  .az-case-study__meta {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
  }
  .az-case-study__flow {
    gap: 40px;
  }
  .az-case-study__section {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--az-space-20);
    padding-top: 40px;
  }
  .az-case-study__label-col {
    position: static;
  }
  .az-case-study__main {
    grid-column: auto;
  }
  .az-case-study__media-slot {
    grid-column: auto;
  }
  .az-case-study__related {
    margin-top: 40px;
  }
}
