/* ==========================================================================
   Case study pages — extends style.css
   Figma node: CKDwQiOs2CPMtpk2TVeZAG (node 17:400)
   ========================================================================== */

.cs-header {
  border-bottom: 1px solid var(--stroke-default);
  padding: var(--space-5) 143px;
  display: flex;
  justify-content: center;
}

.cs-header-inner {
  max-width: 1004px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cs-eyebrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 20px;
  color: var(--primary-main);
  margin: 0;
}

.cs-tags {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.cs-overview-text {
  font-size: 22px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

/* ---------- Overview / Goals cards ---------- */
.cs-card-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  padding: 0 143px;
  border-bottom: 1px solid var(--stroke-default);
}

.cs-card-col {
  flex: 1;
  min-width: 0;
  padding: var(--space-5) 0;
}

.cs-card-divider {
  width: 1px;
  background: var(--stroke-default);
  flex-shrink: 0;
}

.cs-card {
  border: 1px solid var(--stroke-teal);
  border-radius: var(--space-4);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
}

.cs-card.orange { border-color: var(--stroke-orange); }

.cs-card h3 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-primary);
  margin: 0;
}

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

/* ---------- Full-width hero media ---------- */
.cs-hero-media {
  border-bottom: 1px solid var(--stroke-default);
  background: var(--elevation-1);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-hero-media img {
  width: 100%;
  max-width: 1600px;
  border-radius: var(--space-3);
}

/* ---------- Phase heading ---------- */
.cs-phase-heading {
  border-bottom: 1px solid var(--stroke-default);
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) 143px;
}

.cs-phase-heading h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 32px;
  color: var(--primary-main);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ---------- Full-width text-only section (no image needed) ---------- */
.cs-full-row {
  border-bottom: 1px solid var(--stroke-default);
  padding: var(--space-6) 143px;
  display: flex;
  justify-content: center;
}

.cs-full-row-inner {
  max-width: 760px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cs-full-row-inner h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  color: var(--secondary-main);
  margin: 0;
}

.cs-full-row-inner p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- Alternating text / media rows ---------- */
.cs-alt-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  border-bottom: 1px solid var(--stroke-default);
}

/* Text on the left, media on the right: media bleeds to the edge */
.cs-alt-row.media-right {
  padding: 0 0 0 143px;
}

/* Media on the left, text on the right: media bleeds to the edge */
.cs-alt-row.media-left {
  padding: 0 143px 0 0;
}

.cs-alt-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-6) 0;
}

.cs-alt-copy h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  color: var(--secondary-main);
  margin: 0;
}

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

.cs-alt-media {
  flex: 1;
  min-width: 0;
  background: var(--elevation-1);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-alt-media .media-inner {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border-radius: var(--space-3);
  border: 1px dashed var(--stroke-default);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.cs-alt-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Real screenshots/infographics: show them whole on a white card instead of
   cropping into the frame (most of these have their own white background
   and readable text right up to the edges). */
.cs-alt-media .media-inner.has-image {
  border-style: solid;
  border-color: var(--stroke-default);
  background: #ffffff;
  padding: var(--space-3);
}

.cs-alt-media .media-inner.has-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Responsive video embed (e.g. the prototype walkthrough) */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--space-3);
  overflow: hidden;
}

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

/* Fallback for videos that block embedding (YouTube error 153, etc.):
   a clickable card that opens the video on YouTube in a new tab instead. */
.video-link-card {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border-radius: var(--space-3);
  border: 1px solid var(--stroke-default);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-5);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.video-link-card:hover {
  border-color: var(--stroke-teal);
  background: var(--elevation-1);
}

.video-play-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-main);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-link-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.video-link-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.cs-alt-divider {
  width: 1px;
  background: var(--stroke-default);
  flex-shrink: 0;
}

/* Stat highlight for results row */
.cs-stat-row {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-2);
}

.cs-stat .num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 40px;
  color: var(--primary-main);
  display: block;
  line-height: 1;
}

.cs-stat .label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .cs-header, .cs-card-row, .cs-phase-heading, .cs-alt-row, .cs-full-row { padding-left: 60px; padding-right: 60px; }
}

@media (max-width: 960px) {
  .cs-header, .cs-card-row, .cs-phase-heading, .cs-alt-row, .cs-full-row { padding-left: 24px; padding-right: 24px; }
  .cs-full-row { padding-top: var(--space-5); padding-bottom: var(--space-5); }
  .cs-card-row { flex-direction: column; }
  .cs-card-divider { display: none; }
  .cs-alt-row { flex-direction: column; }
  .cs-alt-row.reverse { flex-direction: column; }
  .cs-alt-divider { display: none; }
  .cs-alt-copy { padding: var(--space-5) 0; }
  .cs-alt-media .media-inner { min-height: 220px; }
  .cs-overview-text { font-size: 18px; }
}
