/* =========================================================================
   Case Studies page  —  /case-studies/
   Ported 1:1 from the design mock. ALL selectors are scoped under .cs-page
   so the global body, universal, and .container resets cannot leak into the
   site header/footer. Enqueued only on the Case Studies page (functions.php).
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

:root {
  --deep:    #23044C;
  --navy:    #262946;
  --coral:   #D90041;
  --coral-2: #FD625E;
  --cream:   #F8F5F0;
  --paper:   #FFFFFF;
  --ink:     #1A1B2E;
  --ink-2:   #4F5167;
  --ink-3:   #8B8D9F;
  --rule:    rgba(26,27,46,0.10);
  --r:       14px;
}

.cs-page *, .cs-page *::before, .cs-page *::after { box-sizing: border-box; }

.cs-page {
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
  width: 100%;
  background: var(--cream);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The post-content wrapper must not re-impose theme width/padding/gap. */
.cs-page .wp-block-post-content {
  max-width: none;
  margin: 0;
  padding: 0;
}
.cs-page .wp-block-post-content > * { margin-top: 0; margin-bottom: 0; }

.cs-page .container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

.cs-page .label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
}
.cs-page .label--coral { color: var(--coral-2); }
.cs-page .label--white { color: rgba(255,255,255,0.5); }

/* ── Hero ─────────────────────────────────────────── */
.cs-page .hero {
  background: var(--deep);
  color: #fff;
  padding: 100px 0 80px;
  position: relative; overflow: hidden;
}
.cs-page .hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% -10%, rgba(253,98,94,0.14), transparent 50%),
    radial-gradient(ellipse at 10% 110%, rgba(38,41,70,0.7), transparent 55%);
  pointer-events: none;
}
.cs-page .hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center;
}
.cs-page .hero__left .label { margin-bottom: 20px; display: block; }
.cs-page .hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(38px, 4.5vw, 58px);
  font-weight: 600; line-height: 1.1;
  letter-spacing: -0.01em; margin: 0 0 24px;
}
.cs-page .hero__title em { font-style: italic; color: var(--coral-2); }
.cs-page .hero__sub {
  font-size: 17px; color: rgba(255,255,255,0.68);
  line-height: 1.65; max-width: 480px; margin: 0;
}
.cs-page .hero__stats {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r); padding: 40px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 36px 24px;
}
.cs-page .stat__num {
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1;
  color: var(--coral-2); margin-bottom: 6px;
}
.cs-page .stat__label { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.4; }

/* Marquee */
.cs-page .hero__marquee-wrap {
  position: relative;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.cs-page .hero__marquee-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-align: center;
  margin: 0 0 28px;
}
.cs-page .hero__marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  margin-bottom: 16px;
}
.cs-page .hero__marquee:last-child { margin-bottom: 0; }
.cs-page .hero__marquee-track {
  display: flex;
  align-items: center;
  gap: 48px;
  width: max-content;
}
.cs-page .hero__marquee-track--left {
  animation: cs-marquee-left 40s linear infinite;
}
.cs-page .hero__marquee-track--right {
  animation: cs-marquee-right 44s linear infinite;
}
@keyframes cs-marquee-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes cs-marquee-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
.cs-page .hero__marquee-track img {
  height: 26px;
  width: auto;
  object-fit: contain;
  opacity: 0.55;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
  transition: opacity .2s;
}
.cs-page .hero__marquee-track img:hover { opacity: 0.85; }
@media (prefers-reduced-motion: reduce) {
  .cs-page .hero__marquee-track { animation: none; }
}

/* ── Topbar ───────────────────────────────────────── */
.cs-page .topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
  position: sticky; top: 0; z-index: 10;
}
.cs-page .topbar__inner {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cs-page .topbar__count { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.cs-page .topbar__count strong { color: var(--ink); }
.cs-page .topbar__cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--coral); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 999px;
  transition: background .2s;
}
.cs-page .topbar__cta:hover { background: var(--coral-2); }

/* ── Case study list ──────────────────────────────── */
.cs-page .studies { padding: 72px 0 100px; }
.cs-page .studies__list { display: flex; flex-direction: column; gap: 24px; }

/* ── Card ─────────────────────────────────────────── */
.cs-page .cs {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r); overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.cs-page .cs:hover {
  border-color: rgba(217,0,65,0.22);
  box-shadow: 0 8px 48px -16px rgba(35,4,76,0.18);
}
.cs-page .cs__inner {
  display: grid;
  grid-template-columns: 400px 1fr;
  min-height: 400px;
}
.cs-page .cs--flip .cs__inner { direction: rtl; }
.cs-page .cs--flip .cs__inner > * { direction: ltr; }

/* ── Stat panel ───────────────────────────────────── */
.cs-page .cs__stat-panel {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 48px 44px;
  background: var(--deep);
}
.cs-page .cs__stat-panel::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; opacity: 0.5;
}
.cs-page .cs__stat-panel::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at var(--gx, 80%) var(--gy, 20%), var(--ga, rgba(253,98,94,0.22)), transparent 65%),
    radial-gradient(ellipse at var(--gx2, 10%) var(--gy2, 90%), var(--gb, rgba(38,41,70,0.5)), transparent 55%);
  pointer-events: none;
}
.cs-page .cs__stat-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  justify-content: space-between; height: 100%;
}
.cs-page .cs__big-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(56px, 6vw, 88px);
  font-weight: 600; line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--coral-2); margin: 0 0 12px;
}
.cs-page .cs__big-label {
  font-size: 15px; color: rgba(255,255,255,0.75);
  line-height: 1.5; max-width: 260px; font-weight: 400;
}
.cs-page .cs__sub-stats {
  display: flex; flex-direction: column;
  gap: 14px; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.cs-page .cs__sub-num {
  font-size: 22px; font-weight: 700;
  color: #fff; letter-spacing: -0.02em;
  line-height: 1; margin-bottom: 4px;
}
.cs-page .cs__sub-label { font-size: 12px; color: rgba(255,255,255,0.5); }

/* Placeholder panel */
.cs-page .cs__stat-panel--placeholder .cs__big-num {
  color: rgba(253,98,94,0.35);
  font-size: clamp(40px, 4vw, 58px);
}
.cs-page .cs__placeholder-note {
  font-size: 12px; color: rgba(255,255,255,0.3);
  border: 1px dashed rgba(253,98,94,0.3);
  border-radius: 6px; padding: 10px 14px;
  line-height: 1.5; margin-top: 16px;
}

/* Logo badge on stat panel */
.cs-page .cs__logo-badge {
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 10px 16px;
  display: inline-flex; align-items: center;
  align-self: flex-start;
}
.cs-page .cs__logo-badge img {
  height: 22px; width: auto; object-fit: contain;
  filter: brightness(0) invert(1); opacity: 0.9;
}

/* Video/audio pill button */
.cs-page .cs__video-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 999px; color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 16px 9px 9px;
  cursor: pointer; align-self: flex-start;
  transition: background .2s, border-color .2s;
  position: relative; z-index: 2;
  white-space: nowrap;
}
.cs-page .cs__video-btn:hover { background: var(--coral); border-color: var(--coral); }
.cs-page .cs__video-btn__icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--coral);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s;
}
.cs-page .cs__video-btn:hover .cs__video-btn__icon { background: rgba(255,255,255,0.22); }
.cs-page .cs__video-btn__icon svg { fill: #fff; width: 12px; height: 12px; }

/* ── Content panel ────────────────────────────────── */
.cs-page .cs__content {
  padding: 48px 52px;
  display: flex; flex-direction: column;
  justify-content: space-between; gap: 28px;
}

/* Client logo on content side */
.cs-page .cs__client-logo {
  height: 28px; width: auto;
  object-fit: contain; object-position: left center;
  max-width: 140px;
  display: block; margin-bottom: 16px;
}

.cs-page .cs__industry {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--coral-2); margin-bottom: 14px; display: block;
}
.cs-page .cs__outcome {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600; line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 16px;
}
.cs-page .cs__outcome mark,
.cs-page .cs__outcome strong,
.cs-page .cs__outcome b { background: none; color: var(--coral); font-weight: inherit; }
.cs-page .cs__desc {
  font-size: 14.5px; color: var(--ink-2);
  line-height: 1.7; margin: 0;
}

/* Quote block */
.cs-page .cs__quote-block {
  border-left: 3px solid var(--coral);
  padding-left: 20px;
}
.cs-page .cs__quote {
  font-size: 15px; font-style: italic; font-weight: 500;
  color: var(--ink); line-height: 1.6; margin: 0 0 14px;
}
.cs-page .cs__attr { display: flex; align-items: center; gap: 10px; }
.cs-page .cs__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; background: var(--deep);
}
.cs-page .cs__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cs-page .cs__avatar--initials {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--coral), #b5003a);
}
.cs-page .cs__attr-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cs-page .cs__attr-role { font-size: 12px; color: var(--ink-3); }

/* CTA row */
.cs-page .cs__cta-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.cs-page .cs__tag {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-3); background: var(--cream);
  padding: 5px 10px; border-radius: 4px;
}
.cs-page .cs__link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
  color: #fff; background: var(--ink);
  text-decoration: none;
  padding: 11px 22px; border-radius: 999px;
  white-space: nowrap;
  transition: background .2s, transform .2s;
}
.cs-page .cs__link:hover { background: var(--coral); transform: translateY(-1px); }
.cs-page .cs__link svg { width: 13px; height: 13px; transition: transform .2s; }
.cs-page .cs__link:hover svg { transform: translate(2px,-2px); }

/* Missing testimonial note */
.cs-page .cs__no-testimonial {
  font-size: 13.5px; color: var(--ink-3);
  padding: 14px 16px;
  background: var(--cream); border-radius: 8px;
}

/* ── Testimonial strip ────────────────────────────── */
.cs-page .strip {
  background: var(--deep);
  padding: 96px 0 104px;
  position: relative; overflow: hidden;
}
.cs-page .strip::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(253,98,94,0.10), transparent 50%),
    radial-gradient(ellipse at 85% 10%, rgba(38,41,70,0.6), transparent 55%);
  pointer-events: none;
}

/* Eyebrow label */
.cs-page .strip .label { display: block; margin-bottom: 72px; }

/* Featured quote - full width, large */
.cs-page .strip__featured {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 0 40px;
  align-items: start;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 56px;
}
.cs-page .strip__featured__rule {
  background: var(--coral);
  height: 100%;
  min-height: 80px;
  border-radius: 2px;
}
.cs-page .strip__featured__body {}
.cs-page .strip__featured__quote {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(22px, 2.8vw, 34px);
  font-weight: 600;
  font-style: italic;
  color: #fff;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 32px;
  max-width: 860px;
}
.cs-page .strip__featured__attr { display: flex; align-items: center; gap: 14px; }
.cs-page .strip__featured__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}
.cs-page .strip__featured__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cs-page .strip__featured__name { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3; }
.cs-page .strip__featured__role { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* Two secondary quotes side by side */
.cs-page .strip__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.cs-page .strip__item {
  padding-left: 20px;
  border-left: 2px solid rgba(253,98,94,0.45);
}
.cs-page .strip__quote {
  font-size: 15px; font-weight: 500;
  font-style: italic;
  color: rgba(255,255,255,0.82);
  line-height: 1.65; margin: 0 0 24px;
}
.cs-page .strip__attr { display: flex; align-items: center; gap: 10px; }
.cs-page .strip__avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.cs-page .strip__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cs-page .strip__name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; }
.cs-page .strip__role { font-size: 12px; color: rgba(255,255,255,0.45); }

@media (max-width: 768px) {
  .cs-page .strip__featured { grid-template-columns: 3px 1fr; gap: 0 24px; }
  .cs-page .strip__pair { grid-template-columns: 1fr; gap: 36px; }
}

/* ── Modal ────────────────────────────────────────── */
.cs-page .modal {
  display: none; position: fixed; inset: 0;
  background: rgba(10,11,24,0.88);
  backdrop-filter: blur(10px);
  z-index: 100; align-items: center; justify-content: center;
  padding: 24px;
}
.cs-page .modal.is-open { display: flex; }
.cs-page .modal__panel {
  background: var(--paper); border-radius: 16px;
  max-width: 820px; width: 100%;
  overflow: hidden; position: relative;
  animation: cs-slideUp .3s ease;
}
@keyframes cs-slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cs-page .modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.12);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5; transition: background .2s;
}
.cs-page .modal__close:hover { background: rgba(255,255,255,0.22); }
.cs-page .modal__close svg { width: 13px; height: 13px; stroke: #fff; fill: none; stroke-width: 1.5; stroke-linecap: round; }

/* Video media area */
.cs-page .modal__video { aspect-ratio: 16/9; background: var(--deep); width: 100%; }
.cs-page .modal__video video { width: 100%; height: 100%; display: block; }

/* Audio stage - xGrowth style */
.cs-page .modal__audio-stage {
  background: var(--deep);
  padding: 40px 44px 36px;
  position: relative;
  overflow: hidden;
}
.cs-page .modal__audio-stage::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(253,98,94,0.14), transparent 55%);
  pointer-events: none;
}
.cs-page .modal__audio-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 24px; display: block;
}
.cs-page .modal__audio-control {
  display: flex; align-items: center; gap: 20px;
  position: relative; z-index: 1;
}
.cs-page .modal__audio-play {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--coral); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(217,0,65,0.4);
  transition: background .2s, transform .15s;
}
.cs-page .modal__audio-play:hover { background: var(--coral-2); transform: scale(1.06); }
.cs-page .modal__audio-play svg { fill: #fff; width: 18px; height: 18px; }
.cs-page .modal__audio-play .icon-pause { display: none; }
.cs-page .modal__audio-play.is-playing .icon-play { display: none; }
.cs-page .modal__audio-play.is-playing .icon-pause { display: block; }
.cs-page .modal__audio-track { flex: 1; min-width: 0; }
.cs-page .modal__audio-meta {
  display: flex; justify-content: space-between;
  margin-bottom: 10px;
}
.cs-page .modal__audio-title {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 70%;
}
.cs-page .modal__audio-time { font-size: 12px; color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums; }
.cs-page .modal__waveform {
  height: 40px; display: flex; align-items: center; gap: 2px;
  cursor: pointer; position: relative;
}
.cs-page .modal__waveform-bar {
  flex: 1; border-radius: 1px;
  background: rgba(255,255,255,0.18);
  transition: background .1s;
  min-height: 3px;
}
.cs-page .modal__waveform-bar.played { background: var(--coral-2); }
.cs-page .modal__waveform:hover .modal__waveform-bar { background: rgba(255,255,255,0.28); }
.cs-page .modal__waveform:hover .modal__waveform-bar.played { background: #ff8a87; }

/* Shared body (quote + attribution) */
.cs-page .modal__body { padding: 28px 32px 32px; }
.cs-page .modal__quote {
  font-size: 17px; font-style: italic; font-weight: 500;
  color: var(--ink); line-height: 1.55;
  margin: 0 0 20px; padding-left: 18px;
  border-left: 3px solid var(--coral);
}
.cs-page .modal__attr { display: flex; align-items: center; gap: 12px; }
.cs-page .modal__avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.cs-page .modal__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cs-page .modal__name { font-size: 14px; font-weight: 600; color: var(--ink); }
.cs-page .modal__role { font-size: 13px; color: var(--ink-3); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
  .cs-page .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .cs-page .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .cs-page .cs__inner { grid-template-columns: 1fr; }
  .cs-page .cs--flip .cs__inner { direction: ltr; }
  .cs-page .cs__stat-panel { min-height: 260px; padding: 40px; }
  .cs-page .cs__content { padding: 36px; }
  .cs-page .strip__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .cs-page .hero { padding: 72px 0 56px; }
  .cs-page .cs__content { padding: 28px 24px; }
  .cs-page .cs__stat-panel { padding: 32px 28px; }
  .cs-page .strip__grid { grid-template-columns: 1fr; }
  .cs-page .container { padding: 0 20px; }
}
@media (max-width: 480px) {
  .cs-page .cs__cta-row { flex-direction: column; align-items: flex-start; }
}

/* ── Page-specific override ───────────────────────────
   This stylesheet only loads on the Case Studies page, so disabling the
   global sticky site header here affects this page only. (The in-page
   .topbar keeps its own sticky behaviour by design.) */
header.wp-block-template-part { position: static !important; top: auto !important; }
