/*
 * Case detail (Figma frame "Desktop - 8").
 */

/* ---------- Hero ---------- */

.case-hero {
  position: relative;
  height: clamp(420px, 100svh - 200px, 824px);
  overflow: hidden;
  background: var(--c-ink);
  color: var(--c-white);
}
/* Crop from Figma: image 1.9% wider than the frame, shifted up 5.7% */
.case-hero img {
  position: absolute;
  top: -5.7%;
  left: 0;
  width: 101.875%;
  max-width: none;
  height: auto;
  min-height: 105.7%;
  object-fit: cover;
}
.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}
.case-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding-bottom: 56px;
}
.case-hero__title {
  font-size: var(--fs-display);
  line-height: 1;
}

/* ---------- Intro: lead + services ---------- */

.case-intro {
  margin-top: 66px;
}
.case-intro .eyebrow {
  font-weight: 500;
}
.case-intro__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  /* five lines of lead in the mockup */
  min-height: 230px;
}
.case-intro__lead {
  max-width: 717px;
  font-size: var(--fs-lead);
  line-height: 1.2778;
}
.case-intro__services {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 24px;
  width: 293px;
  color: var(--c-text-muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 20px;
  text-transform: uppercase;
}

/* ---------- Body blocks ---------- */

.case-body {
  display: flex;
  flex-direction: column;
  gap: 100px;
  margin-top: 120px;
}

.case-image {
  position: relative;
  aspect-ratio: 1240 / 644;
  overflow: hidden;
  background: #ddd;
}
.case-image img,
.case-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}

/* Label in the first column, text from the 7th (x=626 of 1440) */
.case-text {
  display: grid;
  grid-template-columns: 42.42% 49.19%;
  align-items: start;
}
.case-text__label {
  color: var(--c-text-muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 23px;
  text-transform: uppercase;
}
.case-text__body {
  display: flex;
  flex-direction: column;
  /* Figma text boxes are 107px for three 36px lines: 1px less per paragraph */
  gap: 15px;
  margin-bottom: -1px;
  font-size: var(--fs-body-l);
  line-height: 1.5;
}

.case-gallery {
  display: grid;
  gap: var(--gutter);
}
.case-gallery figure {
  overflow: hidden;
  background: #ddd;
}
.case-gallery--2 {
  grid-template-columns: 1fr 1fr;
}
.case-gallery--2 figure {
  aspect-ratio: 610 / 420;
}
.case-gallery--3 {
  grid-template-columns: repeat(3, 1fr);
}
.case-gallery--3 figure {
  aspect-ratio: 400 / 275;
}
/* Two galleries in a row read as one mosaic */
.case-gallery + .case-gallery {
  margin-top: -55px;
}
/* The mockup closes on an image 6px tighter than the other gaps */
.case-text + .case-image {
  margin-top: -6px;
}

/* ---------- Previous / next ---------- */

.case-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 111px;
  margin-bottom: 121px;
  font-size: var(--fs-lead);
  line-height: 60px;
}
.case-nav a {
  transition: color 0.2s;
}
.case-nav a:hover {
  color: var(--c-blue);
}

/* ---------- Provisional small-screen rules (no mobile mockup yet) ---------- */

@media (max-width: 1000px) {
  .case-intro__row {
    flex-direction: column;
  }
  .case-intro__services {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 24px;
    width: auto;
  }
  .case-body {
    gap: 64px;
    margin-top: 64px;
  }
  .case-text {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }
  .case-gallery + .case-gallery {
    margin-top: -44px;
  }
  .case-nav {
    margin-block: 64px;
  }
}

@media (max-width: 760px) {
  .case-gallery--2,
  .case-gallery--3 {
    grid-template-columns: 1fr;
  }
}
