/* ================================================
   case-study.css — Jesse Millard Case Study Template
   ================================================
   Loaded after main.css — reuses all CSS variables,
   buttons, nav, footer, and scroll-animation classes.

   1.  Hero
   2.  Eyebrow / Tags
   3.  Campaign Overview
   4.  Metrics Grid
   5.  Content Sections & Blocks
   6.  Dark Video Panels
   7.  YouTube Embed
   8.  Article Section
   9.  Results Gallery
   10. Final Thoughts
   11. Mobile
   ================================================ */


/* ── 0. Nav visibility over hero video ──────── */
/* Case study pages have a full-viewport hero video — darken the very
   top so the nav text is always readable */

/* ── 1. Hero ─────────────────────────────────── */
.cs-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #07070d;
}

.cs-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.cs-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 7, 13, 0.95) 0%,
    rgba(7, 7, 13, 0.60) 45%,
    rgba(7, 7, 13, 0.25) 100%
  );
  z-index: 1;
}

/* Light mode — white tint matching homepage hero */
[data-theme="light"] .cs-hero-overlay {
  background: linear-gradient(
    to top,
    rgba(243, 243, 251, 0.95) 0%,
    rgba(243, 243, 251, 0.78) 45%,
    rgba(243, 243, 251, 0.50) 100%
  );
}

.cs-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  padding: 140px 2rem 100px;
  margin: 0 auto 0 max(2rem, calc((100vw - 1240px) / 2));
  /* Always animate in on page load — don't rely on IntersectionObserver */
  animation: csHeroFadeIn 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

@keyframes csHeroFadeIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure hero content overrides any data-animate opacity */
.cs-hero-content[data-animate],
.cs-hero-content[data-animate].visible {
  opacity: 1;
  transform: none;
  animation: csHeroFadeIn 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

.cs-hero-title {
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.5rem;
}

[data-theme="light"] .cs-hero-title {
  color: #0d0d1a;
}

.cs-hero-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(232, 232, 242, 0.85);
  max-width: 640px;
  margin-bottom: 2rem;
  text-align: left;
}

[data-theme="light"] .cs-hero-desc {
  color: rgba(13, 13, 26, 0.75);
}

[data-theme="light"] .cs-eyebrow {
  color: var(--accent); /* already uses CSS var — stays orange in both modes */
}

.cs-hero-btn {
  display: inline-flex;
}


/* ── 2. Eyebrow / Tags ───────────────────────── */
.cs-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
  display: block;
}

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.cs-tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(255, 106, 0, 0.25);
}

/* Soft/neutral variant used in overview brand card */
.cs-tag--soft {
  background: var(--border);
  color: var(--text-muted);
  border-color: var(--border-md);
}

/* Hero tags always light */
.cs-hero .cs-tag {
  background: rgba(255, 106, 0, 0.15);
  color: #ff9040;
  border-color: rgba(255, 106, 0, 0.3);
}


/* ── 3. Campaign Overview ────────────────────── */
.cs-overview {
  background: var(--bg);
}

.cs-overview-grid {
  display: grid;
  grid-template-columns: 0.86fr 1fr;
  gap: 3rem;
  align-items: start;
}

.cs-brand-card {
  background: var(--bg);            /* match section bg — no card "lift" */
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cs-brand-card .btn {
  width: 100%;
  justify-content: center;
}

[data-theme="light"] .cs-brand-card {
  background: var(--bg);
  border-color: var(--border);
}

.cs-brand-logo {
  max-height: 140px;
  max-width: 100%;
  width: 100%;
  object-fit: contain;
  /* Dark chip so logo is always visible regardless of theme */
  background: #0f0f18;
  border-radius: var(--radius-sm);
  padding: 1.5rem 2rem;
}

.cs-brand-meta {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.cs-meta-label {
  font-weight: 700;
  color: var(--text);
}

.cs-brand-desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
}


/* ── 4. Metrics Grid ─────────────────────────── */
.cs-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  position: sticky;
  top: 90px; /* clears the navbar — desktop only */
  align-self: start;
}

.cs-metrics-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 2.5rem;
}

.cs-metric-box {
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.cs-metric-box:hover {
  border-color: rgba(255, 106, 0, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 106, 0, 0.08);
}

.cs-metric-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Transparent-bg WebP images: apply orange color filter */
img.cs-metric-icon {
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(50%) sepia(80%) saturate(700%) hue-rotate(355deg) brightness(110%);
}

/* Inline SVG icons: drive color via currentColor */
svg.cs-metric-icon {
  color: var(--accent);
}

.cs-metric-value {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.cs-metric-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}


/* ── 5. Content Sections & Blocks ────────────── */
.cs-section {
  padding: 120px 0;
  background: var(--bg);
}

.cs-content-section {
  padding: 0;
  background: var(--bg);
}

.cs-content-section > .container {
  padding-top: 120px;
  padding-bottom: 80px;
}

/* Two-column content block */
.cs-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 4rem;
}

.cs-block--reversed {
  direction: rtl;
}

.cs-block--reversed > * {
  direction: ltr;
}

.cs-block-media {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cs-block-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-md);
  display: block;
}

.cs-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cs-caption--light {
  color: rgba(232, 232, 242, 0.6);
}

.cs-caption a {
  color: var(--accent);
  text-decoration: underline;
}

.cs-caption-label {
  font-weight: 700;
  color: var(--accent);
}

.cs-block-title {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 1rem;
}

.cs-block-text {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cs-block-text p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* Light text variant (used inside dark panels) */
.cs-block-text--light .cs-block-title {
  color: #fff;
}

.cs-block-text--light p {
  color: rgba(232, 232, 242, 0.82);
}

.cs-block-text--centered {
  text-align: center;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
}

.cs-block-title--large {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

/* Accent links inside body copy */
.accent-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.accent-link:hover {
  color: var(--accent-alt);
}


/* ── 6. Dark Video Panels ────────────────────── */
.cs-dark-panel {
  position: relative;
  overflow: hidden;
  padding: 120px 0;
  background: #07070d;
}

.cs-dark-panel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.55;
}

.cs-dark-panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 13, 0.72);
  z-index: 1;
}

.cs-dark-panel-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  /* container padding */
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Text-only variant (no side-by-side image) */
.cs-dark-panel-inner--text-only {
  grid-template-columns: 1fr;
  max-width: 820px;
}

/* Centered variant for Timeline */
.cs-dark-panel-inner--centered {
  grid-template-columns: 1fr;
  text-align: center;
}

/* Final thoughts variant */
.cs-dark-panel-inner--final {
  grid-template-columns: 1fr;
  max-width: 820px;
}

/* Shorter panel for timeline */
.cs-timeline-panel {
  padding: 160px 0;
}


/* ── 7. YouTube Embed ────────────────────────── */
.cs-video-embed {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-md);
}

.cs-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* ── 8. Article Section ──────────────────────── */
.cs-article-section {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cs-article-text {
  max-width: 760px;
}

.cs-article-text h3 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
}

.cs-article-text p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cs-article-images {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cs-article-img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-md);
  display: block;
  transition: transform 0.3s;
}

.cs-article-img:hover {
  transform: scale(1.02);
}


/* ── 9. Results Gallery ──────────────────────── */
.cs-results-section {
  background: var(--surface);
}

.cs-gallery {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  gap: 1rem;
  margin-top: 2.5rem;
  align-items: start;
}

.cs-gallery-main img,
.cs-gallery-stack img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-md);
}

.cs-gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cs-results-text {
  margin-top: 2rem;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 860px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Reduced top padding for continuation containers after a dark panel */
.cs-continuation {
  padding-top: 60px !important;
}

/* ── Lightbox ────────────────────────────────── */
.cs-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 13, 0.94);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

.cs-lightbox.cs-lightbox--open {
  opacity: 1;
  pointer-events: all;
}

.cs-lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.9);
  transform: scale(0.88);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cs-lightbox--open .cs-lightbox-img {
  transform: scale(1);
}

.cs-lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
}

.cs-lightbox-close:hover {
  background: rgba(255, 106, 0, 0.45);
  border-color: var(--accent);
}

/* Make all gallery/block/article images show zoom cursor */
.cs-block-img,
.cs-gallery-main img,
.cs-gallery-stack img,
.cs-article-img {
  cursor: zoom-in;
}


/* ── 10. Final Thoughts ──────────────────────── */
.cs-final-panel {
  padding: 140px 0;
}

.cs-final-actions {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.cs-signature {
  max-width: 160px;
  opacity: 0.85;
  filter: brightness(1.1);
}


/* ── 11. Mobile ──────────────────────────────── */
@media (max-width: 1024px) {
  .cs-overview-grid {
    grid-template-columns: 1fr;
  }

  /* Remove sticky from both cards on tablet + mobile */
  .cs-brand-card,
  .cs-metrics-grid {
    position: relative;
    top: auto;
  }

  /* Keep 3 columns when overview stacks — stays 3×2 for 6-metric grids */
  .cs-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 860px) {
  .cs-hero-content {
    padding: 120px 1.5rem 80px;
    margin: 0;
  }

  .cs-block {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cs-block--reversed {
    direction: ltr;
  }

  .cs-dark-panel-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

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

  .cs-gallery {
    grid-template-columns: 1fr;
  }

  .cs-gallery-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .cs-dark-panel {
    padding: 80px 0;
  }

  .cs-timeline-panel {
    padding: 100px 0;
  }
}

@media (max-width: 560px) {
  .cs-hero-title {
    font-size: 1.8rem;
  }

  .cs-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cs-metrics-grid--4 {
    grid-template-columns: 1fr 1fr;
  }

  .cs-article-images {
    grid-template-columns: 1fr 1fr;
  }

  .cs-gallery-stack {
    grid-template-columns: 1fr;
  }

  .cs-brand-card {
    padding: 1.5rem;
  }

  .cs-final-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
}


/* ── 12. Extended Components ─────────────────── */

/* AI / brand logo row — small tool credits */
.cs-logo-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.cs-logo-row img {
  height: 14px !important;
  width: auto !important;
  max-width: none !important;
  max-height: 14px !important;
  opacity: 0.5;
  filter: invert(1) brightness(2);
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
}
[data-theme="light"] .cs-logo-row img {
  filter: none;
  opacity: 0.45;
}

/* 3-video side-by-side row (Forme execution section) */
.cs-video-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.cs-video-trio .cs-video {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}

/* Dark-panel content video (inline video on right of 2-col dark panel) */
.cs-dark-panel-content-video {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  position: relative;
  z-index: 2;
}

/* Color swatches (MoreThan brand section) */
.cs-color-swatches {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.cs-swatch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
}
.cs-swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  flex-shrink: 0;
}

/* ROI breakdown card (MoreThan results) */
.cs-roi-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin: 3rem 0;
  padding: 2.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}
.cs-roi-breakdown h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.cs-roi-big {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.cs-roi-big.accent { color: var(--accent); }
.cs-roi-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

@media (max-width: 768px) {
  .cs-video-trio { grid-template-columns: 1fr; }
  .cs-roi-breakdown { grid-template-columns: 1fr 1fr; }
}
