/* =============================================
   CASE STUDY DETAIL — SHARED STYLES
   Global color system + footer + nav theme fixes
   ============================================= */

/* --- GLOBAL COLOR SYSTEM (matches work.html) --- */
:root {
  --_color---orange1: #4361EE;
  --_color---orange2: #2B4DDB;
  --_color---bg-grey: #faf6ef;
}
body, body.body.work, .body.work { background-color: #faf6ef !important; }
.nav-name-jm { color: #3d3b39 !important; }
.text-span,.text-span-2,.text-span-6 { color: #4361EE !important; }
.text-jm-cursor { color: #fff !important; }
.dot-jm,.dot-project { background-color: #4361EE !important; }
.pill-year { border-color: #4361EE !important; color: #4361EE !important; }
.pill-service { border-color: #3d3b39 !important; color: #3d3b39 !important; }
::selection { background: #4361EE; color: #fff; }
::-moz-selection { background: #4361EE; color: #fff; }
.top-glow,.blur,.top-glow * { display: none !important; }
body, .body { box-shadow: none !important; }

/* --- NAV IS-PEACH OVERRIDES (white on dark) --- */
.nav-name-jm.is-peach { color: #fff !important; }
.nav-social-link.is-peach { color: #fff !important; }
.nav-social-link.is-peach:hover { color: rgba(255,255,255,0.6) !important; }
.nav-link.is-peach { color: #fff !important; border-color: rgba(255,255,255,0.2) !important; }
.nav-link.is-peach:hover { color: rgba(255,255,255,0.6) !important; }
.dot-jm.is-peach { background-color: #fff !important; }
.nav-logo-left.is-peach { filter: brightness(0) invert(1); }


/* --- CASE STUDY DETAIL PAGE --- */
.cs-detail-page {
  padding-top: 8rem;
  color: #3d3b39;
}
.cs-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
}
.cs-back-link { padding-top: 2rem; padding-bottom: 1.5rem; }
.cs-back {
  color: rgba(61,59,57,0.5);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s;
}
.cs-back:hover { color: #3d3b39; }

/* Hero */
.cs-hero { padding-bottom: 4rem; }
.cs-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(61,59,57,0.45);
  margin-bottom: 1rem;
}
.cs-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: #3d3b39;
}
.cs-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(61,59,57,0.6);
  max-width: 40rem;
}
.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Meta Bar */
.cs-meta-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-top: 1px solid rgba(61,59,57,0.1);
}
.cs-meta-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: #3d3b39;
}

/* Cover */
.cs-cover { width: 100%; padding: 2rem 0; }
.cs-cover-img {
  width: 100%;
  height: auto;
  border-top: 1px solid rgba(61,59,57,0.08);
  border-bottom: 1px solid rgba(61,59,57,0.08);
}

/* Sections */
.cs-section { padding-top: 4rem; padding-bottom: 4rem; }
.cs-bordered { border-top: 1px solid rgba(61,59,57,0.1); }
.cs-section-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
}
.cs-section-title {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2rem;
  color: #3d3b39;
}
.cs-section-content {
  color: rgba(61,59,57,0.6);
  line-height: 1.7;
  font-size: 0.95rem;
}
.cs-section-content p { margin-bottom: 1.2rem; }
.cs-section-content strong { color: #3d3b39; }

/* Dark Section */
.cs-dark-section {
  background-color: #1a1917;
  padding: 5rem 0;
  margin: 2rem 0;
}
.cs-label-light { color: rgba(255,255,255,0.35) !important; }
.cs-light { color: #fff !important; }

/* Editorial List */
.cs-editorial-list { margin-top: 2rem; }
.cs-editorial-item {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.5rem 0;
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 2rem;
  align-items: start;
}
.cs-light-list .cs-editorial-item { border-top-color: rgba(61,59,57,0.1); }
.cs-editorial-title { font-size: 0.95rem; font-weight: 600; color: #fff; }
.cs-light-list .cs-editorial-title { color: #3d3b39; }
.cs-editorial-desc { font-size: 0.85rem; line-height: 1.6; color: rgba(255,255,255,0.5); }
.cs-light-list .cs-editorial-desc { color: rgba(61,59,57,0.55); }

/* Challenge/Solution */
.cs-challenge-text { color: rgba(61,59,57,0.5); margin-bottom: 0.5rem; }
.cs-solution-text { color: #3d3b39; font-weight: 500; }

/* Checklist */
.cs-checklist p { font-size: 0.85rem; color: rgba(61,59,57,0.55); line-height: 1.8; }

/* Blockquote */
.cs-blockquote {
  border-left: 2px solid #3d3b39;
  padding-left: 1.5rem;
  margin: 2.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.5;
  max-width: 38rem;
  color: #3d3b39;
}
.cs-body-muted {
  color: rgba(61,59,57,0.55);
  max-width: 38rem;
  line-height: 1.6;
  margin-bottom: 3rem;
}

/* Stats */
.cs-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(61,59,57,0.1);
}
.cs-stats-3 { grid-template-columns: repeat(3, 1fr); }
.cs-stats-5 { grid-template-columns: repeat(5, 1fr); }
.cs-stat {
  background: #f5f1eb;
  padding: 2.5rem 1.5rem;
  text-align: left;
}
.cs-stat-center { text-align: center; }
.cs-stat-number {
  display: block;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #3d3b39;
}
.cs-stat-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(61,59,57,0.45);
  margin-top: 0.3rem;
}

/* Image grids */
.cs-module { margin-bottom: 3rem; }
.cs-img-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.cs-img-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.cs-img-card { margin-bottom: 0.5rem; }
.cs-img {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(61,59,57,0.08);
  display: block;
}
.cs-img-tall { aspect-ratio: 9/16; object-fit: cover; }
.cs-img-title { font-weight: 600; font-size: 0.9rem; margin-top: 0.8rem; color: #3d3b39; }
.cs-img-desc { font-size: 0.8rem; color: rgba(61,59,57,0.5); line-height: 1.5; margin-top: 0.3rem; }

/* Visual cards (design-systems) */
.cs-visual-section { margin-bottom: 3rem; }
.cs-visual-card { border: 1px solid rgba(61,59,57,0.1); border-radius: 0.75rem; overflow: hidden; margin-top: 1rem; }
.cs-visual-info { padding: 1.2rem 1.5rem; border-top: 1px solid rgba(61,59,57,0.08); }

/* Component list (design-systems) */
.cs-component-list { margin-top: 2rem; }
.cs-component-item { border-top: 1px solid rgba(61,59,57,0.1); padding: 1.2rem 0; display: grid; grid-template-columns: auto 1fr 2fr; gap: 2rem; align-items: baseline; }
.cs-component-count { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; color: #3d3b39; min-width: 4rem; }
.cs-component-name { font-weight: 600; font-size: 0.95rem; color: #3d3b39; }
.cs-component-desc { font-size: 0.85rem; color: rgba(61,59,57,0.5); line-height: 1.5; }

/* Deliverables grid */
.cs-deliverables-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cs-deliverable-item { border-top: 1px solid rgba(61,59,57,0.1); padding: 1rem 0; font-size: 0.85rem; color: rgba(61,59,57,0.6); line-height: 1.5; }

/* Process grid */
.cs-process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; margin-top: 2rem; }
.cs-process-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; color: #3d3b39; }
.cs-process-desc { font-size: 0.85rem; color: rgba(61,59,57,0.55); line-height: 1.6; }

/* Audit grid (mortgage) */
.cs-audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.cs-audit-items { margin-top: 1rem; }
.cs-audit-item { border-top: 1px solid rgba(61,59,57,0.1); padding: 0.75rem 0; font-size: 0.85rem; color: rgba(61,59,57,0.5); line-height: 1.5; }
.cs-audit-item.cs-good { color: #3d3b39; }

/* Solutions grid (mortgage) */
.cs-solutions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 2rem; }
.cs-solution-item { border-top: 1px solid rgba(255,255,255,0.08); padding: 0.75rem 0; font-size: 0.85rem; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* Next Project */
.cs-next-project { padding: 4rem 3rem; border-top: 1px solid rgba(61,59,57,0.1); }
.cs-next-link { display: block; text-decoration: none; transition: opacity 0.3s; }
.cs-next-link:hover { opacity: 0.7; }
.cs-next-title { font-size: clamp(1.3rem, 3.5vw, 2.5rem); font-weight: 600; color: #3d3b39; margin: 0.5rem 0; }
.cs-next-desc { font-size: 0.85rem; color: rgba(61,59,57,0.5); }

/* --- FOOTER FIX --- */
.section.footer {
  height: auto !important;
  min-height: auto !important;
  padding: 6vw 4vw 4vw !important;
  display: flex !important;
  flex-direction: column !important;
  border-top: 1px solid rgba(61,59,57,0.1) !important;
  margin-top: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}
.main-wrapper-footer {
  width: 100% !important;
  height: auto !important;
  flex-flow: column !important;
  justify-content: flex-end !important;
  align-items: stretch !important;
  display: flex !important;
}
.name-footer {
  width: auto !important;
  font-size: 10vw !important;
  white-space: nowrap;
  overflow: visible !important;
  color: #1a1a1a !important;
  line-height: 80% !important;
}
.body-footer.big {
  color: #1a1a1a !important;
}
.wrapper-content-footer._2 {
  overflow: visible !important;
  justify-content: space-between !important;
  display: flex !important;
  width: 100% !important;
  margin-bottom: 2vw !important;
  margin-top: 2vw !important;
}
.wrapper-content-footer._1 {
  display: none !important;
}
.wrapper-content-footer {
  width: 100% !important;
}


/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .cs-detail-page { padding-top: 6rem; }
  .cs-container { padding: 0 1.5rem; }
  .cs-section-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .cs-meta-bar { grid-template-columns: repeat(2, 1fr); }
  .cs-editorial-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .cs-img-grid-2 { grid-template-columns: 1fr; }
  .cs-img-grid-3 { grid-template-columns: 1fr 1fr; }
  .cs-stats-grid, .cs-stats-3, .cs-stats-5 { grid-template-columns: repeat(2, 1fr); }
  .cs-audit-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cs-solutions-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cs-deliverables-grid { grid-template-columns: 1fr; }
  .cs-process-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .cs-component-item { grid-template-columns: auto 1fr; gap: 1rem; }
  .cs-component-desc { grid-column: 1 / -1; }
  .cs-next-project { padding: 3rem 1.5rem; }
  .name-footer { font-size: 15vw !important; }
}
