/**
 * Case Study Page Styles - Exact match to design
 */

/* =========================================================
   HERO SECTION - Floating card
========================================================= */
.case-hero-container {
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.case-hero {
  position: relative;
  width: 100%;
  max-width: 1400px;
  min-height: 50vh;
  background: #0FA55A;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 0px 40px;
  overflow: hidden;
}

.case-hero-wrap {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.case-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.case-hero-tag {
  background: #fff;
  color: #0FA55A;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.case-hero-title {
  text-align: center;
  margin-bottom: 20px;
}

.case-project-name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
}

.case-hero-visual {
  width: 100%;
  max-width: 800px;
  border-radius: 20px 20px 0 0;
  overflow: visible;
}

.case-hero-visual img {
  width: 100%;
  height: auto;
  display: block;
}

/* =========================================================
   CASE LAYOUT & SIDEBAR NAVIGATION
========================================================= */
.case-layout {
  display: flex;
  max-width: 1300px;
  margin: 0 auto;
  align-items: flex-start;
  padding: 0 40px;
}

.case-sidebar {
  position: sticky;
  top: 120px;
  z-index: 50;
  background: #0FA55A;
  border-radius: 20px;
  padding: 24px;
  width: 220px;
  box-shadow: 0 10px 30px rgba(15, 165, 90, 0.2);
  flex-shrink: 0;
}

.case-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-back-btn {
  background: #fff;
  color: #0FA55A;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  width: fit-content;
}

.case-nav-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 250ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-nav-link:hover {
  color: #fff;
}

.case-nav-dot {
  display: inline-block;
  width: 0;
  height: 0;
  opacity: 0;
  background: #fff;
  border-radius: 50%;
  transition: all 200ms ease;
}

.case-nav-link.is-active {
  color: #fff;
  font-weight: 700;
}

.case-nav-link.is-active .case-nav-dot {
  width: 6px;
  height: 6px;
  opacity: 1;
}

/* =========================================================
   MAIN CONTENT
========================================================= */
.case-main {
  flex: 1;
  max-width: 900px;
  margin: 0;
  padding: 80px 0 100px 80px; /* Space between sidebar and main */
}

.case-section {
  margin-bottom: 80px;
}

.case-section-title {
  font-size: 2rem;
  font-weight: 900;
  color: #111;
  margin-bottom: 30px;
  letter-spacing: -0.01em;
}

.case-content p {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(0, 0, 0, 0.6);
  margin-bottom: 20px;
}

/* Overview Tags */
.case-overview-tags {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.case-overview-tag {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #111;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

/* Row Cards (Challenges & Solutions) */
.case-cards-row {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-row-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fdfdfd;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 24px 30px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.case-row-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: #111;
  color: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-row-icon svg {
  width: 20px;
  height: 20px;
}

.case-row-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0,0,0,0.6);
}

/* Features Grid */
.case-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.case-feature-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
}

.case-feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.04);
  color: #111;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.case-feature-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

/* Outcome Section */
.case-outcome-card {
  position: relative;
  background: #f8f8f8;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  padding: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
}

.case-outcome-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: 0;
  opacity: 0.5;
}

.case-outcome-content {
  position: relative;
  z-index: 1;
  max-width: 60%;
}

.case-outcome-subtitle {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #111;
}

.case-outcome-statbox {
  position: relative;
  z-index: 1;
  background: #333;
  color: #fff;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.case-stat-number {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}

.case-stat-label {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1100px) {
  .case-features-grid { grid-template-columns: repeat(2, 1fr); }
  .case-outcome-card { flex-direction: column; gap: 30px; text-align: center; }
  .case-outcome-content { max-width: 100%; }
}

@media (max-width: 900px) {
  .case-layout {
    flex-direction: column;
    padding: 0 20px;
  }
  .case-sidebar {
    display: none; /* or replace with horizontal scrolling sticky top nav if needed */
  }
  .case-main { padding-left: 0; padding-right: 0; max-width: 100%; }
}

@media (max-width: 600px) {
  .case-hero-container { padding: 10px; }
  .case-hero { border-radius: 20px; padding: 40px 20px 0 20px; }
  .case-project-name { font-size: 2rem; }
  .case-overview-tags { flex-direction: column; }
  .case-row-card { flex-direction: column; text-align: center; }
  .case-features-grid { grid-template-columns: 1fr; }
}



/* =========================================================
   FOOTER SECTION
========================================================= */
.site-footer {
  width: 100%;
  align-self: center;
  justify-items: center;
  position: relative;
  z-index: 30;
  margin-top: clamp(80px, 12vh, 150px);
}

.footer-card {
  width: 95vw !important;
  margin: 0 !important;
  border-radius: clamp(28px, 4vw, 72px) clamp(28px, 4vw, 72px) 0 0;
  overflow: hidden;
  background: transparent !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.footer-top {
  background: #0FA55A; /* Green background for case study */
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 3vw, 48px);
}

.footer-left {
  flex: 1;
  min-width: 0;
}

.footer-title {
  margin: 0;
  font-weight: 800;
  color: #000; /* Black text on green */
  font-size: clamp(22px, 2.2vw, 36px);
  line-height: 1.15;
}

.footer-subtitle {
  margin: 10px 0 0;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.65); /* Darker for better contrast on green */
  font-size: clamp(18px, 1.6vw, 30px);
  line-height: 1.22;
  max-width: 56ch;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #000; /* Black buttons on green background */
  box-shadow: 0 0px 0 4px rgba(0, 0, 0, 0.35);
  color: #fff;
  text-decoration: none;
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.icon-btn .social {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  filter: brightness(0) invert(1); /* Make icons white */
}

.icon-btn:hover,
.icon-btn:active,
.icon-btn:focus-visible {
  background: #000;
  opacity: 1;
  box-shadow: 0px 0px 2px 3px rgba(0, 0, 0, 0.3);
  scale: 105%;
  outline: none;
  transition: all 180ms ease;
}

.icon-btn:hover .social,
.icon-btn:active .social,
.icon-btn:focus-visible .social {
  scale: 120%;
  opacity: 1;
  transition: all 180ms ease;
}

.icon-btn:active {
  scale: 90%;
  opacity: 1;
  box-shadow: 0 0px 0 6px rgba(0, 0, 0, 0.85);
  transition: all 180ms ease;
}

.footer-right {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  min-width: 260px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(0, 0, 0, 0.75); /* Darker for green background */
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
}

.meta-sep {
  opacity: 0.45;
}

.footer-heart {
  width: 2rem;
}

.footer-feather {
  width: 22px;
  height: auto;
  margin-left: 6px;
  opacity: 0.85;
}

.divider-container {
  width: 100%;
  background: #0FA55A; /* Green background */
  padding: 0 clamp(22px, 3vw, 48px);
}

.divider {
  width: 100%;
  height: 2px;
  background: rgba(0, 0, 0, 0.2);
}

.footer-word-wrap {
  position: relative;
  width: 100%;
  height: 100px;
  background: transparent;
}

.footer-cutout {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 100%;
  will-change: transform, opacity, filter;
}

.footer-cutout rect {
  fill: #0FA55A; /* Green fill for cutout */
}

.footer-cutout-text {
  font-family: inherit;
  font-weight: 900;
  letter-spacing: -0.08em;
  font-size: 340px;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
    margin-top: 10px;
  }

  .footer-meta {
    flex-wrap: wrap;
    white-space: normal;
    gap: 10px;
  }

  .meta-sep {
    display: none;
  }

  .footer-subtitle {
    max-width: 100%;
  }

  .footer-word-wrap {
    height: 30vh;
  }

  .footer-cutout-text {
    font-size: 280px;
  }
}

@media (max-width: 576px) {
  .footer-social {
    flex-wrap: wrap;
  }

  .icon-btn {
    width: 48px;
    height: 48px;
  }

  .icon-btn .social {
    width: 20px;
    height: 20px;
  }
}

/* =========================================================
   CASE STUDY SPECIFIC FOOTER OVERRIDES
========================================================= */
body.scrollable #siteFooter {
  background: transparent !important;
}

body.scrollable #siteFooter .footer-card {
  background: #0FA55A !important; /* Make entire container Green */
}

body.scrollable #siteFooter .footer-top {
  background: transparent !important; /* Let green show through */
}

body.scrollable #siteFooter * {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

body.scrollable #siteFooter .footer-title,
body.scrollable #siteFooter .footer-subtitle {
  color: #fff !important;
}

/* Ensure the divider line matches */
body.scrollable #siteFooter .divider {
  background: rgba(255, 255, 255, 0.2) !important;
}

body.scrollable #siteFooter .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  background: transparent !important;
}

/* Let the social icons render in their authentic colors without flattening them */
body.scrollable #siteFooter .social {
  filter: none !important;
}

body.scrollable #siteFooter .meta-copy,
body.scrollable #siteFooter .meta-made {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* "the green behind the sagar" -> Background is green. SAGAR text should be White. */
body.scrollable #siteFooter .footer-cutout svg path {
  fill: #fff !important;
  filter: none !important;
}
