/* ============================================================================
   Case Studies (Views/Partials/Sections/CaseStudiesSection.cshtml) — retained,
   built live from the case studies list's children; reactive (no fixed
   surface). This file only ever carried this one section's styles and is
   loaded by the partial itself rather than through _Layout.

   Previously: raw hex literals throughout and a heavy green-gradient card
   treatment left over from the pre-Wave-4 design, with manual
   body.dark-mode overrides bolted on. Rebuilt on theme.css semantic tokens
   (which already re-point under body.dark-mode, so the manual overrides are
   gone) to match the same .service-card/.testi-card-derived language as
   .home-blog-card (home.css) so the two retained sections read as siblings.
   .section-header/.section-tag/.section-subtitle above this section are
   styled once, shared with News, in home.css.

   The drag/click-and-drag + arrow-nav carousel (home-carousels.js) already
   works well and is kept as-is — only its visual dressing was out of place.
   Its full-bleed edge-fade treatment (.cs-marquee mask-image) predates the
   rewrite too (this file was untouched by it) and is intentional, matching
   a common "peeking" carousel pattern, so it stays edge-to-edge rather than
   being boxed into the 1440px container like .section-header above it.
   ========================================================================= */
.case-studies {
  padding: clamp(88px, 9vw, 132px) 0;
  background: var(--bg);
}
.cs-carousel { position: relative; margin-top: var(--space-8); }
.cs-marquee {
  position: relative;
  overflow: hidden;
  padding: var(--space-2) 0 var(--space-6);
  cursor: grab;
  touch-action: pan-y;
  /* Alpha-only mask gradient — not a rendered brand colour; "black" instead
     of a hex literal, matching the same convention already used for
     .globe-canvas in home.css. */
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.cs-marquee.cs-grabbing { cursor: grabbing; }
.cs-track { display: flex; width: max-content; user-select: none; will-change: transform; }
.cs-group { display: flex; gap: var(--space-5); padding-right: var(--space-5); }
.cs-card img { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
.cs-card {
  flex: 0 0 320px;
  width: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.cs-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}
.cs-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.cs-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
}
.cs-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.cs-card:hover .cs-card-media img { transform: scale(1.05); }
.cs-card-media .cs-ph { color: var(--fg-muted); font-size: 2.4rem; }
.cs-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-6);
}
.cs-card-body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.cs-card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.cs-card-link i { transition: transform var(--transition-fast); }
.cs-card:hover .cs-card-link i { transform: translateX(4px); }

/* Prev/next arrows mirror .home-blog-nav's construction (home.css) so the
   two retained sections' controls feel like the same component family. */
.cs-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--fg);
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.cs-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-50%) scale(1.08);
}
.cs-arrow:active { transform: translateY(-50%) scale(0.96); }
.cs-arrow:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.cs-arrow-prev { left: 10px; }
.cs-arrow-next { right: 10px; }

@media (max-width: 600px) {
  .cs-arrow { width: 40px; height: 40px; font-size: 0.92rem; }
}
