/* Case study styles */
.case-hero {
  padding: calc(var(--nav-height) + var(--space-lg)) 0 0;
}

.case-hero-image {
  width: 100%;
  aspect-ratio: 21/9;
  overflow: hidden;
  border-radius: 6px;
  margin-top: var(--space-lg);
}

.case-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  transition: color var(--transition-fast);
}

.case-back:hover {
  color: var(--color-primary);
}

/* Scope sidebar */
.case-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .case-layout {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}

.case-scope {
  background: var(--color-bg-alt);
  border-radius: 6px;
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--nav-height) + var(--space-sm));
}

.case-scope h4 {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-sage);
  margin-bottom: var(--space-sm);
}

.scope-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.scope-row:last-child {
  border-bottom: none;
}

.scope-label {
  color: var(--color-text-light);
}

.scope-value {
  font-weight: 600;
  text-align: right;
}

.scope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: var(--space-sm);
}

/* Case study content sections */
.case-section {
  margin-bottom: var(--space-xl);
}

.case-section h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.case-section h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
  color: var(--color-sage);
}

/* Before/after in case study */
.case-ba-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

@media (min-width: 768px) {
  .case-ba-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.case-ba-pair {
  border-radius: 6px;
  overflow: hidden;
}

.case-ba-pair img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}

.case-ba-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-ba-label.before {
  background: var(--color-primary);
  color: var(--color-white);
}

.case-ba-label.after {
  background: var(--color-sage);
  color: var(--color-white);
}

/* Gallery grid in case study */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: var(--space-md);
}

@media (min-width: 768px) {
  .case-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.case-gallery-item {
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3/2;
}

.case-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.case-gallery-item:hover img {
  transform: scale(1.05);
}

/* Testimonial in case study */
.case-testimonial {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-sage);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 6px 6px 0;
  margin: var(--space-lg) 0;
}

.case-testimonial blockquote {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.case-testimonial cite {
  font-style: normal;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-light);
}

/* Next project nav */
.next-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-xl);
}

/* ===== Desktop: visual blocks span the full content width =====
   The Scope sidebar is short, but its grid column would otherwise
   reserve empty space beside the gallery/before-after/CTA far below
   it. Let those visual blocks break out to full width; keep body
   text in the readable column beside the sidebar. */
@media (min-width: 768px) {
  /* Sidebar sits with the intro text instead of trailing the whole
     page, so widened blocks below can never overlap it. */
  .case-scope {
    position: static;
  }

  .case-layout > div:first-child > .case-section:has(.case-ba-grid),
  .case-layout > div:first-child > .case-section:has(.case-gallery),
  .case-layout > div:first-child > .text-center,
  .case-layout > div:first-child > .next-project {
    width: calc(100% + 280px + var(--space-xl));
  }
}

.next-project a {
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: color var(--transition-fast), gap var(--transition-base);
}

.next-project a:hover {
  color: var(--color-sage);
  gap: 0.625rem;
}
