/* ════════════════════════════════════════════════════════════════════
   CASE STUDY — shared template CSS
   public/assets/css/case-study.css

   Canonical layout for every case study page going forward. New studies
   should link this stylesheet, drop content into the same markup
   skeleton, and not need any page-local CSS.

   Namespace: .mi-cs-*  (the existing legacy study at
   /implementation/case-studies/from-overextended-to-optimized/ uses an
   older .cs-* namespace baked into main.css — left untouched).

   Page sections (in order):
     1. .mi-cs-hero          — image-backed dark hero
     2. .mi-cs-stat-band     — flexible, count-agnostic results strip
     3. .mi-cs-body          — two-column narrative + sticky sidebar
        ├─ .mi-cs-narrative  — left col (~62%), Problem / Solution / Outcome
        └─ .mi-cs-sidebar    — right col (~38%), sticky desktop, stacks mobile
           ├─ .mi-cs-meta-card
           └─ .mi-cs-cta-card

   Design tokens reference Staging/notes/design-standards.md.
   ════════════════════════════════════════════════════════════════════ */


/* ──────── 1. HERO — image-backed family treatment ──────── */
/* Mirrors the .mi-wm-hero pattern: dark navy overlay (94%/97%) over a
   background image so legibility is guaranteed for any photo. The eyebrow
   pill comes from the canonical .page-hero-eyebrow rule in main.css —
   no override needed. */
.mi-cs-hero {
  position: relative;
  background-color: var(--mi-dark-teal);
  background-size: cover;
  background-position: center;
  color: var(--mi-white);
  padding: 44px 24px 80px;
}
.mi-cs-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
}
.mi-cs-hero .breadcrumb {
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 22px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mi-cs-hero .breadcrumb a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.mi-cs-hero .breadcrumb a:hover { color: var(--mi-gold); }
.mi-cs-hero .breadcrumb-sep { color: rgba(255, 255, 255, 0.3); margin: 0 8px; }
.mi-cs-hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--mi-white);
  margin: 0;
  letter-spacing: -.005em;
  max-width: 980px;
}
/* Optional subtitle below the H1. Only renders when the page provides a
   $subtitle variable — when omitted, no markup, no spacing change. So this
   rule is backward-compatible: studies without a subtitle (e.g. the steel
   study) are unaffected. */
.mi-cs-hero-subtitle {
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  margin: 18px 0 0;
  max-width: 880px;
  font-style: italic;
}


/* ──────── 2. STAT BAND ────────
   The top hero stat band's rules (.mi-cs-stat-band / -inner / -eyebrow /
   .mi-cs-stat-row / .mi-cs-stat / .mi-cs-stat:first-child / -num / -label
   + the 720px wrap MQ) were LIFTED to main.css on 2026-06-23 because the
   homepage Proven Results section also uses the same component. Single
   source of truth lives there — see main.css "STAT BAND — shared
   component". Case study pages still get those rules because they load
   main.css too. Only the in-body grid variant below stays here. */

/* — In-body stat grid (used INSIDE a .mi-cs-section, separate from the
     top hero band). Decoupled so each can evolve independently:
       • Top band (.mi-cs-stat-row) → single row, count-agnostic, divider'd
       • In-body grid (.mi-cs-stat-grid) → wraps, center-justified, no dividers
     For 5 stats the result is 3 on row 1 and 2 centered on row 2 — no
     orphan column, no ragged divider lines. Other counts (4 → 3+1, 6 → 3+3)
     also center the trailing row cleanly. */
.mi-cs-stat-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 24px;
  margin: 12px 0 0;
}
.mi-cs-stat-grid .mi-cs-stat {
  flex: 0 1 200px;
  min-width: 0;        /* override .mi-cs-stat's 220px min so 3 fit per row */
  max-width: 240px;
  padding: 12px 16px;
  border-left: none;   /* divider lines don't survive wrap — drop them here */
}


/* ──────── 3. BODY — two-column narrative + sticky sidebar ──────── */
.mi-cs-body {
  background: var(--mi-white);
  padding: 88px 24px;
}
.mi-cs-body-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

/* — Left column: narrative — */
.mi-cs-narrative {
  max-width: 720px;
}
.mi-cs-section {
  margin-bottom: 56px;
}
.mi-cs-section:last-child {
  margin-bottom: 0;
}
/* Section heading hierarchy — FLIPPED from the original layout:
   - Previously the small orange eyebrow ("The Problem") sat above the
     big editorial title ("Lean Improvements Weren't Enough"). That read
     backwards — the meaningful label looked secondary.
   - Now the section LABEL is the dominant H2 (.mi-cs-section-heading),
     and the editorial line is the optional, smaller H3
     (.mi-cs-section-subheading) below it.
   - Brand marker preserved as a short orange accent rule beneath the
     heading (kept subtle — the heading itself is navy, not orange). */
.mi-cs-section-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 3.2vw, 38px);
  text-transform: uppercase;
  color: var(--mi-dark-teal);
  line-height: 1.1;
  letter-spacing: -.005em;
  margin: 0;
}
.mi-cs-section-heading::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--mi-orange);
  margin: 14px 0 18px;
}
.mi-cs-section-subheading {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.1vw, 25px);
  text-transform: none;            /* title case so it reads as subordinate */
  color: var(--mi-dark-teal);
  line-height: 1.3;
  letter-spacing: 0;
  margin: 0 0 22px;
}
.mi-cs-narrative p {
  font-size: 17px;
  color: var(--mi-grey-800);
  line-height: 1.7;
  margin: 0 0 18px;
}
.mi-cs-narrative p:last-child {
  margin-bottom: 0;
}
.mi-cs-narrative ul {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.mi-cs-narrative ul li {
  position: relative;
  padding-left: 22px;
  font-size: 17px;
  color: var(--mi-grey-800);
  line-height: 1.7;
  margin: 0 0 10px;
}
.mi-cs-narrative ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 12px;
  width: 6px;
  height: 6px;
  background: var(--mi-orange);
  border-radius: 50%;
}

/* — Pull quote / testimonial — optional, in-narrative flow.
     Sits between .mi-cs-section blocks (typically Solution → Outcome).
     Orange left accent, condensed-italic quote text, small uppercase
     attribution. Only renders when the page provides $pullquote, so
     studies without a quote (steel + chemicals) are unaffected. */
.mi-cs-pullquote {
  margin: 8px 0 56px;
  padding: 6px 0 6px 28px;
  border-left: 4px solid var(--mi-orange);
}
.mi-cs-pullquote-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  color: var(--mi-dark-teal);
  letter-spacing: -.005em;
  margin: 0 0 14px;
}
.mi-cs-pullquote-attribution {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mi-grey-700);
  margin: 0;
  font-style: normal;
}

/* — Right column: sticky sidebar — */
.mi-cs-sidebar {
  position: sticky;
  /* The site header (.site-header) is itself position:sticky and wraps
     BOTH the util-bar (~30px: 8+8 padding + 11px text) AND the .nav-bar
     (96px locked height) — total ~126px stays pinned at the top during
     scroll. The earlier 100px offset slid the sidebar's top edge under
     the nav. 144px clears the full header stack + ~18px breathing gap. */
  top: 144px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Metadata card */
.mi-cs-meta-card {
  background: var(--mi-white);
  border: 1px solid #EEF4F9;
  border-top: 3px solid var(--mi-orange);
  border-radius: 6px;
  padding: 28px 28px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mi-cs-meta-row {
  padding: 12px 0;
  border-bottom: 1px solid #EEF4F9;
}
.mi-cs-meta-row:first-child { padding-top: 0; }
.mi-cs-meta-row:last-child  { padding-bottom: 0; border-bottom: none; }
.mi-cs-meta-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mi-orange);
  margin-bottom: 4px;
}
.mi-cs-meta-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--mi-dark-teal);
  line-height: 1.25;
}
/* List variant for a metadata row's value — used when a $meta entry's
   value is an array (e.g. multiple services). Same orange-dot pattern as
   narrative bullets, but smaller and tighter for the sidebar. Optional:
   string values continue to render as .mi-cs-meta-value text. */
.mi-cs-meta-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}
.mi-cs-meta-list li {
  position: relative;
  padding: 3px 0 3px 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--mi-dark-teal);
  line-height: 1.4;
}
.mi-cs-meta-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 11px;
  width: 4px;
  height: 4px;
  background: var(--mi-orange);
  border-radius: 50%;
}

/* CTA card — dark navy, family treatment */
.mi-cs-cta-card {
  background: var(--mi-dark-teal);
  color: var(--mi-white);
  border-radius: 6px;
  padding: 32px 28px 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.mi-cs-cta-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mi-gold);
  margin: 0 0 8px;
}
.mi-cs-cta-head {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 28px;
  text-transform: uppercase;
  color: var(--mi-white);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -.005em;
}
.mi-cs-cta-card .btn {
  display: inline-block;
  width: 100%;
  text-align: center;
}

/* ──────── Responsive — stack at 900px, kill sticky ──────── */
@media (max-width: 900px) {
  .mi-cs-body { padding: 64px 24px; }
  .mi-cs-body-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .mi-cs-sidebar {
    position: static;
    top: auto;
  }
  .mi-cs-narrative { max-width: none; }
}
@media (max-width: 600px) {
  .mi-cs-hero       { padding: 36px 20px 64px; }
  .mi-cs-stat-band  { padding: 44px 20px; }
  .mi-cs-body       { padding: 56px 20px; }
}
