/* ------------------------------------------------------------------
 * Case-Study-Scaffolding
 * Styles fuer Interview-Block und sichtbare Platzhalter.
 * Eingebettet via head.php — kein Build-Schritt noetig.
 * ------------------------------------------------------------------ */

/* Interview-Block ------------------------------------------------- */
.interview {
  margin: 1.5rem 0;
}

.interview__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.interview__avatar {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.interview__interviewee {
  font-family: 'Headline', serif;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.interview__intro {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  opacity: 0.9;
}

.interview__pairs {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  border-left: 2px solid currentColor;
  padding-left: 1.5rem;
  margin: 0;
}

.interview__pair {
  break-inside: avoid;
}

.interview__question {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-family: 'Headline', serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.interview__qmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border: 1.5px solid currentColor;
  border-radius: 9999px;
  font-size: 0.8em;
  font-style: normal;
  font-family: 'GeneralSans', sans-serif;
  font-weight: 600;
  opacity: 0.65;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.interview__answer {
  margin-left: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.interview__speaker {
  margin-top: 0.65rem;
  opacity: 0.6;
  font-size: 0.9em;
}

/* Quote-Block ----------------------------------------------------- */
.quote {
  margin: 1.5rem 0;
  padding: 0;
}

.quote__text {
  margin: 0;
  font-family: 'Headline', serif;
  line-height: 1.25;
  font-style: italic;
  position: relative;
}

.quote__text > *:first-child {
  margin-top: 0;
}
.quote__text > *:last-child {
  margin-bottom: 0;
}

/* Sizes */
.quote--normal .quote__text {
  font-size: 1.35rem;
}

.quote--large .quote__text {
  font-size: 2rem;
  line-height: 1.2;
}

.quote--xl .quote__text {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

@media (min-width: 768px) {
  .quote--large .quote__text {
    font-size: 2.25rem;
  }
  .quote--xl .quote__text {
    font-size: 2rem;
  }
}

@media (min-width: 1280px) {
  .quote--xl .quote__text {
    font-size: 2.5rem;
  }
}

/* Alignment */
.quote--center {
  text-align: center;
}
.quote--center .quote__attribution {
  justify-content: center;
}

.quote--left {
  text-align: left;
}

/* Variants */
.quote--default .quote__text::before {
  content: '\201C';
  font-family: 'Headline', serif;
  font-size: 1.4em;
  line-height: 0.9;
  vertical-align: -0.05em;
  margin-right: 0.05em;
  opacity: 0.55;
}

.quote--default .quote__text::after {
  content: '\201D';
  font-family: 'Headline', serif;
  font-size: 1.4em;
  line-height: 0.9;
  vertical-align: -0.2em;
  margin-left: 0.05em;
  opacity: 0.55;
}

.quote--block .quote__text {
  border-left: 3px solid currentColor;
  padding-left: 1.5rem;
  font-style: italic;
}

.quote--pull .quote__text {
  font-style: normal;
  font-weight: 700;
}

/* Statement: gleiche Typografie wie das Pullquote, aber ohne Zitat-Semantik
 * im Markup. Fuer eigene Kernaussagen, die niemand gesagt hat. */
.quote--statement .quote__text {
  font-style: normal;
  font-weight: 700;
}

/* Mark: grosses Zitat, Zitatzeichen als eigene Spalte links vom Text.
 * figure::before wird zum Grid-Element und traegt die Marke, Text und
 * Attribution stehen darunter in der zweiten Spalte. */
.quote--mark {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: clamp(0.75rem, 2.5vw, 2rem);
  text-align: left;
  margin: 2rem 0 3rem;
}

.quote--mark::before {
  content: '\201C';
  grid-column: 1;
  grid-row: 1;
  font-family: 'Headline', serif;
  font-size: clamp(4.5rem, 11vw, 8rem);
  line-height: 0.72;
  color: #facc15;
  align-self: start;
  /* Die Marke sitzt in der Schrift hoch; der Versatz zieht sie auf die
   * Oberkante der ersten Textzeile. */
  margin-top: -0.06em;
  user-select: none;
}

.quote--mark .quote__text,
.quote--mark .quote__attribution {
  grid-column: 2;
}

.quote--mark .quote__text {
  font-style: normal;
  font-weight: 500;
  text-wrap: pretty;
}

.quote--mark .quote__text::before,
.quote--mark .quote__text::after {
  content: none;
}

/* Die Attribution klebte bisher unter dem Zitat. */
.quote--mark .quote__attribution {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 20%, transparent);
}

.quote--mark.quote--center {
  text-align: left;
}
.quote--mark.quote--center .quote__attribution {
  justify-content: flex-start;
}

@media (max-width: 640px) {
  /* Auf schmalen Schirmen frisst die Marke zu viel Breite: sie ruecht
   * ueber den Text statt daneben. */
  .quote--mark {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }
  .quote--mark::before {
    grid-column: 1;
    font-size: 4rem;
  }
  .quote--mark .quote__text,
  .quote--mark .quote__attribution {
    grid-column: 1;
  }
}

/* Subtle: laengere Zitate in Body-Schrift, dezent gerahmt */
.quote--subtle .quote__text {
  font-family: 'GeneralSans', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.5;
  letter-spacing: 0;
  border-left: 3px solid #facc15;
  padding-left: 1.5rem;
  text-align: left;
}

@media (min-width: 768px) {
  .quote--subtle .quote__text {
    font-size: 1.5rem;
  }
}

/* Anfuehrungszeichen in subtle ausblenden */
.quote--subtle .quote__text::before,
.quote--subtle .quote__text::after {
  content: none;
}

/* In subtle-Variante linksbuendig, auch wenn Block center-aligned */
.quote--subtle.quote--center {
  text-align: left;
}
.quote--subtle.quote--center .quote__attribution {
  justify-content: flex-start;
  padding-left: 1.5rem;
}

/* Attribution */
.quote__attribution {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.85rem;
  font-family: 'GeneralSans', sans-serif;
  font-style: normal;
  font-size: 0.9rem;
}

.quote__avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.quote__attribution-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.quote__name {
  font-weight: 600;
}

.quote__role {
  opacity: 0.75;
  font-size: 0.9em;
}

.quote__source {
  opacity: 0.6;
  font-size: 0.82em;
  margin-top: 0.15rem;
  font-style: italic;
}

/* Middleware-Diagramm ------------------------------------------- */
/*
 * Block: middlewareDiagram
 * Reduzierte Palette: monochrom (grau/schwarz) + gelber Akzent (#facc15)
 * fuer Highlights (Webhook-Flow, Schluesselelemente). Keine weiteren
 * Farben — passt zur Site (cropmarks/colorramps in #facc15 + #ff00ff).
 */
.middleware-diagram {
  --md-fill:        #F5F5F2;            /* default fill */
  --md-fill-soft:   #ffffff;            /* alternative fill */
  --md-fill-acc:    #FEF3C7;            /* gelber Akzent (yellow-100) */
  --md-stroke:      #4B5563;            /* default border */
  --md-stroke-soft: #9CA3AF;            /* schwacher border */
  --md-stroke-acc:  #facc15;            /* gelber Akzent */
  --md-text:        #1a1a18;            /* default text */
  --md-text-soft:   #5F5E5A;            /* secondary text */

  max-width: 760px;
  margin: 2rem auto;
  color: var(--md-text);
  line-height: 1.5;
}

/* Mobile: Diagramm bricht aus dem Container-Padding aus,
   damit die SVG mehr Breite bekommt (Tailwind: px-7 = 1.75rem). */
@media (max-width: 767px) {
  .middleware-diagram {
    margin-left: -1.75rem;
    margin-right: -1.75rem;
  }
  .middleware-diagram__header,
  .middleware-diagram__legend {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

.middleware-diagram__view {
  margin: 0 0 3rem 0;
}
.middleware-diagram__view:last-child {
  margin-bottom: 0;
}

.middleware-diagram__header {
  margin-bottom: 1.25rem;
  text-align: left;
}

.middleware-diagram__eyebrow {
  display: inline-block;
  font-family: 'GeneralSans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--md-text-soft);
  margin-bottom: 0.4rem;
}

.middleware-diagram__title {
  font-family: 'Headline', serif;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.4rem 0;
  color: var(--md-text);
}

.middleware-diagram__lead {
  font-family: 'GeneralSans', sans-serif;
  font-size: 0.95rem;
  color: var(--md-text-soft);
  margin: 0;
  max-width: 60ch;
}

.middleware-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.middleware-diagram svg text {
  font-family: 'GeneralSans', sans-serif;
}

/* Legend (Webhook-Erlaeuterungen unter Diagramm 1) */
.middleware-diagram__legend {
  list-style: none;
  margin: 1.5rem 0 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.middleware-diagram__legend-item {
  flex: 1 1 14rem;
  max-width: 22rem;
  border-left: 3px solid var(--md-stroke-acc);
  padding: 0.6rem 0.85rem;
  background: var(--md-fill);
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.middleware-diagram__legend-name {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--md-text);
}

.middleware-diagram__legend-desc {
  font-family: 'GeneralSans', sans-serif;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--md-text-soft);
}

/* Video im Textfluss / Platzhalter -------------------------------- */
/*
 * Block: videoInline
 * Faerbt sich ueber currentColor und laeuft dadurch auf hellen wie auf
 * invertierten Layouts (text-white) ohne Zusatzregel.
 */
.cs-video {
  --cs-video-pad: 56.25%;
  margin: 2rem 0;
}

.cs-video__stage {
  position: relative;
  width: 100%;
  padding-bottom: var(--cs-video-pad);
  overflow: hidden;
}

.cs-video__el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-video__caption {
  margin-top: 0.65rem;
  font-family: 'GeneralSans', sans-serif;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Platzhalter-Zustand: gestrichelter Rahmen, sehr dezente Diagonalschraffur */
.cs-video--empty .cs-video__stage {
  border: 1.5px dashed currentColor;
}

.cs-video__slot {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  background-image: repeating-linear-gradient(-45deg,
      rgba(127, 127, 127, 0.12) 0 1px,
      transparent 1px 12px);
}

.cs-video__icon {
  width: 42px;
  height: 42px;
  opacity: 0.75;
}

.cs-video__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cs-video__badge {
  font-family: 'GeneralSans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}

.cs-video__label {
  font-family: 'Headline', serif;
  font-size: 1.25rem;
  line-height: 1.2;
  max-width: 32ch;
}

.cs-video__note {
  font-family: 'GeneralSans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 46ch;
  opacity: 0.75;
}

.cs-video__ratio {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  opacity: 0.5;
  margin-top: 0.15rem;
}

@media (max-width: 767px) {
  .cs-video__label {
    font-size: 1.05rem;
  }

  .cs-video__note {
    font-size: 0.82rem;
  }

  .cs-video__icon {
    width: 32px;
    height: 32px;
  }
}

/* Video in der dritten Rasterspalte ------------------------------- */
/*
 * Setzt das Video ab Tablet in die freie dritte Spalte einer direkt
 * darueberstehenden Galerie mit drei Bildern pro Reihe. Die Werte
 * spiegeln das Galerie-Raster: 3 Spalten, gap-4 (1rem).
 *   Spaltenbreite = (100% - 2rem) / 3
 *   Kachelhoehe (Ratio 3:2) = Spaltenbreite * 2/3 = (100% - 2rem) * 2/9
 * Unterhalb md bleibt das Video volle Breite und steht normal im Fluss.
 */
@media (min-width: 768px) {
  .cs-video--third {
    width: calc((100% - 2rem) / 3);
    margin-left: auto;
    margin-top: calc((100% - 2rem) * -0.2222);
    margin-bottom: 0;
  }

  .cs-video--third .cs-video__label {
    font-size: 1rem;
  }

  .cs-video--third .cs-video__note {
    font-size: 0.78rem;
  }

  .cs-video--third .cs-video__icon {
    width: 28px;
    height: 28px;
  }

  .cs-video--third .cs-video__badge {
    font-size: 0.6rem;
  }
}

/* Video als Beiwerk ----------------------------------------------- */
/*
 * Kleiner, stumm laufender Clip neben der Aussage, zu der er gehoert.
 * Kein Bedienelement, keine eigene Buehne - er soll als bewegtes Detail
 * gelesen werden, nicht als abspielbares Video.
 */
@media (min-width: 768px) {
  .cs-video--decor {
    width: calc((100% - 2rem) / 3);
    margin-left: auto;
    margin-top: 0.75rem;
  }
}

.cs-video--decor .cs-video__caption {
  font-size: 0.8rem;
  text-align: right;
  opacity: 0.6;
}

/* Video-Paar nebeneinander ---------------------------------------- */
/*
 * Zwei aufeinanderfolgende Bloecke mit Breite "half" bilden ab Tablet
 * eine Reihe. Der zweite wird um die Hoehe des ersten hochgezogen; das
 * setzt gleiches Seitenverhaeltnis und einzeilige Bildunterschriften
 * voraus. Kein Gap-Block zwischen den beiden, sonst greift der
 * Geschwister-Selektor nicht.
 *   Breite  = 50% - 0.5rem (1rem Rinne)
 *   Hoehe   = Breite * 9/16 bei Ratio 16:9
 */
@media (min-width: 768px) {
  .cs-video--half {
    position: relative;
    width: calc(50% - 0.5rem);
    margin-bottom: 0;
  }

  /* Die Bildunterschrift darf die Figurenhoehe nicht vergroessern, sonst
     stimmt der Hochzug des zweiten Videos nicht mehr. Sie haengt deshalb
     unter der Figur statt darin. */
  .cs-video--half .cs-video__caption {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
  }

  .cs-video--half + .cs-video--half {
    margin-left: auto;
    margin-top: calc((50% - 0.5rem) * -0.5625);
    margin-bottom: 2.5rem;
  }
}

/* Abspiel-Schaltflaeche auf Videos ohne Autoplay ------------------- */
.cs-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  opacity: 1;
  transition: opacity 200ms ease;
  color: #1a1a18;
}

.cs-video__play svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cs-video__play:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 50%;
}

/* Waehrend der Wiedergabe unsichtbar und nicht im Weg, damit die native
 * Steuerleiste darunter erreichbar bleibt. */
.cs-video__stage--playable.is-playing .cs-video__play {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  .cs-video__play {
    width: 52px;
    height: 52px;
  }
}

/* Negativer Abstand (gap-Block, Option "negativ") -------------------
 * Zieht den folgenden Block nach oben, z. B. um eine Beschreibung
 * dicht unter eine grosse Kennzahl zu setzen.
 */
.gap-negative {
  margin-top: -1.75rem;
}

@media (min-width: 768px) {
  .gap-negative {
    margin-top: -2.25rem;
  }
}

@media (min-width: 1024px) {
  .gap-negative {
    margin-top: -2.75rem;
  }
}

/* Trennlinie im Textfluss (Text-Block mit <hr>) --------------------- */
.layout .prose hr {
  border: 0;
  border-top: 1px solid currentColor;
  opacity: 0.3;
  width: 8rem;
  margin: 0 auto;
}
