/* ═══════════════════════════════════════════════════════
   CASE STUDY (PROJECT DETAIL) PAGE — Shared Template Styles
   Reused across individual project pages (e.g. Gold Fields).
   ═══════════════════════════════════════════════════════ */

/* ── 1. Hero ───────────────────────────────────────── */
.cs-hero {
  position: relative;
  height: 70vh;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.cs-hero__bg {
  position: absolute;
  inset: 0;
}

.cs-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(35, 31, 32, 0.15) 0%, rgba(35, 31, 32, 0.65) 100%);
}

.cs-hero__content {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(2rem, 4.1vw, 2.87rem);
}

.cs-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 4.5vw, 5rem);     /* 16 Sept: matched to Case Study Page.png: ~62px at 1366 */
  font-weight: 400;          /* 10 Sept review: capitals, Montserrat Regular, left */
  text-transform: uppercase;
  text-align: left;
  color: #fff;
  line-height: 1.08;
}

/* 10 Sept review: title "left aligned". .cs-hero is display:flex, so the
   .container inside it shrank to the text and its auto margins centred it.
   Stretching it to full width puts the title on the page's left gutter. */
.cs-hero__content {
  width: 100%;
}

/* ── 2. Summary: accordion sidebar + meta + copy ───── */
/* 16 Sept: matched to Case Study Page.png: the summary and gallery sit on the light off-white. */
.cs-summary,
.cs-gallery {
  background: var(--color-surface-light);
}

.cs-summary {
  padding-top: clamp(2.5rem, 4.1vw, 2.87rem);
}

.cs-summary__back {
  display: inline-block;
  font-size: 0.9225rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-copper);
  margin-bottom: 2rem;
  transition: opacity 0.3s ease;
}

.cs-summary__back:hover {
  opacity: 0.7;
}

.cs-summary__grid {
  display: grid;
  grid-template-columns: 40% 1fr;
  column-gap: 12%;
  align-items: start;
}

/* 16 Sept: matched to Case Study Page.png and 10 Sept review ("this needs to have a black background"): the
   What we did / Testimonial / Awards accordion is a charcoal box with small
   white titles, white rules and white icons. */
.cs-accordion {
  background: var(--color-dark);
  padding: 0.4rem 1.9rem 1rem;
}

.cs-accordion .faq__item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.cs-accordion .faq__question {
  padding-top: 1.3rem;
  padding-bottom: 0.9rem;
}

.cs-accordion .faq__question-text {
  font-family: var(--font-serif);
  font-size: 0.93rem;
  font-weight: 600;
  color: #fff;
}

.cs-accordion .faq__icon { width: 14px; height: 14px; }

.cs-accordion .faq__icon::before,
.cs-accordion .faq__icon::after {
  background: #fff;
}

.cs-accordion .faq__icon::before { height: 2px; }
.cs-accordion .faq__icon::after { width: 2px; }

.cs-accordion .faq__answer p {
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: none;
}

.cs-accordion .faq__answer {
  max-height: 0;
}

.cs-accordion .faq__item.active .faq__answer {
  max-height: 420px;
}

/* 16 Sept: matched to Case Study Page.png: meta runs as a compact row straight into the copy, no rule */
.cs-summary__meta {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  column-gap: 1.8rem;
  row-gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.cs-summary__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cs-summary__meta-label {
  font-size: 0.9225rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  line-height: 1.5;
}

.cs-summary__meta-value {
  font-size: 0.984rem;
  font-weight: 600;
  color: var(--color-text);
}
.cs-summary__text {
  font-size: 0.984rem;
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  max-width: 640px;
}

.cs-summary__readmore {
  margin-top: 1rem;
  /* 16 Sept: matched to Case Study Page.png: a charcoal outline button, not solid copper */
  background: transparent;
  border-color: var(--color-dark);
  color: var(--color-dark);
}

/* Collapsed summary: main.js wraps the paragraphs in .cs-summary__more and
   Read More drops the rest down (10 Sept review: fade the last few lines).
   Without JS the class never appears and the full text shows. */
.cs-summary__more {
  overflow: hidden;
  transition: max-height 0.6s var(--ease-out);
}

.cs-summary__more.is-collapsed {
  max-height: 21rem;          /* 16 Sept: mockup shows ~3 paragraphs, the last fading */
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}

@media (prefers-reduced-motion: reduce) {
  .cs-summary__more { transition: none; }
}

/* ── 3. Gallery ────────────────────────────────────── */
/* 16 Sept: matched to Case Study Page.png: a wider gallery (~50px gutters at 1366) with 24px gaps; paired
   images are tall portraits, full-width images a wide 20:9. */
.cs-gallery {
  padding: clamp(2rem, 3.28vw, 2.46rem) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.76vw, 1.7rem);
}

.cs-gallery__row {
  padding: 0 clamp(20px, 3.66vw, 50px);
}

.cs-gallery__row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.75rem, 1.76vw, 1.7rem);
}

.cs-gallery__img {
  overflow: hidden;
  border-radius: 0;
  aspect-ratio: 310/360;
}

.cs-gallery__img--full {
  aspect-ratio: 20/9;
}

.cs-gallery__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
  .cs-summary__grid {
    grid-template-columns: 1fr;
    /* 26 Sept: the base rule sets only a column-gap, so once the grid collapsed to a
       single column the charcoal accordion sat flush against the meta block below it. */
    row-gap: 2.25rem;
  }

  .cs-summary__meta {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .cs-hero {
    height: 55vh;
    min-height: 360px;
  }

  /* Expertise and Size pair up, but Location was left orphaned in a half-width
     column where "Johannesburg, South Africa" broke across two lines. */
  .cs-summary__meta-item:nth-child(3) {
    grid-column: 1 / -1;
  }

  .cs-gallery__row--split {
    grid-template-columns: 1fr;
  }

  .cs-gallery__img--full {
    aspect-ratio: 4/3;
  }
}

/* ── CMS project template ──────────────────────────── */
/* The 31 CMS projects fill in different subsets of these fields, so anything Webflow marks as an
   empty binding takes its label and its row with it rather than leaving a blank gap. None of these
   classes appear on the hand-coded page, so it is unaffected. */
.cs-summary__meta-item:has(.cs-summary__meta-value.w-dyn-bind-empty),
.cs-accordion .faq__item:has(.faq__answer .w-dyn-bind-empty),
.cs-summary__text.w-dyn-bind-empty,
.cs-gallery__img:has(img.w-dyn-bind-empty) {
  display: none;
}

/* A gallery row with nothing left in it, and the gallery itself once every row has gone. */
.cs-gallery__row:not(:has(img:not(.w-dyn-bind-empty))),
.cs-gallery:not(:has(img:not(.w-dyn-bind-empty))) {
  display: none;
}

/* Half the projects have no hero photograph yet; the band keeps the charcoal ground so the
   project name still reads. */
.cs-hero {
  background: var(--color-dark);
}

.cs-hero__bg img.w-dyn-bind-empty {
  display: none;
}

/* The Project Summary and the accordion answers are rich text fields, and Webflow renders
   rich-text headings in the inherited body face. Put them back on the site's heading face so
   the lead statement reads as a heading, with Marcellus left to the body copy. */
.cs-summary__text h1,
.cs-summary__text h2,
.cs-summary__text h3,
.cs-summary__text h4,
.cs-summary__text h5,
.cs-summary__text h6,
.cs-accordion .faq__answer h1,
.cs-accordion .faq__answer h2,
.cs-accordion .faq__answer h3,
.cs-accordion .faq__answer h4,
.cs-accordion .faq__answer h5,
.cs-accordion .faq__answer h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.32;
  margin-bottom: 0.9rem;
}

.cs-summary__text h1,
.cs-summary__text h2 {
  font-size: 1.15rem;
  color: var(--color-text);
}

.cs-summary__text h3,
.cs-summary__text h4,
.cs-summary__text h5,
.cs-summary__text h6 {
  font-size: 1.02rem;
  color: var(--color-text);
}

.cs-accordion .faq__answer h1,
.cs-accordion .faq__answer h2,
.cs-accordion .faq__answer h3,
.cs-accordion .faq__answer h4,
.cs-accordion .faq__answer h5,
.cs-accordion .faq__answer h6 {
  font-size: 0.93rem;
  color: #fff;
}

/* 28 Sept: Read More now hides only the tail of the copy. The gallery used to
   be held back with it (25 Sept review), but on a phone the summary always
   overflows, so every project page opened with no photographs on it. The
   .is-held / .is-released rules and their keyframes have been removed. */
/* 25 Sept: the back link was 21px tall on a phone — under the 44px minimum
   for a touch target. */
@media (max-width: 768px) {
  .cs-summary__back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
