@layer components {
  .cb-hero {
    display: grid;
    align-items: center;
    min-height: clamp(22rem, 55vh, 40rem);
    padding-inline: var(--container-padding);
    justify-items: center;
  }

  .cb-frame--width-full .cb-hero,
  .cb-frame--scope-page.cb-frame--bg-image .cb-hero {
    padding-inline: 0;
  }

  /* Höhe (Mindesthöhe – längerer Inhalt darf den Hero vergrößern) */
  .cb-hero--height-auto {
    min-height: 0;
  }

  .cb-hero--height-small {
    min-height: clamp(16rem, 40svh, 28rem);
  }

  .cb-hero--height-large {
    min-height: clamp(26rem, 75svh, 56rem);
  }

  .cb-hero--height-screen {
    min-height: 100vh;
    min-height: 100svh;
    padding-block: var(--space-xl);
  }

  /* Inhalt vertikal */
  .cb-hero--content-top {
    align-items: start;
  }

  .cb-hero--content-center {
    align-items: center;
  }

  .cb-hero--content-bottom {
    align-items: end;
  }

  .cb-hero--center {
    text-align: center;
  }

  .cb-hero--left {
    text-align: left;
    justify-items: start;
  }

  /* Textfarben */
  .cb-hero--text-light {
    color: #ffffff;
  }

  /* Base typography colours every heading with --color-text; follow the chosen text colour instead */
  .cb-hero--text-light .cb-hero__title,
  .cb-hero--text-dark .cb-hero__title {
    color: inherit;
  }

  .cb-hero--text-light .cb-hero__subtitle {
    font-family: var(--font-family-body);
    color: color-mix(in srgb, #ffffff, transparent 18%);
  }

  .cb-hero--text-light .cb-hero__text {
    color: color-mix(in srgb, #ffffff, transparent 10%);
  }

  .cb-hero--text-dark {
    color: #1a1a1a;
  }

  .cb-hero--text-dark .cb-hero__subtitle {
    font-family: var(--font-family-body);
    color: color-mix(in srgb, #1a1a1a, transparent 18%);
  }

  .cb-hero--text-dark .cb-hero__text {
    color: color-mix(in srgb, #1a1a1a, transparent 10%);
  }

  /* Buttons für helle Textfarbe anpassen */
  .cb-hero--text-light .onepager-button {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
  }

  .cb-hero--text-light .onepager-button:hover,
  .cb-hero--text-light .onepager-button:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .cb-hero--text-light .onepager-button--primary {
    background: #ffffff;
    color: var(--color-blue-900);
    border-color: #ffffff;
  }

  .cb-hero--text-light .onepager-button--primary:hover,
  .cb-hero--text-light .onepager-button--primary:focus-visible {
    background: rgba(255, 255, 255, 0.9);
  }

  .cb-hero__content {
    width: min(100%, 52rem);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
  }

  .cb-hero--center .cb-buttons {
    justify-content: center;
  }

  .cb-hero__title {
    margin: 0;
    font-size: var(--font-size-h1);
  }

  .cb-hero__subtitle {
    margin: 0; 
    margin-block-start: 1rem;
    text-transform: unset;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-body);
    font-size: var(--font-size-h3);
    line-height: var(--line-height-tight);
    color: color-mix(in srgb, currentColor, transparent 18%);
  }

  .cb-hero__text {
    color: color-mix(in srgb, currentColor, transparent 10%);
    line-height: 1.6;
    font-size: clamp(1rem, 1.05rem, 1.125rem);
  }

  .cb-hero__content .cb-buttons {
    margin-block-start: var(--space-2);
  }
}

/* Vollbild: Rahmenabstand nicht zusätzlich zur Bildschirmhöhe addieren.
   Bewusst ohne @layer, weil die Abstands-Klassen (.cb-frame--py-*) in content-blocks.css ebenfalls ungelayert sind. */
.cb-frame:has(.cb-hero--height-screen) {
    --cb-frame-padding-y: 0;
}

.cb-frame:has(.cb-hero--height-screen) .ce-shell__band {
    border-block-width: 0;
}

/* „Am Seitenanfang beginnen“: nur wenn der Hero das erste Element der Seite ist
   (erster Inhalt in der Stage oder im Hauptinhalt). Navigation schwebt fixiert darüber. */
.site-frame:has(
    > .site-main > .site-section:first-child > .site-content > .cb-frame:first-child .cb-hero--start-top,
    > .site-main > .site-section--stage:first-child > .cb-frame:first-child .cb-hero--start-top
) > .site-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 50;
}

.site-frame:has(
    > .site-main > .site-section:first-child > .site-content > .cb-frame:first-child .cb-hero--start-top,
    > .site-main > .site-section--stage:first-child > .cb-frame:first-child .cb-hero--start-top
) > .site-header + .site-main {
    margin-block-start: 0;
}

/* Inhalt nicht unter der Navigation verstecken */
.site-frame:has(
    > .site-main > .site-section:first-child > .site-content > .cb-frame:first-child .cb-hero--start-top,
    > .site-main > .site-section--stage:first-child > .cb-frame:first-child .cb-hero--start-top
) .cb-hero--start-top {
    padding-block-start: calc(var(--header-offset) + var(--space-s));
}
