/*
 * case-study.css — Single Case Study Page Styles
 * Loaded only on is_singular('tsd_case_study')
 * Palette: --navy #0D1B4B  --teal #F4521C  --orange #F4521C
 */

/* ═══════════════════════════════════════════════════════════
   1. HERO
═══════════════════════════════════════════════════════════ */
.cs-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #0B2454 60%, #0B2454 100%);
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle diagnostic-grid background texture */
.cs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244,82,28,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,82,28,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.cs-hero .container { position: relative; }

/* Breadcrumb */
.cs-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.cs-breadcrumb a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .2s;
}
.cs-breadcrumb a:hover { color: var(--teal); }
.cs-breadcrumb span.sep { color: rgba(255,255,255,.25); }
.cs-breadcrumb span.current { color: rgba(255,255,255,.7); }

/* Industry badge */
.cs-industry-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(244,82,28,.15);
  border: 1px solid rgba(244,82,28,.4);
  color: var(--teal);
  padding: .3rem 1rem;
  border-radius: 2rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.cs-industry-badge::before {
  content: '📈';
  font-style: normal;
}

/* Title */
.cs-hero__title {
  font-size: clamp(1.75rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 2.25rem;
  max-width: 820px;
}

/* Meta row */
.cs-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.cs-meta-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
}
.cs-meta-value {
  font-size: .95rem;
  color: rgba(255,255,255,.88);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   2. STATS BAR
═══════════════════════════════════════════════════════════ */
.cs-stats-bar {
  background: var(--teal);
  padding: 2.5rem 0;
  position: relative;
  overflow: hidden;
}
.cs-stats-bar::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}

.cs-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.cs-stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(255,255,255,.12);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.2);
  transition: background .25s, transform .25s;
  cursor: default;
}
.cs-stat-card:hover {
  background: rgba(255,255,255,.2);
  transform: translateY(-3px);
}

.cs-stat-value {
  display: block;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.cs-stat-label {
  display: block;
  font-size: .82rem;
  color: rgba(255,255,255,.82);
  margin-top: .4rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   3. TWO-COLUMN BODY
═══════════════════════════════════════════════════════════ */
.cs-body { padding: 4rem 0 3rem; }

.cs-body__inner {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* ═══════════════════════════════════════════════════════════
   4. MAIN CONTENT AREA
═══════════════════════════════════════════════════════════ */
.cs-content h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--navy);
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 3px solid var(--teal);
  line-height: 1.3;
}
.cs-content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}
.cs-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2rem 0 .75rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.cs-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.5rem 0 .5rem;
}
.cs-content p {
  line-height: 1.8;
  color: #374151;
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}
.cs-content ul,
.cs-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.cs-content li {
  line-height: 1.75;
  color: #374151;
  margin-bottom: .5rem;
  font-size: 1.05rem;
}
.cs-content ul li { list-style-type: disc; }
.cs-content ul li::marker { color: var(--teal); }
.cs-content ol li::marker { color: var(--teal); font-weight: 700; }
.cs-content strong { color: var(--navy); }
.cs-content a { color: var(--teal); text-decoration: underline; }
.cs-content a:hover { color: #D93D0D; }

/* Blockquote inside content */
.cs-content blockquote {
  border-left: 4px solid var(--teal);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: rgba(244,82,28,.05);
  border-radius: 0 10px 10px 0;
}
.cs-content blockquote p {
  color: var(--navy) !important;
  font-style: italic;
  font-size: 1.1rem !important;
  margin: 0 !important;
}

/* Pull-stat: large number callouts inside content
   Usage in Gutenberg: add class "cs-pull-stat" to a paragraph */
.cs-pull-stat {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(135deg, #FFF3EE 0%, #FFF3EE 100%);
  border: 1px solid rgba(244,82,28,.25);
  border-radius: 14px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}
.cs-pull-stat__number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  white-space: nowrap;
}
.cs-pull-stat__text {
  font-size: 1rem;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   5. TESTIMONIAL BLOCK
═══════════════════════════════════════════════════════════ */
.cs-testimonial {
  background: linear-gradient(135deg, var(--navy) 0%, #0B2454 100%);
  border-radius: 18px;
  padding: 3rem 2.5rem 2.5rem;
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
}
.cs-testimonial::before {
  content: '\201C';
  font-size: 8rem;
  color: var(--teal);
  opacity: .25;
  position: absolute;
  top: -1rem;
  left: 1.25rem;
  line-height: 1;
  font-family: Georgia, serif;
  pointer-events: none;
}
.cs-testimonial::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(244,82,28,.08);
  pointer-events: none;
}
.cs-testimonial__quote {
  position: relative;
  border: none;
  margin: 0;
  padding: 0;
  background: none;
}
.cs-testimonial__quote p {
  color: rgba(255,255,255,.92) !important;
  font-size: 1.15rem !important;
  font-style: italic;
  line-height: 1.75;
  margin: 0 0 1.5rem !important;
}
.cs-testimonial__author {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.12);
  position: relative;
}
.cs-testimonial__author strong {
  color: #fff;
  font-size: .95rem;
  display: block;
}
.cs-testimonial__author span {
  color: var(--teal);
  font-size: .82rem;
  display: block;
  margin-top: .15rem;
}

/* ═══════════════════════════════════════════════════════════
   6. STICKY SIDEBAR
═══════════════════════════════════════════════════════════ */
.cs-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: none;
}
.cs-sidebar::-webkit-scrollbar { display: none; }

/* ── Results snapshot card ── */
.cs-sidebar-stats {
  background: var(--navy);
  border-radius: 16px;
  padding: 1.5rem;
  color: #fff;
}
.cs-sidebar-stats__head {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.cs-sidebar-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .85rem 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cs-sidebar-stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.cs-sidebar-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--teal);
  white-space: nowrap;
  flex-shrink: 0;
}
.cs-sidebar-stat-lbl {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  text-align: right;
  line-height: 1.4;
}

/* ── Table of Contents ── */
.cs-toc {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}
.cs-toc__head {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.cs-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cs-toc__list li {
  border-bottom: 1px solid #f3f4f6;
}
.cs-toc__list li:last-child { border-bottom: none; }
.cs-toc__link {
  display: block;
  padding: .55rem 0;
  font-size: .86rem;
  color: #6b7280;
  text-decoration: none;
  line-height: 1.45;
  transition: color .2s, padding-left .2s;
}
.cs-toc__link:hover { color: var(--navy); padding-left: .4rem; }
.cs-toc__link--active {
  color: var(--teal) !important;
  font-weight: 600;
  padding-left: .4rem;
}

/* ── Sidebar mini CTA ── */
.cs-sidebar-cta {
  background: linear-gradient(135deg, #FFF3EE 0%, #FFF3EE 100%);
  border: 1px solid rgba(244,82,28,.3);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}
.cs-sidebar-cta__icon {
  font-size: 2rem;
  margin-bottom: .5rem;
  display: block;
}
.cs-sidebar-cta__heading {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 .5rem;
  line-height: 1.35;
}
.cs-sidebar-cta__body {
  font-size: .85rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.cs-sidebar-cta .btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: .9rem;
}

/* ═══════════════════════════════════════════════════════════
   7. BOTTOM CTA STRIP
═══════════════════════════════════════════════════════════ */
.cs-cta-strip {
  background: linear-gradient(135deg, var(--navy) 0%, #0B2454 100%);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}
.cs-cta-strip::before {
  content: '';
  position: absolute;
  left: -100px;
  bottom: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(244,82,28,.07);
  pointer-events: none;
}
.cs-cta-strip::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(244,82,28,.06);
  pointer-events: none;
}
.cs-cta-strip .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.cs-cta-strip__text { max-width: 600px; }
.cs-cta-strip__heading {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  color: #fff;
  font-weight: 800;
  margin: 0 0 .6rem;
  line-height: 1.3;
}
.cs-cta-strip__sub {
  color: rgba(255,255,255,.72);
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   8. RELATED CASE STUDIES
═══════════════════════════════════════════════════════════ */
.cs-related {
  padding: 5rem 0;
  background: #f9fafb;
}
.cs-related__heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 2rem;
  text-align: center;
}
.cs-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}
.cs-related-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.cs-related-card:hover {
  box-shadow: 0 12px 40px rgba(13,27,75,.12);
  transform: translateY(-5px);
  border-color: var(--teal);
}
.cs-related-card__img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--navy);
}
.cs-related-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.cs-related-card:hover .cs-related-card__img img { transform: scale(1.05); }

/* Placeholder image if no thumbnail */
.cs-related-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, #0B2454 100%);
}

.cs-related-card__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.cs-related-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: .5rem 0 .6rem;
  line-height: 1.4;
}
.cs-related-card__excerpt {
  font-size: .88rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
}
.cs-related-card__cta {
  font-size: .88rem;
  color: var(--teal);
  font-weight: 600;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: gap .2s;
}
.cs-related-card:hover .cs-related-card__cta { gap: .6rem; }

/* ═══════════════════════════════════════════════════════════
   9. RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .cs-body__inner {
    grid-template-columns: 1fr 270px;
    gap: 2.5rem;
  }
}

@media (max-width: 1023px) {
  /* Stack sidebar above content on tablet/mobile */
  .cs-body__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .cs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    order: -1; /* sidebar appears above content on mobile */
  }
  /* On tablet, show sidebar items in a 2-col row */
  .cs-sidebar > * { flex: 1 1 calc(50% - .75rem); }
  .cs-sidebar { flex-direction: row; flex-wrap: wrap; display: flex; }
  .cs-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .cs-hero { padding: 3rem 0 2.5rem; }
  .cs-hero__meta { gap: 1.25rem 2rem; }
  .cs-stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .cs-stat-value { font-size: 1.75rem; }
  .cs-cta-strip .container {
    flex-direction: column;
    text-align: center;
  }
  .cs-cta-strip__text { max-width: 100%; }
  .cs-sidebar { flex-direction: column; }
  .cs-sidebar > * { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .cs-stats-grid { grid-template-columns: 1fr; }
  .cs-related-grid { grid-template-columns: 1fr; }
}
