/* =====================================================================
   hero.css · Hero-System der Branchen-Demos (Variante B)

   Ein Baustein für alle Demos. Farben, Schrift und Bildausschnitt kommen
   über Variablen im style-Attribut der Sektion:
     --hb-akzent      Grund des Handlungsaufrufs
     --hb-auf-akzent  Schrift auf dem Handlungsaufruf (mind. 4,5:1)
     --hb-hervor      kursiver Akzent in der Überschrift (hell, auf Dunkel)
     --hb-scrim       Farbe des Verlaufs als RGB-Tripel, z. B. 18 18 20
     --hb-schrift     Schrift der Überschrift
     --hb-fokus       Bildausschnitt Desktop (object-position)
     --hb-fokus-m     Bildausschnitt mobil
     --hb-rund        Rundung des Buttons
     --hb-gewicht     Schriftgewicht der Überschrift
     --hb-em-stil     italic oder normal (Schriften ohne echten Kursivschnitt)

   Der Text haengt oben (feste Oberkante), damit ein spaeter Schriftwechsel
   nur die Zeilen darunter verschiebt und nicht den ganzen Block (CLS).

   Grundsatz: Sichtbar ist der Normalzustand. Nichts startet unsichtbar,
   kein Skript wird gebraucht. Bewegung gibt es nur als Transform und nur,
   wenn niemand reduzierte Bewegung eingestellt hat.
   ===================================================================== */

.hb {
  --hb-akzent: #ffffff;
  --hb-auf-akzent: #111111;
  --hb-hervor: #ffffff;
  --hb-scrim: 16 16 18;
  --hb-schrift: inherit;
  --hb-fokus: 50% 50%;
  --hb-fokus-m: var(--hb-fokus);
  --hb-rund: 999px;
  --hb-weich: cubic-bezier(.2, .7, .1, 1);

  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  min-height: clamp(34rem, 82svh, 58rem);
  overflow: hidden;
  color: #fff;
  background: rgb(var(--hb-scrim));
}

/* ---------- Bild und Verlauf ------------------------------------------ */

.hb-bild {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--hb-fokus);
}

.hb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg,
      rgb(var(--hb-scrim) / .9) 0%,
      rgb(var(--hb-scrim) / .8) 40%,
      rgb(var(--hb-scrim) / .36) 66%,
      rgb(var(--hb-scrim) / .08) 100%),
    linear-gradient(0deg, rgb(var(--hb-scrim) / .55) 0%, rgb(var(--hb-scrim) / 0) 45%);
  pointer-events: none;
}

/* ---------- Inhalt ---------------------------------------------------- */

.hb-in {
  position: relative;
  width: min(100% - 2 * clamp(1rem, 4vw, 2.5rem), 78rem);
  margin-inline: auto;
  padding-block: clamp(5rem, 14vh, 9rem) clamp(2.5rem, 7vh, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 2.5rem;
}

.hb-text { max-width: 40rem; }

.hb-marke {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .2em;
  line-height: 1.4;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .9);
}
.hb-marke::before {
  content: "";
  flex: 0 0 28px;
  height: 1.5px;
  background: var(--hb-hervor);
}

.hb-titel {
  margin: 22px 0 0;
  max-width: 13ch;
  font-family: var(--hb-schrift);
  font-size: clamp(2.5rem, 1.35rem + 4.6vw, 5.6rem);
  font-weight: var(--hb-gewicht, 600);
  line-height: 1.02;
  letter-spacing: -.01em;
  color: #fff;
  text-wrap: balance;
  hyphens: manual;
}
.hb-titel em {
  font-style: var(--hb-em-stil, italic);
  color: var(--hb-hervor);
}

.hb-lead {
  margin: 22px 0 0;
  max-width: 34rem;
  font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, .9);
  text-wrap: pretty;
}

.hb-tun { margin-top: 34px; }

.hb-knopf {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-height: 52px;
  padding: 0 1.6rem;
  border-radius: var(--hb-rund);
  background: var(--hb-akzent);
  color: var(--hb-auf-akzent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  transition: transform .35s var(--hb-weich), box-shadow .35s var(--hb-weich);
}
.hb-knopf svg { width: 16px; height: 16px; flex: none; transition: transform .35s var(--hb-weich); }
.hb-knopf:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .7); }
.hb-knopf:hover svg { transform: translateX(3px); }
.hb-knopf:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.hb-belege {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.6rem;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: .92rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, .88);
}
.hb-belege li { display: flex; align-items: baseline; gap: .5rem; }
.hb-belege li::before {
  content: "";
  flex: none;
  width: .7em;
  height: .38em;
  border-left: 2px solid var(--hb-hervor);
  border-bottom: 2px solid var(--hb-hervor);
  transform: translateY(-.2em) rotate(-45deg);
}
.hb-belege b { color: #fff; font-weight: 700; }

/* ---------- Einschub (zweites Bild oder Infokarte, nur breit) --------- */

.hb-einschub {
  display: none;
  margin: 0;
}

/* ---------- Schild «fiktiv» ------------------------------------------- */

.hb-fiktiv {
  position: absolute;
  top: clamp(.9rem, 2.5vh, 1.5rem);
  right: clamp(1rem, 4vw, 2.5rem);
  z-index: 1;
  margin: 0;
  padding: .38rem .8rem;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
}

/* ---------- Breit: Einschub neben dem Text ---------------------------- */

@media (min-width: 64rem) {
  .hb-in { grid-template-columns: minmax(0, 1fr) clamp(15rem, 22vw, 20rem); }
  .hb-einschub {
    display: block;
    justify-self: end;
    width: 100%;
    color: #fff;
  }
  .hb-einschub img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, .3);
    box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .8);
  }
  /* Bildlegende haengt unter dem Bild, ohne die Hoehe mitzubestimmen:
     ein Schriftwechsel in der Legende verschiebt so nichts (CLS). */
  figure.hb-einschub { position: relative; }
  .hb-einschub figcaption {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: .7rem;
    font-size: .8rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, .86);
    text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
  }
  /* Infokarte statt Bild */
  .hb-karte {
    padding: 1.3rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, .26);
    background: rgb(var(--hb-scrim) / .82);
    box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .8);
    font-size: .9rem;
    line-height: 1.45;
  }
  .hb-karte .hb-karte-titel {
    margin: 0 0 .8rem;
    font-family: inherit;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hb-hervor);
  }
  .hb-karte dl { margin: 0; display: grid; gap: .55rem; }
  .hb-karte dl div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(255, 255, 255, .14); padding-bottom: .5rem; }
  .hb-karte dt { color: rgba(255, 255, 255, .82); }
  .hb-karte dd { margin: 0; font-weight: 700; color: #fff; text-align: right; }
  .hb-karte p { margin: .8rem 0 0; font-size: .8rem; color: rgba(255, 255, 255, .8); }
}

/* ---------- Schmal: senkrechter Verlauf, eigener Bildausschnitt ------- */

@media (max-width: 47.99rem) {
  .hb { min-height: clamp(30rem, 70svh, 44rem); }
  .hb-bild { object-position: var(--hb-fokus-m); }
  .hb::before {
    background: linear-gradient(180deg,
      rgb(var(--hb-scrim) / .3) 0%,
      rgb(var(--hb-scrim) / .68) 18%,
      rgb(var(--hb-scrim) / .9) 40%,
      rgb(var(--hb-scrim) / .96) 100%);
  }
  .hb-in { padding-block: 5.5rem 2rem; }
  .hb-fiktiv { left: clamp(1rem, 4vw, 2.5rem); right: auto; }
  .hb-titel { max-width: 14ch; }
  .hb-knopf { width: 100%; justify-content: center; }
  .hb-belege { gap: .45rem 1.2rem; font-size: .88rem; }
}

/* ---------- Bewegung: nur Transform, nur wenn erwünscht --------------- */

@media (prefers-reduced-motion: no-preference) {
  .hb-bild { animation: hb-bild 1.6s var(--hb-weich) both; }
  .hb-text { animation: hb-text 1.1s var(--hb-weich) both; }
  .hb-einschub { animation: hb-text 1.1s .12s var(--hb-weich) both; }
  @keyframes hb-bild { from { transform: scale(1.045); } to { transform: none; } }
  @keyframes hb-text { from { transform: translateY(18px); } to { transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .hb-knopf, .hb-knopf svg { transition: none; }
  .hb-knopf:hover { transform: none; }
}

@media print {
  .hb { min-height: 0; color: #000; background: none; }
  .hb::before, .hb-bild, .hb-einschub, .hb-fiktiv { display: none; }
  .hb-titel, .hb-lead, .hb-belege, .hb-belege b, .hb-marke { color: #000; }
}
