/* Scoped block CSS — plain CSS, served as-is, no Tailwind rebuild needed.
   Visual reference: `hero()` in the Karriere prototype
   (Documentation/Generated/karriere.html on prototype/karriere-page).

   One band on brand navy. Below lg the copy and the video stack in source
   order; from lg up they sit side by side, copy left, 16:9 video right —
   or, without a video, the poster as a still image in the same box.

   `hero-split--background` ("Medien als Hintergrund", #57) lifts that same
   media box out of the grid to cover the whole band, under a navy scrim.
   The copy keeps its grid cell — its left half from lg up — so its position
   and styling do not change between the two modes.

   The full-bleed breakout (`-mx-4 lg:-mx-24 -mt-10 lg:-mt-24 …`) is done with
   the same compiled Tailwind classes hero-video uses, so the two heroes keep
   moving together if the page wrapper's padding changes. Everything inside
   the band lives here.

   The colours are the brand literals with the theme variables layered on top
   where the site theme should win (secondary = CTA, tertiary = highlight).
   The band itself is `--hero-split-band`, the site's `page.color.hero_band`
   (set on the page wrapper; brand navy unless a site picks its own). The
   scrim mixes the same colour, so band and scrim always match. */

.hero-split {
  --hero-split-band-color: var(--hero-split-band, #03305d);
  background: var(--hero-split-band-color);
  color: #fff;
  overflow: hidden;
  /* Shared .kicker (layout.css) is brand green by default; on navy it is
     muted white, as in the prototype's hero. */
  --kicker-color: rgba(255, 255, 255, 0.7);
}

.hero-split__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  gap: 2rem;
  align-items: center;
}

/* "An Inhaltsbreite ausrichten": no 80rem cap, and the page wrapper's own
   padding (`p-4 lg:p-24` in Page/Default.html), so the copy and the media
   edge line up with the content elements below. The band itself already
   stops at the wrapper's max-w-screen-2xl. */
.hero-split--content-width .hero-split__inner {
  max-width: none;
  padding-inline: 1rem;
}

.hero-split__claim {
  margin: 0;
  color: #fff;
  font-weight: 300;
  line-height: 1.08;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  text-wrap: balance;
}

.hero-split__claim-highlight {
  display: block;
  font-weight: 500;
  color: var(--theme-tertiary, #00b388);
}

.hero-split__sub {
  margin: 0.9rem 0 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.hero-split__actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.hero-split__button {
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
}

/* The filled first button. Its colours come from the editor's "Farbe" token
   (button.color, EditorInterface.yaml) as a `--color-*` modifier; each
   modifier only sets the custom properties, so box and hover/focus rules
   stay in one place. The 2px border is transparent except for `outline`;
   the padding gives it back so every variant has the same size. */
.hero-split__button--primary {
  --button-bg: var(--theme-secondary, #ff7e47);
  --button-fg: var(--theme-primary, #03305d);
  --button-border: transparent;
  --button-hover-bg: #fff;
  --button-hover-fg: var(--theme-primary, #03305d);
  display: inline-block;
  padding: calc(0.8rem - 2px) calc(1.6rem - 2px);
  border: 2px solid var(--button-border);
  border-radius: 0.375rem;
  background: var(--button-bg);
  color: var(--button-fg);
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

/* The prototype's hover fell back to navy-on-navy; every variant inverts
   to a fill that stays visible on the band. */
.hero-split__button--primary:hover,
.hero-split__button--primary:focus-visible {
  background: var(--button-hover-bg);
  border-color: var(--button-hover-bg);
  color: var(--button-hover-fg);
}

/* `default` is the base rule above: dark text on the secondary fill. White
   on it is 2.7:1 (byteWerft green) or 2.5:1 (DNW orange), below WCAG AA's
   4.5:1; the primary colour reaches 5.1:1 / 5.3:1. Same reasoning as the
   contact card's button. */

/* `light-text`: white on the secondary fill, the editor's call despite the
   contrast above (the field description says so). */
.hero-split__button--color-light-text {
  --button-fg: #fff;
}

/* `tertiary`: white on the claim highlight's colour, so the button picks up
   the green line above it. 2.7:1 on #00b388, below WCAG AA like
   `light-text` — the editor's call. */
.hero-split__button--color-tertiary {
  --button-bg: var(--theme-tertiary, #00b388);
  --button-fg: #fff;
}

/* `white`: navy on white is 12.6:1. Hovers to the secondary fill with dark
   text, i.e. the default look. */
.hero-split__button--color-white {
  --button-bg: #fff;
  --button-hover-bg: var(--theme-secondary, #ff7e47);
}

/* `outline`: white text and border on the band itself (12.6:1 on navy;
   over a background medium it is as legible as the copy, i.e. the scrim's
   job). Fills white on hover. */
.hero-split__button--color-outline {
  --button-bg: transparent;
  --button-fg: #fff;
  --button-border: #fff;
}

.hero-split__button--secondary {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero-split__button--secondary:hover,
.hero-split__button--secondary:focus-visible {
  color: var(--theme-tertiary, #00b388);
}

.hero-split__button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.hero-split__media {
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero-split__video,
.hero-split__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Background mode. The scrim is the media box's ::after, so it always
   covers exactly what the media covers. Its strength is the editor's
   "Abdunkelung (%)", 0–100 on `--hero-split-scrim` (inline style); 0 is
   allowed and means no tint at all — readability is the editor's call.
   Below lg the copy can sit anywhere over the media, so the tint is
   uniform. At the default 90 the muted kicker and the green highlight keep
   WCAG AA over a white frame. */
.hero-split--background {
  --hero-split-scrim-alpha: calc(var(--hero-split-scrim, 90) / 100);
  position: relative;
  /* Lets the min-height below measure the band, not the viewport (100vw
     would count a classic scrollbar). */
  container-type: inline-size;
}

.hero-split--background .hero-split__media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.hero-split--background .hero-split__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(
    in srgb,
    var(--hero-split-band-color) calc(var(--hero-split-scrim-alpha) * 100%),
    transparent
  );
}

/* "Unschärfe (px)", 0–20 on `--hero-split-blur`. A blur fades the medium's
   own edges to transparent, which would show the navy band as a soft halo
   round the frame; the medium therefore overhangs the media box by twice the
   radius on every side, and the box's overflow: hidden crops it back.
   object-fit: cover keeps the enlarged frame filled. */
.hero-split--blurred .hero-split__video,
.hero-split--blurred .hero-split__image {
  --hero-split-blur-px: calc(var(--hero-split-blur, 0) * 1px);
  position: absolute;
  inset: calc(var(--hero-split-blur-px) * -2);
  width: calc(100% + var(--hero-split-blur-px) * 4);
  height: calc(100% + var(--hero-split-blur-px) * 4);
  filter: blur(var(--hero-split-blur-px));
}

.hero-split--background .hero-split__copy {
  position: relative;
  z-index: 1;
}

@media (min-width: 1024px) {
  .hero-split__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 3.5rem 2rem;
  }

  /* Without the 16:9 column the band would shrink to the copy. Keep the
     split layout's height: half the inner width (minus padding and gap)
     at 16:9, plus the vertical padding. */
  .hero-split--background .hero-split__inner {
    min-height: calc((min(100cqi, 80rem) - 6rem) * 9 / 32 + 7rem);
  }

  .hero-split--content-width .hero-split__inner {
    padding-inline: 6rem;
  }

  /* Same height rule for the content-width box: the full band, minus
     2 × 6rem padding and the 2rem gap. */
  .hero-split--background.hero-split--content-width .hero-split__inner {
    min-height: calc((100cqi - 14rem) * 9 / 32 + 7rem);
  }

  /* The copy column ends just short of the band's middle at every width
     (the inner box is centred). The scrim holds the editor's strength
     behind the first 40% of it, then thins out to 30% of that strength at
     the right edge, so the media shows across the whole band — darker where
     the text is. 0 still means no tint anywhere. */
  .hero-split--background .hero-split__media::after {
    background: linear-gradient(
      to right,
      color-mix(
          in srgb,
          var(--hero-split-band-color)
            calc(var(--hero-split-scrim-alpha) * 100%),
          transparent
        )
        0%,
      color-mix(
          in srgb,
          var(--hero-split-band-color)
            calc(var(--hero-split-scrim-alpha) * 100%),
          transparent
        )
        40%,
      color-mix(
          in srgb,
          var(--hero-split-band-color)
            calc(var(--hero-split-scrim-alpha) * 30%),
          transparent
        )
        100%
    );
  }
}

/* The news detail hero (Extensions/News/Partials/Detail/HeroSplit.html).
   The body text follows straight on, without a heading of its own (and
   without its 25px top padding, News/Detail.html): a smaller gap than the
   content block's mb-8 / lg:mb-24. */
.hero-split--news {
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .hero-split--news {
    margin-bottom: 4rem;
  }
}

@media (min-width: 1536px) {
  .hero-split {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
  }
}

/* Negative top margin and rounded top corners fit the hero that opens the
   page to the header and the panel's corners. A band further down the
   content (the Lions start page's sponsor of the day) would slide over the
   element above it and show two rounded corners mid-page. Only direct
   children of the page's .frontend-content: the news detail hero sits inside
   the plugin's own markup and always opens its page. */
.frontend-content > .hero-split:not(:first-child) {
  margin-top: 0;
  border-radius: 0;
}
