/* ===================================================
   CASE STUDY PAGE STYLES
   Extends the main portfolio design system
   =================================================== */

/* ========================================
   CASE STUDY HERO
   ======================================== */
.cs-hero-section {
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 60px;
}

.min-vh-75 {
  min-height: 75vh;
}

.cs-hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cs-hero-bg-shapes .shape-1 {
  width: 500px;
  height: 500px;
  background: var(--color-hero-shape1);
  top: -150px;
  right: -150px;
  border-radius: 50%;
  position: absolute;
}

.cs-hero-bg-shapes .shape-2 {
  width: 350px;
  height: 350px;
  background: var(--color-hero-shape2);
  bottom: -80px;
  left: -80px;
  border-radius: 50%;
  position: absolute;
}

.cs-hero-content {
  position: relative;
  z-index: 2;
}

.cs-back-link {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 20px;
  transition: all var(--transition-fast);
}

.cs-back-link:hover {
  color: var(--color-primary);
  transform: translateX(-4px);
}

.cs-hero-title {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.cs-hero-desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 520px;
  margin-bottom: 32px;
}

/* Project Meta Grid */
.cs-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.cs-meta-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: all var(--transition-fast);
}

.cs-meta-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px var(--color-shadow);
}

.cs-meta-label {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.cs-meta-value {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Hero Image */
.cs-hero-visual {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cs-hero-img-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 64px var(--color-shadow-lg);
  border: 1px solid var(--color-border);
}

.cs-hero-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   SHARED SECTION STYLES
   ======================================== */
.cs-section {
  background: var(--color-bg);
}

.cs-section-alt {
  background: var(--color-bg-alt);
}

/* Content Card */
.cs-content-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  transition: all var(--transition-base);
}

.cs-content-card:hover {
  box-shadow: 0 12px 40px var(--color-shadow);
}

.cs-lead-text {
  font-family: var(--font-primary);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: 16px;
}

.cs-content-card p {
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

/* Highlight Box */
.cs-highlight-box {
  background: var(--color-primary-bg);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-top: 28px;
}

.cs-highlight-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
}

.cs-highlight-box h4 {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.cs-highlight-box p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0;
  line-height: 1.5;
}

/* ========================================
   THE CHALLENGE
   ======================================== */
.cs-challenge-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  height: 100%;
  transition: all var(--transition-base);
}

.cs-challenge-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px var(--color-shadow-lg);
  border-color: var(--color-primary);
}

.cs-challenge-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.cs-challenge-item h4 {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.cs-challenge-item p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ========================================
   PROJECT GOALS
   ======================================== */
.cs-goals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cs-goal-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.cs-goal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 50px var(--color-shadow-lg);
  border-color: var(--color-primary);
}

.cs-goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gradient-start), var(--color-gradient-end));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.cs-goal-card:hover::before {
  opacity: 1;
}

.cs-goal-number {
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}

.cs-goal-card h4 {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}

.cs-goal-card p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ========================================
   DESIGN PROCESS TIMELINE
   ======================================== */
.cs-process-timeline {
  position: relative;
  padding: 20px 0;
}

.cs-process-line {
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-timeline-line);
}

.cs-process-step {
  position: relative;
  padding-left: 72px;
  padding-bottom: 36px;
}

.cs-process-step:last-child {
  padding-bottom: 0;
}

.cs-process-dot {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  border: 3px solid var(--color-primary);
  z-index: 1;
  transition: all var(--transition-fast);
}

.cs-process-step:hover .cs-process-dot {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-bg);
}

.cs-process-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 28px 80px;
  position: relative;
  transition: all var(--transition-base);
}

.cs-process-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 30px var(--color-shadow);
  transform: translateX(4px);
}

.cs-process-icon {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}

.cs-process-num {
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
}

.cs-process-card h4 {
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.cs-process-card p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ========================================
   FINAL OUTCOME
   ======================================== */
.cs-outcome-showcase {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  transition: all var(--transition-base);
}

.cs-outcome-showcase:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 50px var(--color-shadow-lg);
  border-color: var(--color-primary);
}

.cs-outcome-img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-outcome-label {
  padding: 14px 20px;
  font-family: var(--font-primary);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}

/* ========================================
   RESULTS / IMPACT
   ======================================== */
.cs-impact-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  transition: all var(--transition-base);
  height: 100%;
}

.cs-impact-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 50px var(--color-shadow-lg);
  border-color: var(--color-primary);
}

.cs-impact-number {
  display: block;
  font-family: var(--font-primary);
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 10px;
}

.cs-impact-label {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* Result Items */
.cs-result-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.cs-result-item:last-child {
  margin-bottom: 0;
}

.cs-result-item > i {
  flex-shrink: 0;
  font-size: 1.3rem;
  color: var(--color-primary);
  margin-top: 2px;
}

.cs-result-item h4 {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.cs-result-item p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ========================================
   NEXT CASE STUDY CTA
   ======================================== */
.cs-next-section {
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  position: relative;
  overflow: hidden;
}

.cs-next-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.cs-next-section .section-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.cs-next-section .section-title {
  color: #fff;
}

.cs-next-section .section-desc {
  color: rgba(255, 255, 255, 0.85);
}

.cs-next-section .btn-cta {
  background: #fff;
  color: var(--color-primary);
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cs-next-section .btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================
   RESPONSIVE — CASE STUDY
   ======================================== */
@media (max-width: 991.98px) {
  .cs-hero-section {
    padding-top: calc(var(--nav-height) + 40px);
  }

  .cs-hero-content {
    text-align: center;
    margin-bottom: 40px;
  }

  .cs-hero-desc {
    margin-inline: auto;
  }

  .cs-meta-grid {
    max-width: 400px;
    margin-inline: auto;
  }

  .cs-back-link {
    justify-content: center;
  }

  .cs-goals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-content-card {
    padding: 28px;
  }
}

@media (max-width: 767.98px) {
  .cs-goals-grid {
    grid-template-columns: 1fr;
  }

  .cs-meta-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .cs-process-step {
    padding-left: 56px;
  }

  .cs-process-line {
    left: 22px;
  }

  .cs-process-dot {
    left: 14px;
  }

  .cs-process-card {
    padding: 20px 20px 20px 68px;
  }

  .cs-process-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    left: 16px;
    top: 16px;
  }

  .cs-content-card {
    padding: 20px;
  }

  .cs-highlight-box {
    padding: 24px 20px;
  }

  .cs-impact-number {
    font-size: 1.8rem;
  }
}

@media (max-width: 575.98px) {
  .cs-hero-title {
    font-size: 1.8rem;
  }

  .cs-hero-section {
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 40px;
  }

  .cs-goal-card {
    padding: 24px 20px;
  }

  .cs-impact-card {
    padding: 24px 16px;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .cs-hero-bg-shapes,
  .cs-next-section {
    display: none !important;
  }

  .cs-hero-section {
    padding-top: 20px;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cs-back-link:hover {
    transform: none;
  }

  .cs-challenge-item:hover,
  .cs-goal-card:hover,
  .cs-outcome-showcase:hover,
  .cs-impact-card:hover,
  .cs-process-card:hover {
    transform: none;
  }
}
