/* ==========================================================================
   Case Studies (case-studies.html)
   Baut auf style.css auf: gleiche Farben, Schriften, Abstände und Kanten.
   Hervorhebungen über dicke und dünne Schnitte, nicht über Kursiv.
   ========================================================================== */

/* Nur auf dieser Seite: „clip“ statt „hidden“, damit das Video beim Lesen
   mitlaufen kann (overflow hidden am body schaltet position: sticky ab).
   Ältere Browser ohne „clip“ behalten hidden, dann steht das Video still. */
body { overflow-x: clip; }

/* neutrales Hellgrau für die Case-Nummern, gut lesbar auf Weiß und Creme */
:root { --cs-hellgrau: #8F8B85; }

/* Hero ------------------------------------------------------------------- */
.cs-hero h1 { margin-top: 1.25rem; }
.cs-hero .lede { margin-top: 2rem; max-width: 60ch; }

/* Plattform mit Icon (Übersicht und Angaben im Case) */
.cs-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.cs-platform__icon { display: inline-flex; }
.cs-platform__icon svg { width: 0.95em; height: 0.95em; }

/* Übersicht aller Case Studies im Hero ----------------------------------- */
.cs-index { margin-top: clamp(2.75rem, 6vw, 4.5rem); }
.cs-index[hidden] { display: none; }
.cs-index__label {
  margin: 0 0 1rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-clay);
}
.cs-index__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 880px) {
  .cs-index__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Jede Case Study als weiße Box ohne Rand, nur mit Schatten.
   Klick springt weich nach unten zum Case (scroll-behavior aus style.css). */
.cs-index__item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
  height: 100%;
  padding: clamp(1rem, 2vw, 1.25rem) clamp(1.1rem, 2.5vw, 1.75rem);
  background: var(--color-white);
  color: var(--color-walnut);
  box-shadow:
    0 1px 2px rgba(43, 34, 25, 0.05),
    0 12px 32px -14px rgba(43, 34, 25, 0.18);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.cs-index__item:hover,
.cs-index__item:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 2px 4px rgba(43, 34, 25, 0.05),
    0 24px 48px -16px rgba(43, 34, 25, 0.28);
}
.cs-index__item:active {
  transform: translateY(-1px);
  transition-duration: var(--dur-fast);
}
.cs-index__item:focus-visible { outline: 2px solid var(--color-clay); outline-offset: 4px; }
.cs-index__thumb {
  display: block;
  width: 56px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: var(--color-sand);
}
.cs-index__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
.cs-index__item:hover .cs-index__thumb img,
.cs-index__item:focus-visible .cs-index__thumb img { transform: scale(1.08); }

/* „Case 01“ normal geschrieben und hellgrau (Mike, 20.11.2026) */
.cs-index__nr {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--cs-hellgrau);
}
.cs-index__title {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(1.05rem, 0.5vw + 0.95rem, 1.3rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.cs-index__brand { font-weight: 600; }
.cs-index__x { font-weight: 300; color: var(--color-clay); }
.cs-index__platform {
  display: block;
  margin-top: 0.3rem;
  font-size: var(--text-sm);
  color: var(--color-stone);
}
.cs-index__kpi { text-align: right; }
.cs-index__kpi-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 2vw + 1.25rem, 3rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.cs-index__kpi-label {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-stone);
}
@media (max-width: 479px) {
  .cs-index__item { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .cs-index__thumb { width: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-index__item:hover,
  .cs-index__item:focus-visible,
  .cs-index__item:active { transform: none; }
}

/* Ein Case-Block ----------------------------------------------------------
   Mobil untereinander: Titel, Video, Kennzahlen, Text.
   Ab 880 px: Video in einer eigenen Spalte, es läuft beim Lesen mit.
   Jede zweite Case Study spiegelt sich (Video rechts). */
.case-section { scroll-margin-top: var(--header-h); }

.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "head"
    "media"
    "kpis"
    "body";
  row-gap: clamp(2rem, 6vw, 2.75rem);
}
.case__head  { grid-area: head; }
.case__media { grid-area: media; }
.case__kpis  { grid-area: kpis; }
.case__body  { grid-area: body; }

@media (min-width: 880px) {
  .case {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "media head"
      "media kpis"
      "media body";
    column-gap: clamp(3rem, 6vw, 6rem);
    row-gap: clamp(2rem, 3vw, 2.75rem);
    align-items: start;
  }
  .case--rechts {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas:
      "head media"
      "kpis media"
      "body media";
  }
  .case__media { align-self: stretch; }
  .case__sticky {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
  .case--rechts .case__cover { margin-left: auto; }
}

/* Ohne Video, Titelbild und Posting mobil keine leere Fläche */
@media (max-width: 879px) {
  .case__media--leer { display: none; }
}

/* Kopf: Nummer, Titel, ein Satz ------------------------------------------- */
.case__index {
  margin: 0 0 0.75rem;
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--cs-hellgrau);
}
.case__title {
  font-size: clamp(2.1rem, 3.2vw + 0.75rem, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.case__brand   { font-weight: 600; }
.case__x       { font-weight: 300; color: var(--color-clay); }
.case__creator { font-weight: 300; }
.case__dek {
  margin-top: 1.15rem;
  max-width: 40ch;
  font-size: clamp(1.15rem, 0.6vw + 1rem, 1.4rem);
  font-weight: 300;
  line-height: 1.4;
  color: var(--color-walnut-soft);
}

/* Cover im Hochformat mit Play-Overlay ----------------------------------- */
.case__cover {
  position: relative;
  display: block;
  /* so breit wie die Spalte, aber nie höher als der Bildschirm */
  width: min(100%, 420px, calc((100svh - var(--header-h) - 3rem) * 9 / 16));
  min-width: min(100%, 260px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  background: var(--color-sand);
  color: var(--color-walnut);
  text-align: left;
}
@media (min-width: 880px) {
  .case__cover { margin: 0; }
}
a.case__cover,
button.case__cover { cursor: pointer; }

.case__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
/* leichte Abdunklung, damit Play-Knopf und Beschriftung auf jedem Bild lesbar sind */
.case__cover.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(42, 34, 24, 0.16);
  transition: background-color var(--dur-base) var(--ease);
}
.case__cover.has-image:hover::after,
.case__cover.has-image:focus-visible::after { background: rgba(42, 34, 24, 0.28); }
.case__cover:hover img,
.case__cover:focus-visible img { transform: scale(1.03); }
.case__cover:focus-visible {
  outline: 2px solid var(--color-clay);
  outline-offset: 4px;
}

.case__play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-pill);
  background: rgba(250, 246, 239, 0.94);
  color: var(--color-walnut);
  transform: translate(-50%, -50%);
  transition: transform var(--dur-base) var(--ease),
              background-color var(--dur-base) var(--ease);
}
.case__play svg { width: 22px; height: 22px; margin-left: 4px; fill: currentColor; }
.case__cover:hover .case__play,
.case__cover:focus-visible .case__play {
  transform: translate(-50%, -50%) scale(1.07);
  background: var(--color-cream);
}

.case__cover-label {
  position: absolute;
  z-index: 1;
  left: 1.25rem;
  bottom: 1.1rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-walnut-soft);
}
.case__cover.has-image .case__cover-label { color: var(--color-cream); }

/* Mit Titelbild steht der Play-Knopf unten links neben der Beschriftung, weil
   die Titelbilder ihren Einstiegstext meist mitten im Bild haben */
.case__cover.has-image .case__play {
  top: auto;
  left: 1.25rem;
  bottom: 1.1rem;
  width: 52px;
  height: 52px;
  transform: none;
}
.case__cover.has-image .case__play svg { width: 16px; height: 16px; margin-left: 3px; }
.case__cover.has-image:hover .case__play,
.case__cover.has-image:focus-visible .case__play { transform: scale(1.07); }
.case__cover.has-image .case__cover-label {
  left: calc(1.25rem + 52px + 0.85rem);
  bottom: calc(1.1rem + 26px);
  transform: translateY(50%);
}

/* Kennzahlen: große Zahlen, nur durch Abstand getrennt (keine Linien) ----- */
.case__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 5vw, 2.25rem) clamp(1.25rem, 2.5vw, 2rem);
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
}
.kpi {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.7rem;
  container-type: inline-size;
}
/* ungerade Anzahl in zwei Spalten: letzter Block über die volle Breite */
.case__kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .case__kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case__kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .case__kpis--3 > .kpi:last-child:nth-child(odd) { grid-column: auto; }
}
/* Zahl wächst mit der Breite des Blocks, damit auch „2,3 Mio.“ nicht umbricht */
.kpi__value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 3vw + 1.25rem, 4.25rem);
  font-size: clamp(2.5rem, 34cqi, 4.75rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--color-walnut);
}
.kpi__label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.35;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-transform: uppercase;
  color: var(--color-stone);
}

/* Angaben zu Marke, Creator und Plattform -------------------------------- */
.case__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem 2rem;
  margin: 0;
}
.case__meta dt {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-stone);
}
.case__meta dd {
  margin: 0.25rem 0 0;
  font-weight: 600;
  color: var(--color-walnut);
}
.case__handle {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-stone);
}
a.case__handle:hover { color: var(--color-clay); }

/* Ausgangslage, Umsetzung, Ergebnis als nummerierte Schritte -------------- */
.case__story {
  display: grid;
  gap: clamp(1.75rem, 3vw, 2.5rem);
  margin: clamp(2.25rem, 4vw, 3rem) 0 0;
  padding: 0;
  list-style: none;
}
/* mobil: Nummer neben der Überschrift, Text darunter über die volle Breite */
.case__step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.85rem;
  align-items: baseline;
}
.case__step-text { display: contents; }
.case__step h3 { grid-column: 2; }
.case__step p { grid-column: 1 / -1; }
.case__step h3 + p { margin-top: 0.6rem; }
/* breiter: Nummer in einer eigenen Spalte links */
@media (min-width: 600px) {
  .case__step {
    grid-template-columns: 3.25rem minmax(0, 1fr);
    column-gap: 1.5rem;
    align-items: start;
  }
  .case__step-text { display: block; grid-column: 2; }
  .case__step h3 { margin: 0.2rem 0 0.6rem; }
  .case__step h3 + p { margin-top: 0; }
}
.case__step-nr {
  font-size: clamp(1.6rem, 1.6vw + 1.1rem, 2.6rem);
  font-weight: 300;
  line-height: 1;
  color: var(--color-clay);
}
.case__step h3 {
  font-size: clamp(1.25rem, 0.5vw + 1.1rem, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
}
.case__step p {
  max-width: 62ch;
  color: var(--color-walnut-soft);
  line-height: 1.75;
}

/* Screenshots aus den Insights ------------------------------------------- */
.case__insights { margin-top: clamp(3rem, 6vw, 4rem); }
.case__insights-title {
  font-size: clamp(1.25rem, 0.5vw + 1.1rem, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
}
.case__insights-note {
  margin: 0.4rem 0 0;
  font-size: var(--text-sm);
  color: var(--color-stone);
}
.insights {
  display: flex;
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: flex-start;
  margin-top: 1.5rem;
}
.insights__hoch {
  flex: 0 0 30%;
  display: grid;
  gap: 1.25rem;
}
.insights__quer {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  gap: 1.25rem;
}
@media (max-width: 559px) {
  .insights { flex-direction: column; }
  .insights__hoch,
  .insights__quer { flex: none; width: 100%; }
  /* Hochformat mobil halb so breit, Bildunterschrift daneben */
  .insight--hoch {
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
  }
  .insight--hoch figcaption { margin-top: 0; }
}
.insight { margin: 0; }
/* Screenshots ohne Rahmen, nur mit dem gleichen weichen Schatten wie oben */
.insight__zoom {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--color-white);
  border: 0;
  cursor: zoom-in;
  box-shadow:
    0 1px 2px rgba(43, 34, 25, 0.05),
    0 12px 28px -14px rgba(43, 34, 25, 0.2);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.insight__zoom img {
  width: 100%;
  height: auto;
}
.insight__zoom:hover,
.insight__zoom:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    0 2px 4px rgba(43, 34, 25, 0.05),
    0 20px 40px -16px rgba(43, 34, 25, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  .insight__zoom:hover,
  .insight__zoom:focus-visible { transform: none; }
}
.insight__zoom:focus-visible { outline: 2px solid var(--color-clay); outline-offset: 3px; }
.insight figcaption {
  margin-top: 0.6rem;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-stone);
}

/* Link zum Original-Posting ohne Unterstreichungslinie (keine Linien auf
   dieser Seite), Hover färbt den Text und schiebt den Pfeil */
.case__post { margin-top: 2rem; padding-bottom: 0; }
.case__post::after { display: none; }
.case__post:hover,
.case__post:focus-visible { color: var(--color-clay); }

/* Noch offene Angaben aus case-studies-data.js --------------------------- */
.cs-offen {
  padding: 0 0.2em;
  background: var(--color-clay-soft);
  color: var(--color-walnut);
}

/* Abschluss mit zwei CTAs ------------------------------------------------- */
.cs-cta__title {
  max-width: 24ch;
  margin: 0 auto;
  text-align: center;
}
/* zwei Spalten, nur durch Abstand getrennt (keine Linien) */
.cs-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(3rem, 8vw, 4rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}
.cs-cta__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
@media (min-width: 880px) {
  .cs-cta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(4rem, 8vw, 8rem);
  }
}
.cs-cta__label {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-clay-soft);
}
.cs-cta__card h3 {
  font-size: clamp(1.5rem, 1.25vw + 1rem, 2rem);
  font-weight: 300;
  color: var(--color-cream);
}
.cs-cta__card h3 strong { font-weight: 600; }
.cs-cta__card p {
  max-width: 44ch;
  margin: 0 0 0.75rem;
  color: rgba(250, 246, 239, 0.82);
  line-height: 1.7;
}
.cs-cta__card .btn { margin-top: auto; }

/* Lightbox für Videos und Screenshots ------------------------------------ */
html.cs-lock,
html.cs-lock body { overflow: hidden; }

.cs-lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 4.5rem 1rem 1.5rem;
  border: 0;
  background: transparent;
  color: var(--color-cream);
}
.cs-lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: cs-fade var(--dur-base) var(--ease);
}
.cs-lightbox::backdrop { background: rgba(42, 34, 24, 0.92); }

.cs-lightbox__video {
  display: block;
  width: auto;
  height: min(78vh, 860px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}
.cs-lightbox__bild {
  display: none;
  width: auto;
  height: auto;
  max-width: min(100%, 900px);
  max-height: 78vh;
  background: var(--color-white);
}
.cs-lightbox.is-bild .cs-lightbox__video { display: none; }
.cs-lightbox.is-bild .cs-lightbox__bild { display: block; }

.cs-lightbox__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 0;
  font-size: var(--text-sm);
  text-align: center;
}
.cs-lightbox__title { font-weight: 600; }
.cs-lightbox__post {
  color: var(--color-clay-soft);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.cs-lightbox__post:hover,
.cs-lightbox__post:focus-visible { color: var(--color-cream); }
.cs-lightbox__post[hidden] { display: none; }
.cs-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  background: rgba(250, 246, 239, 0.14);
  color: var(--color-cream);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.cs-lightbox__close:hover,
.cs-lightbox__close:focus-visible {
  background: var(--color-cream);
  color: var(--color-walnut);
  outline: none;
}
.cs-lightbox__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

@keyframes cs-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
