/* ===== CASE STUDIES (/case-studies/ overview + /case-studies/<slug>/ detail) ===== */

.cs-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.cs-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-orange);
  margin-bottom: 12px;
}

.cs-h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.cs-lead {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  max-width: 620px;
  margin: 0;
}

/* Theme-aware client logos */
.cs-logo-light { display: none; }
[data-theme="light"] .cs-logo-dark { display: none; }
[data-theme="light"] .cs-logo-light { display: block; }

/* ---------- Overview hero ---------- */

.cases-page-hero {
  padding-bottom: 72px;
}

.cases-page-hero .header-content-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

.cases-page-hero .page-title {
  font-size: clamp(40px, 6vw, 76px);
  margin: 20px 0 16px;
  line-height: 0.95;
}

.cases-page-intro {
  color: var(--text-secondary);
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto;
}

/* ---------- Impact band ---------- */

.cs-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-large);
  background: var(--bg-card);
  overflow: hidden;
}

.cs-impact-stat {
  padding: 36px 28px 32px;
  border-right: 1px solid var(--border-color);
}

.cs-impact-stat:last-child {
  border-right: none;
}

.cs-impact-val {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(40px, 4.6vw, 68px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--color-orange);
  white-space: nowrap;
  margin-bottom: 14px;
}

.cs-impact-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ---------- Case tiles (overview) ---------- */

.cs-cases {
  padding: 72px 0 40px;
}

.cs-cases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.cs-tile {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  color: inherit;
  transition: var(--transition-smooth);
}

.cs-tile:hover {
  border-color: rgba(252, 80, 0, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px var(--color-orange-glow);
}

.cs-tile-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background:
    radial-gradient(circle at 50% 55%, var(--brand-glow, var(--color-orange-glow)) 0%, transparent 65%),
    var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

.cs-tile-visual img {
  width: auto;
  height: 120px;
  max-width: 70%;
  object-fit: contain;
}

/* Logos with dark artwork sit on a light plate so they read on the dark theme */
.cs-logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.cs-tile-visual .cs-logo-plate img {
  height: 84px;
  max-width: none;
}

.cs-detail-logo .cs-logo-plate {
  width: 78%;
}

.cs-detail-logo .cs-logo-plate img {
  width: 100%;
  height: auto;
}

.cs-tile-body {
  display: flex;
  flex-direction: column;
  padding: 36px 40px 32px;
}

/* The results lead: numbers are the primary read of each case */
.cs-tile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.cs-tile-metric strong {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(40px, 4.6vw, 68px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--color-orange);
  white-space: nowrap;
  margin-bottom: 10px;
}

.cs-tile-metric span {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.cs-tile-title {
  font-family: var(--font-body);
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.cs-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Industry / market tags are secondary context on the overview */
.cs-tile .cs-chips {
  margin: 0;
  gap: 6px 0;
}

.cs-tile .cs-chips span + span::before {
  content: "·";
  margin: 0 10px;
}

.cs-tile .cs-chips span,
.cs-tile .cs-chips .cs-chip-accent {
  padding: 0;
  border: none;
  background: none;
  font-size: 11px;
  color: var(--text-muted);
}

.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.cs-chips span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
}

.cs-chips .cs-chip-accent {
  color: var(--color-orange);
  border-color: rgba(252, 80, 0, 0.35);
  background: var(--color-orange-light);
}

.cs-tile-cta {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.cs-tile:hover .cs-tile-cta {
  color: var(--color-orange);
}

/* ---------- Detail page hero ---------- */

.cs-detail-hero {
  padding: 150px 0 56px;
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(ellipse at 50% 0%, var(--bg-secondary) 0%, var(--bg-primary) 70%);
}

.cs-back {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.cs-back:hover {
  color: var(--color-orange);
}

.cs-detail-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 48px;
  align-items: center;
}

.cs-detail-hero .page-title {
  font-size: clamp(38px, 5.4vw, 70px);
  line-height: 0.95;
  margin: 0 0 20px;
}

.cs-detail-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  max-width: 320px;
  width: 100%;
  justify-self: end;
  border-radius: var(--border-radius-large);
  border: 1px solid var(--border-color);
  background:
    radial-gradient(circle at 50% 55%, var(--brand-glow, var(--color-orange-glow)) 0%, transparent 65%),
    var(--bg-card);
}

.cs-detail-logo img {
  width: 72%;
  height: auto;
}

/* ---------- KPI band ---------- */

.cs-kpis {
  padding: 48px 0 0;
}

/* ---------- Detail layout ---------- */

.cs-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  padding: 72px 0 40px;
}

.cs-aside {
  position: sticky;
  top: 110px;
  align-self: start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-medium);
  padding: 24px;
}

.cs-aside dl {
  margin: 0;
  display: grid;
  gap: 18px;
}

.cs-aside dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cs-aside dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.cs-aside a {
  color: var(--color-orange);
}

.cs-article {
  min-width: 0;
}

.cs-block {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border-color);
}

.cs-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cs-block h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.02;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.cs-block h3 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 28px 0 10px;
}

.cs-block p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 16px;
}

.cs-block p:last-child {
  margin-bottom: 0;
}

.cs-block strong {
  color: var(--text-primary);
}

.cs-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.cs-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.cs-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-orange);
}

.cs-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 20px;
}

.cs-pillar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-medium);
  padding: 20px 22px;
}

.cs-pillar h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.cs-pillar p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* Before / after table */
.cs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-medium);
  margin: 8px 0 20px;
}

.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}

.cs-table th,
.cs-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.cs-table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card);
}

.cs-table tbody tr:last-child td {
  border-bottom: none;
}

.cs-table td {
  color: var(--text-secondary);
}

.cs-table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

.cs-table td:last-child {
  color: var(--color-orange);
  font-weight: 700;
}

/* Timeline */
.cs-timeline {
  list-style: none;
  margin: 8px 0 20px;
  padding: 0;
  display: grid;
  gap: 0;
}

.cs-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
}

.cs-timeline li:last-child {
  border-bottom: none;
}

.cs-timeline-when {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-orange);
  padding-top: 3px;
}

.cs-timeline-what {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}

/* Testimonial */
.cs-quote {
  margin: 0;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-medium);
  background-image: radial-gradient(ellipse at 0% 0%, var(--color-orange-glow) 0%, transparent 55%);
}

.cs-quote p {
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 16px;
}

.cs-quote footer {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  border: none;
  padding: 0;
  background: none;
}

.cs-quote footer strong {
  color: var(--text-primary);
}

/* Next case */
.cs-next {
  padding: 24px 0 40px;
}

.cs-next-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-large);
  color: inherit;
  transition: var(--transition-smooth);
}

.cs-next-link:hover {
  border-color: rgba(252, 80, 0, 0.45);
}

.cs-next-title {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.05;
  color: var(--text-primary);
}

.cs-next-arrow {
  font-size: 32px;
  color: var(--color-orange);
  flex-shrink: 0;
}

/* CTA */
.cs-cta .hero-actions {
  margin-top: 8px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .cs-impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-impact-stat:nth-child(2) {
    border-right: none;
  }

  .cs-impact-stat:nth-child(-n+2) {
    border-bottom: 1px solid var(--border-color);
  }

  .cs-detail {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cs-aside {
    position: static;
  }

  .cs-aside dl {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .cs-tile {
    grid-template-columns: 1fr;
  }

  .cs-tile-visual {
    min-height: 170px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .cs-detail-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .cs-detail-logo {
    justify-self: start;
    max-width: 200px;
  }
}

@media (max-width: 600px) {
  .cs-impact-grid {
    grid-template-columns: 1fr;
  }

  .cs-impact-stat {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 28px 24px;
  }

  .cs-impact-stat:last-child {
    border-bottom: none;
  }

  .cs-tile-body {
    padding: 24px;
  }

  .cs-tile-metrics {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cs-tile-metric {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: baseline;
    gap: 12px;
  }

  .cs-tile-metric strong {
    font-size: 36px;
    margin: 0;
  }

  .cs-tile-foot {
    flex-direction: column;
    align-items: flex-start;
  }



  .cs-pillars,
  .cs-aside dl {
    grid-template-columns: 1fr;
  }

  .cs-timeline li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cs-quote {
    padding: 28px 24px;
  }

  .cs-next-link {
    padding: 24px;
  }
}

/* Solid titles on case-study pages (no gradient fade) */
[data-theme] .cases-page-hero .page-title,
[data-theme] .cs-detail-hero .page-title {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text-primary);
}
