/* cs.css — Swiss Authority case-study detail page styles. Verbatim port of the
   parts of site/_shared/cs.css that the customer detail + index pages need
   beyond the composed components (CtaBand owns `.cs-cta*`; global.css owns the
   `.btn*` + design tokens). Full-bleed hero with overlaid title + metrics →
   centered quote → 2-col article (prose + sticky sidebar) → optional Converge
   setup diagram → CTA. Plain CSS + var(--…) tokens (no Tailwind). */

:root {
  /* Only token missing from global.css; the rest (accent-soft/-mist, grad-2/3)
     already live there and stay the single source of truth. */
  --warm-deep: var(--color-role-warm-deep);
}

/* ── Full-bleed hero ─────────────────────────────────────────────────────── */
.cs-hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  color: #fff;
}
.cs-hero-bg {
  position: absolute;
  inset: 0;
  background-image: var(--cs-img);
  background-size: cover;
  background-position: var(--cs-pos, center);
}
.cs-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 16, 20, 0.5) 0%,
    rgba(14, 16, 20, 0.12) 26%,
    rgba(14, 16, 20, 0.18) 52%,
    rgba(14, 16, 20, 0.88) 100%
  );
}
.cs-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 30px;
  padding-bottom: 40px;
}
.cs-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cs-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
}
.cs-crumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}
.cs-crumb a:hover {
  color: #fff;
}
.cs-crumb-sep {
  color: rgba(255, 255, 255, 0.35);
}
.cs-crumb-current {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .cs-crumb-current,
  .cs-crumb-sep:has(+ .cs-crumb-current) {
    display: none;
  }
}
.cs-hero-logo {
  height: 22px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 1px 8px rgba(0, 0, 0, 0.35));
  opacity: 0.95;
}
.cs-hero-body {
  margin-top: auto;
  padding-top: 56px;
}
.cs-hero-title {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: none;
  /* This is an <h1>; our global h1 color would override the white it should
     inherit from the dark hero. Re-inherit to match the prototype. */
  color: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.cs-metrics {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 880px;
}
.cs-metric {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-metric-line {
  font-size: clamp(25px, 2.6vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
}
.cs-metric-val {
  font-variant-numeric: tabular-nums;
}
.cs-metric-det {
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
  max-width: 30ch;
}

/* ── Article: body + sticky sidebar ──────────────────────────────────────── */
.cs-article {
  display: grid;
  grid-template-columns: minmax(0, 680px) 300px;
  gap: 72px;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 56px;
  align-items: start;
}
.cs-body {
  min-width: 0;
}
.cs-intro {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.cs-intro:last-of-type {
  margin-bottom: 0;
}
/* Bridge: the MDX body renders its lede as bare direct-child <p> (the prototype
   authored them with class `.cs-intro`). Direct children only — Challenge/
   Solution prose lives deeper, under `.cs-prose`. Mirrors `.cs-intro`. */
.cs-body > p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.cs-body > p:last-of-type {
  margin-bottom: 0;
}

.cs-section {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.cs-section > h2 {
  margin: 0 0 28px;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.cs-cs {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.cs-block {
  padding: 0;
}
.cs-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cs-tag::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--cs-tag-ico) center / contain no-repeat;
  mask: var(--cs-tag-ico) center / contain no-repeat;
}
.cs-block.is-challenge .cs-tag {
  color: var(--warm-deep);
  --cs-tag-ico: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='10'/%3E%3Cpath%20d='M12%2016v-4'/%3E%3Cpath%20d='M12%208h.01'/%3E%3C/svg%3E");
}
.cs-block.is-solution .cs-tag {
  color: var(--accent-deep);
  --cs-tag-ico: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%206%209%2017l-5-5'/%3E%3C/svg%3E");
}
/* Heading line-height leak fix: the prototype's shell.css sets no global
   heading line-height, so `.cs-block h3` inherits body 1.55; our global.css
   type scale would leave it at h3's 1.15. Pin it to the prototype's effective
   value. */
.cs-block h3 {
  margin: 10px 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs-prose {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.cs-prose p {
  margin: 0 0 12px;
}
.cs-prose p:last-child {
  margin-bottom: 0;
}
.cs-prose strong {
  font-weight: 600;
  color: var(--ink);
}
.cs-prose ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-prose li {
  position: relative;
  padding-left: 22px;
  line-height: 1.5;
}
.cs-block.is-solution .cs-prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.cs-block.is-challenge .cs-prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warm-deep);
}

/* Sidebar */
.cs-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-cool);
}
.cs-meta-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 5px;
}
.cs-meta-val {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
}
.cs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cs-sidebar ul a {
  font-size: 14px;
  color: var(--accent);
  transition: color 0.2s var(--ease);
}
.cs-sidebar ul a:hover {
  color: var(--accent-deep);
}

/* ── Quote band ──────────────────────────────────────────────────────────── */
.cs-quote {
  border-top: 1px solid var(--line);
  background: transparent;
}
.cs-quote-inner {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 64px;
  padding-bottom: 64px;
  text-align: center;
}
.cs-quote blockquote {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.cs-quote-attr {
  margin-top: 28px;
  font-size: 15px;
  color: var(--ink-muted);
}
.cs-quote-attr b {
  color: var(--ink);
  font-weight: 600;
}

/* ── Converge setup diagram ──────────────────────────────────────────────── */
.cs-setup {
  padding-top: 8px;
  padding-bottom: 64px;
}
.cs-setup-title {
  margin: 0 0 22px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.cs-setup-canvas {
  background: var(--paper-cool);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  overflow: hidden;
}
.cs-setup-canvas svg {
  display: block;
  width: 100%;
  height: auto;
}
.cs-setup-rail {
  fill: none;
  stroke: var(--accent);
}
@keyframes cs-setup-sweep {
  from {
    x: -100%;
  }
  to {
    x: 100%;
  }
}
.cs-setup-sweep {
  animation: cs-setup-sweep 3s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cs-setup-sweep {
    animation: none;
  }
}
.cs-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cs-node-tile {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 2px rgba(14, 16, 20, 0.05);
}
.cs-node-tile img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.cs-node-tile.is-icon {
  border-radius: 999px;
  color: var(--accent);
}
.cs-node-tile.is-icon svg {
  width: 19px;
  height: 19px;
}
.cs-node-cap {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}
.cs-node.is-text {
  height: 100%;
  justify-content: center;
}
.cs-node-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(14, 16, 20, 0.05);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .cs-quote-inner {
    padding-bottom: 8px;
  }
  body > section.cs-article::before {
    display: none;
  }
  .cs-article {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 8px;
  }
  .cs-sidebar {
    position: static;
    order: -1;
  }
  .cs-metrics {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .cs-hero {
    min-height: 520px;
  }
  .cs-hero-scrim {
    background: linear-gradient(
      180deg,
      rgba(14, 16, 20, 0.55) 0%,
      rgba(14, 16, 20, 0.45) 35%,
      rgba(14, 16, 20, 0.62) 65%,
      rgba(14, 16, 20, 0.9) 100%
    );
  }
  .cs-hero-title,
  .cs-metric-line,
  .cs-metric-det {
    text-shadow:
      0 1px 2px rgba(14, 16, 20, 0.45),
      0 2px 14px rgba(14, 16, 20, 0.35);
  }
  .cs-metric-det {
    color: rgba(255, 255, 255, 0.88);
  }
}
