/* Case study page — extends style.css tokens/header/footer/buttons.
   Load style.css first; this file only adds case-study-specific components. */

:root {
  --cs-container: 1024px;
}

/* ---------- Chip rail (mobile section nav) ---------- */
.cs-chip-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--parchment);
  border-bottom: 1px solid var(--ink);
  padding: 10px 0;
}
.cs-chip-rail .cs-chip-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 0 22px;
  font: 600 0.625rem var(--font-heading);
  letter-spacing: .1em;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.cs-chip-rail a { text-decoration: none; color: var(--ink); }
.cs-chip-rail a:hover, .cs-chip-rail a:focus-visible { color: var(--vermilion-text); }

/* ---------- Floating side nav (wide desktop only) ---------- */
.cs-side-nav { display: none; }

/* ---------- Hero ---------- */
.cs-hero {
  padding: 56px 22px 56px;
  position: relative;
  overflow: hidden;
}
.cs-hero-inner {
  position: relative;
  max-width: var(--cs-container);
  margin: 0 auto;
  text-align: center;
}
.cs-kicker-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}
.cs-kicker-tick { width: 36px; height: 8px; background: var(--vermilion); transform: skewX(-30deg); flex: none; }
.cs-kicker-text { font: 700 0.75rem var(--font-heading); letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.cs-hero h1 {
  font: 700 1.875rem/1.1 var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .01em;
}
.cs-hero-subtitle {
  font: 400 0.9375rem/1.5 var(--font-body);
  color: var(--muted);
  font-style: italic;
  margin: 20px 0 0;
}
.cs-hero-intro {
  font: 400 0.875rem/1.7 var(--font-body);
  color: var(--muted);
  margin: 24px 0 0;
  text-align: left;
}
.cs-hero-note {
  font: 400 0.75rem/1.6 var(--font-body);
  font-style: italic;
  color: var(--muted);
  border-left: 2px solid var(--steel);
  padding-left: 14px;
  margin: 18px 0 0;
  text-align: left;
}

/* ---------- Meta row ---------- */
.cs-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: var(--cs-container);
  margin: 40px auto 0;
  padding: 0 22px;
}
.cs-meta-item { border-left: 3px solid var(--vermilion); padding: 2px 14px 4px; }
.cs-meta-item.mustard { border-left-color: var(--mustard); }
.cs-meta-item.ink { border-left-color: var(--ink); }
.cs-meta-item.steel { border-left-color: var(--steel); }
.cs-meta-label { font: 600 0.59375rem var(--font-body); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin: 0; }
.cs-meta-value { font: 700 0.8125rem var(--font-heading); margin: 4px 0 0; }
.cs-meta-logos { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; }
.cs-meta-logos img { display: block; }
.cs-meta-logos .cs-logo-sap { height: 20px; }
.cs-meta-logos .cs-logo-bosch { height: 14px; }
.cs-meta-logos .cs-logo-westtenth { height: 20px; }
.cs-meta-logos .cs-logo-aofl { height: 20px; }
.cs-meta-divider { width: 1px; height: 16px; background: var(--ink); }

/* ---------- Section shell ---------- */
.cs-section { padding: 0 22px 44px; max-width: var(--cs-container); margin: 0 auto; }
.cs-section-head { text-align: center; margin: 0 0 22px; }
.cs-section-heading { margin: 0; }
.cs-section-eyebrow {
  display: block;
  font: 600 0.625rem var(--font-body);
  letter-spacing: .2em;
  color: var(--vermilion-text);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.cs-section-title {
  display: block;
  font: 700 1.25rem var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cs-section-tick {
  width: 38px; height: 8px;
  transform: skewX(-30deg);
  margin: 12px auto 0;
}
.cs-section p {
  font: 400 0.875rem/1.7 var(--font-body);
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.cs-section p:last-child { margin-bottom: 0; }
.cs-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cs-list li {
  font: 400 0.875rem/1.6 var(--font-body);
  color: var(--muted);
  padding-left: 18px;
  position: relative;
  text-align: left;
}
.cs-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 2px;
  background: var(--vermilion);
}
.cs-subhead {
  font: 700 0.9375rem var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 34px 0 12px;
  text-align: center;
}

/* ---------- Task / Principles grids ---------- */
.cs-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cs-grid-item { border-left: 1px solid var(--ink); padding: 4px 16px 0; }
.cs-grid-num { font: 700 0.75rem var(--font-heading); color: var(--vermilion-text); }
.cs-grid-item p { font-size: 0.8125rem; line-height: 1.55; margin: 6px 0 0; text-align: left; max-width: none; }
.cs-grid-item h3 { font: 700 0.875rem/1.35 var(--font-heading); margin-top: 7px; }
.cs-grid-item .cs-grid-item-body { font-size: 0.78125rem; line-height: 1.55; color: var(--muted); margin: 7px 0 0; }

/* ---------- Content band (full-bleed) ---------- */
.cs-content-band { background: var(--hover-panel); padding: 40px 22px; margin-bottom: 44px; }
.cs-content-band-inner { max-width: var(--cs-container); margin: 0 auto; }
.cs-content-band-title { font: 700 1.25rem/1.2 var(--font-heading); text-transform: uppercase; }
.cs-content-band-tick { width: 38px; height: 8px; background: var(--vermilion); transform: skewX(-30deg); margin: 14px 0 18px; }
.cs-content-band p { font: 400 0.875rem/1.7 var(--font-body); color: var(--muted); margin: 0; max-width: none; }

/* ---------- Figures / artifacts ---------- */
.cs-figure { margin: 26px 0 8px; font: 400 0.875rem var(--font-body); max-width: 700px; margin-left: auto; margin-right: auto; }
.cs-figure-sm { max-width: 525px; }
.cs-figure-frame {
  cursor: zoom-in;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  display: block;
  width: 100%;
}
.cs-figure-frame img { width: 100%; display: block; }
.cs-figure figcaption { font: 400 0.6875rem var(--font-body); color: var(--muted); margin-top: 7px; }
.cs-spacer { height: 34px; }

/* ---------- Image placeholder (asset pending) ---------- */
.cs-image-placeholder {
  background: var(--hover-panel);
  border: 1px dashed var(--muted);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  width: 100%;
  text-align: center;
}
.cs-image-placeholder-label { font: 700 0.625rem var(--font-heading); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Video ---------- */
.cs-video-frame {
  background: var(--ink);
  aspect-ratio: 16/9;
  width: 100%;
}
.cs-video-frame video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cs-video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }

/* ---------- Quotes ---------- */
.cs-quotes { display: flex; flex-direction: column; gap: 24px; }
.cs-quote { border-left: 2px solid var(--vermilion); padding-left: 18px; margin: 0; }
.cs-quote.mustard { border-left-color: var(--mustard); }
.cs-quote.steel { border-left-color: var(--steel); }
.cs-quote p { font: 400 0.84375rem/1.65 var(--font-body); color: var(--ink); margin: 0; max-width: 640px; text-align: left; }
.cs-quote .cs-quote-name { font: 700 0.75rem var(--font-heading); margin-top: 10px; letter-spacing: .06em; }
.cs-quote .cs-quote-role { font: 700 0.71875rem var(--font-body); color: var(--muted); }

/* ---------- Back / Next band ---------- */
.cs-back-next { background: var(--hover-panel); border-top: 1px solid var(--ink); display: flex; flex-direction: column; }
.cs-back-next a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  text-decoration: none;
  color: var(--ink);
  transition: background-color .18s ease;
}
@media (prefers-reduced-motion: reduce) { .cs-back-next a { transition: none; } }
.cs-back-next a:hover, .cs-back-next a:focus-visible { background: #E7D8BE; }
.cs-back-next .cs-next-link { justify-content: space-between; border-top: 1px solid var(--ink); }
.cs-back-arrow { font: 700 1.0625rem var(--font-heading); flex: none; }
.cs-back-label { font: 600 0.59375rem var(--font-body); letter-spacing: .16em; color: var(--muted); }
.cs-back-label.next { color: var(--vermilion-text); }
.cs-back-title { font: 700 0.875rem var(--font-heading); text-transform: uppercase; margin-top: 3px; }
.cs-back-next .cs-next-text { text-align: right; }

/* ---------- Lightbox ---------- */
dialog.cs-lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
}
dialog.cs-lightbox::backdrop { background: rgba(27, 36, 50, .92); }
.cs-lightbox-inner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.cs-lightbox-close-row {
  position: absolute;
  top: 20px; right: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.cs-lightbox-x {
  width: 34px; height: 34px;
  border: 1px solid var(--parchment);
  color: var(--parchment);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font: 400 1.125rem var(--font-body);
  cursor: pointer;
}
.cs-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: 1px solid var(--parchment);
  border-radius: 50%;
  color: var(--parchment);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font: 400 1.375rem var(--font-body);
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease;
}
@media (prefers-reduced-motion: reduce) { .cs-lightbox-nav { transition: none; } }
.cs-lightbox-nav:hover, .cs-lightbox-nav:focus-visible { background: rgba(240, 233, 217, .14); }
.cs-lightbox-prev { left: 10px; }
.cs-lightbox-next { right: 10px; }
.cs-lightbox img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  border: 1px solid var(--parchment);
  background: var(--parchment);
  display: block;
  cursor: default;
}

/* ================= Desktop (≥768px) ================= */
@media (min-width: 768px) {
  .cs-chip-rail { display: none; }

  .cs-hero { padding: 72px 24px 72px; }
  .cs-hero-inner { max-width: 921px; }
  .cs-kicker-row { margin-bottom: 36px; }
  .cs-kicker-tick { width: 44px; height: 9px; }
  .cs-hero h1 { font-size: 2.8125rem; }
  .cs-hero-subtitle { font-size: 1.125rem; margin-top: 24px; }
  .cs-hero-intro { font-size: 0.90625rem; text-align: left; margin-top: 28px; }

  .cs-meta {
    display: grid;
    grid-template-columns: 1.1fr .9fr 1.1fr 1fr 1.1fr;
    gap: 0;
    max-width: 976px;
    margin-top: 60px;
  }
  .cs-meta-even { grid-template-columns: repeat(5, 1fr); }
  .cs-meta-auto { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: center; }
  .cs-meta-item { padding: 2px 18px 4px; }
  .cs-meta-label { font-size: 0.625rem; }
  .cs-meta-value { font-size: 0.84375rem; }
  .cs-meta-logos .cs-logo-sap { height: 22px; }
  .cs-meta-logos .cs-logo-bosch { height: 16px; }
  .cs-meta-logos .cs-logo-westtenth { height: 22px; }
  .cs-meta-logos .cs-logo-aofl { height: 22px; }

  .cs-section { padding: 0 24px 72px; }
  .cs-section-head { margin-bottom: 38px; }
  .cs-section-title { font-size: 1.5rem; }
  .cs-section-tick { width: 44px; height: 9px; }
  .cs-section p { font-size: 0.90625rem; }
  .cs-list li { font-size: 0.90625rem; }
  .cs-subhead { font-size: 1.0625rem; margin: 48px 0 14px; }

  .cs-grid.cs-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; max-width: 900px; margin: 0 auto; }
  .cs-grid.cs-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
  .cs-grid-item { padding: 4px 20px 0; }
  .cs-grid-item:not(:first-child) { border-left: 1px solid var(--ink); }
  .cs-grid.cs-grid-3 .cs-grid-item:last-child,
  .cs-grid.cs-grid-4 .cs-grid-item:last-child { border-right: 1px solid var(--ink); }
  .cs-grid-num { font-size: 0.8125rem; }
  .cs-grid-item p { font-size: 0.8125rem; }
  .cs-grid-item h3 { font-size: 0.9375rem; margin-top: 8px; }
  .cs-grid-item .cs-grid-item-body { font-size: 0.78125rem; }

  .cs-content-band { padding: 64px 24px; margin-bottom: 56px; }
  .cs-content-band-inner { max-width: 720px; }
  .cs-content-band-title { font-size: 1.5rem; }
  .cs-content-band p { font-size: 0.90625rem; max-width: 76ch; }

  .cs-figure { margin: 40px auto 8px; }
  .cs-figure figcaption { font-size: 0.71875rem; margin-top: 8px; }
  .cs-spacer { height: 48px; }

  .cs-lightbox-prev { left: 28px; }
  .cs-lightbox-next { right: 28px; }

  .cs-quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
  .cs-quotes .cs-quote:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: 640px; margin-left: auto; margin-right: auto; }
  .cs-quote { padding-left: 22px; }
  .cs-quote p { font-size: 0.875rem; }
  .cs-quote-name { font-size: 0.78125rem; margin-top: 12px; }
  .cs-quote-role { font-size: 0.75rem; }

  .cs-back-next { flex-direction: row; }
  .cs-back-next a { padding: 26px 32px 26px 48px; flex: 1; }
  .cs-back-next:has(.cs-next-link) .cs-back-link { border-right: 1px solid var(--ink); }
  .cs-back-next .cs-next-link { padding: 26px 48px; border-top: none; }
  .cs-back-arrow { font-size: 1.125rem; }
  .cs-back-label { font-size: 0.625rem; }
  .cs-back-title { font-size: 0.9375rem; }
}

/* Floating side nav only where there's real gutter room beside the 1024px column.
   At exactly 1280px there's only 128px of gutter total, so the offset is tighter
   here than at 1440px+, where the full 24px gap to the container is restored. */
@media (min-width: 1280px) {
  .cs-side-nav {
    display: block;
    position: fixed;
    top: 110px;
    left: calc(50% - 614px);
    width: 118px;
    z-index: 30;
  }
  .cs-side-nav-tick { width: 28px; height: 7px; background: var(--vermilion); transform: skewX(-30deg); margin-bottom: 10px; }
  .cs-side-nav-list { display: flex; flex-direction: column; gap: 9px; font: 600 0.625rem var(--font-heading); letter-spacing: .1em; }
  .cs-side-nav-list a { text-decoration: none; color: var(--ink); }
  .cs-side-nav-list a:hover, .cs-side-nav-list a:focus-visible { color: var(--vermilion-text); }
}
@media (min-width: 1440px) {
  .cs-side-nav { left: calc(50% - 634px); }
}
