/* Area Hero block — Einsatzbereich detail pages. Figma 339-19569 (CONTENT, 1920x700).
   Exact desktop values from the DesignTree; responsive below.

   Geometry (Figma, section 1920 wide):
     Textblock  x=326 from the left edge, width 632  (= 1280 container, left aligned)
     H1         48/56, -0.48px, weight 500, #132140  (node 339:19578)
     Subtitle   16/24, #4f5563, max-width 518        (12px below the H1)
     CTA row    40px below the text group, height 44 (node 339:19580)
     Customers  84px below the CTA row TOP = 40px below the button (node 339:21278)
     Image      x=977, width 943 (49.11% of 1920), flush with the section top. */
.sun-area-hero {
  position: relative;
  box-sizing: border-box;
  /* Canonical first-section treatment (same as .sun-hero2 / .sun-sh--page):
     the header band fades white → page grey, everything below sits on #efefef. */
  background: linear-gradient(180deg, var(--sun-base) 0%, var(--sun-border) 100%);
  /* Top padding must clear BOTH the fixed header and the breadcrumb, which is
     absolutely positioned over the top of the first section (see breadcrumbs.css).
     Same pattern/value as .sun-case-hero. */
  padding: clamp(148px, 16vh, 172px) 0 clamp(48px, 6vw, 80px); /* bottom: stacked layouts only, see ≥1025 */
  overflow: clip;                                 /* the illustration never bleeds past the section */
  /* Frame of the bleeding photo = the asset's own format; the template sets it
     per image, this is the fallback for the empty-state placeholder. */
  --sun-area-hero-media-ratio: 2064 / 1400;
}
.sun-area-hero *,
.sun-area-hero *::before,
.sun-area-hero *::after { box-sizing: border-box; }

.sun-area-hero__inner {
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
}

/* ---------------- Text block ----------------
   .sun-area-hero__text groups copy + logo strip. It only becomes a box in the
   bleeding desktop layout (see ≥1025 below); everywhere else its children lay
   out as direct children of __inner. */
.sun-area-hero__text { display: contents; }

.sun-area-hero__copy {
  position: relative;                             /* above the illustration */
  z-index: 1;
  /* 632px per Figma, but never so wide that it runs into the illustration
     (which takes 49.11% of the viewport on the right). */
  max-width: min(632px, 50vw - 24px);
}
.sun-area-hero__heading {
  margin: 0;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: clamp(32px, 3.5vw, 48px);            /* H1 Display 48/56 */
  line-height: 1.1667;
  letter-spacing: -0.48px;
  color: var(--sun-secondary);                    /* #132140 */
  /* Hyphenate long German compounds instead of overflowing (needs lang="de"),
     but never split short words ("verbin-det"): word ≥ 10, ≥ 4 chars each side. */
  hyphens: auto; -webkit-hyphens: auto;
  hyphenate-limit-chars: 10 4 4;
  overflow-wrap: break-word;
}
/* Large variant — Branchen pages (Figma 339-5708 ff.): H1 56/64 -0.56px and an
   18px medium navy standfirst; the Einsatzbereich heroes keep 48/56 + 16 grey. */
.sun-area-hero--size-large .sun-area-hero__heading {
  font-size: clamp(34px, 2.92vw, 56px);
  line-height: 1.1429;
  letter-spacing: -0.56px;
}
.sun-area-hero--size-large .sun-area-hero__subtitle {
  margin-top: 24px;
  font-size: 18px;
  font-weight: 500;
  color: var(--sun-secondary);
}
.sun-area-hero__subtitle {
  margin: 12px 0 0;                               /* 12px gap under the H1 */
  max-width: 518px;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 400;
  font-size: 16px;                                /* Copy M 16/24 */
  line-height: 24px;
  color: var(--sun-bluegrey);                     /* #4f5563 */
}
.sun-area-hero__cta {
  margin: 40px 0 0;                               /* 40px gap above the CTA */
  display: flex;
}
.sun-area-hero__cta-btn .sun-area-hero__cta-icon { width: 16px; height: 16px; }

/* ---------------- Customer logo strip ---------------- */
.sun-area-hero__customers {
  position: relative;                             /* above the illustration */
  z-index: 1;
  margin-top: 40px;                               /* Figma: 84px from the CTA row top - 44px button */
  max-width: min(632px, 50vw - 24px);
}
.sun-area-hero__customers-title {
  margin: 0 0 16px;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  font-size: 18px;                                /* Subhead L 18/24 */
  line-height: 24px;
  color: var(--sun-secondary);                    /* #132140 */
}
.sun-area-hero__logos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.sun-area-hero__logo {
  flex: 0 0 auto;
  width: 146px;
  height: 51px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--sun-border);            /* #efefef */
  border-radius: 4px;
  background: var(--sun-base);
}
.sun-area-hero__logo--placeholder { background: var(--sun-border); }
.sun-area-hero__logo .sun-area-hero__logo-img {
  display: block;
  max-height: 32px;
  max-width: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------------- Illustration (right) ----------------
   Base = the slot of the contained variant's fallback and the placeholder; the
   bleeding variant replaces it per breakpoint below. The diagonal cut lives in
   CSS, not in the asset, so the source can be a plain JPG. */
.sun-area-hero__media {
  position: absolute;
  /* Start below the fixed header + breadcrumb row (Figma: image top = 152px
     page offset), so the illustration never slides under the nav links. */
  top: clamp(120px, 8vw, 152px);
  right: 0;
  width: 49.11%;                                  /* 943 / 1920 */
  height: calc(100% - clamp(120px, 8vw, 152px));
  pointer-events: none;
}
.sun-area-hero__media .sun-area-hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right top;
}
.sun-area-hero__img--placeholder { background: var(--sun-border); }

/* ---------------- Bleeding layout, desktop ----------------
   Crop rules from the hero crop briefing (Edith, 2026-10-05):
   - The photo area runs from the top of the hero to the bottom edge of the logo
     strip. No fixed height, no cap.
   - It never crops top or bottom: an empty ::before with the asset's ratio gives
     it the height the photo needs at this width. Only when that exceeds the text
     column does the photo reach below the logos.
   - The text then moves towards the middle: a spacer above it (at least the
     former gap) and one below the logos (from 0) grow at the same rate.
   - The diagonal is a fixed 15deg at any height: the area is skewed, the photo
     inside is skewed back. The overhang on the right is clipped by the section. */
@media (min-width: 1025px) {
  .sun-area-hero--media-bleed {
    padding-top: clamp(120px, 8vw, 152px);        /* photo top: below header + breadcrumb row */
    padding-bottom: 72px;                         /* gap under logos resp. photo */
  }
  .sun-area-hero--media-bleed .sun-area-hero__inner {
    width: 100%;
    display: grid;
    grid-template-columns: 50.89% 49.11%;         /* photo = 943 / 1920 */
    align-items: start;
  }
  .sun-area-hero--media-bleed .sun-area-hero__text {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-width: 0;
    /* Left edge = the 1280 container: (section - 1280) / 2, written against
       this column (50.89% of the section), never under 24px. */
    padding: 0 40px 0 max(24px, calc(98.25% - 640px));
  }
  .sun-area-hero--media-bleed .sun-area-hero__text::before {
    content: "";
    flex: 1 1 0px;
    min-height: clamp(96px, 7.9vw, 135px);        /* former gap photo top → H1 (135px at 1920) */
  }
  .sun-area-hero--media-bleed .sun-area-hero__text::after {
    content: "";
    flex: 1 1 0px;
  }
  .sun-area-hero--media-bleed .sun-area-hero__media {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    height: auto;
    align-self: stretch;
    overflow: hidden;
    transform-origin: 0 0;
    transform: skewX(15deg);
  }
  .sun-area-hero--media-bleed .sun-area-hero__media::before {
    content: "";
    display: block;
    aspect-ratio: var(--sun-area-hero-media-ratio);
  }
  .sun-area-hero--media-bleed .sun-area-hero__media .sun-area-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 50%;
    transform-origin: 0 0;
    transform: skewX(-15deg);
  }
  /* The contained variant keeps the band without bottom padding: the next
     section brings its own top padding. */
  .sun-area-hero--media-contained { padding-bottom: 0; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  /* Stacked layout (Figma 375w 1267-14550): photo FIRST, directly under the
     breadcrumb, then H1 / standfirst / CTA, then the logo grid. The image drops
     out of its absolute slot and becomes the first flex child. */
  .sun-area-hero { padding-bottom: clamp(40px, 6vw, 64px); }
  .sun-area-hero__inner { display: flex; flex-direction: column; }
  .sun-area-hero__copy,
  .sun-area-hero__customers { max-width: none; }
  .sun-area-hero__media {
    order: -1;
    position: static;
    width: 100%;
    height: auto;
    margin: 0 0 24px;
  }
  .sun-area-hero__media .sun-area-hero__img {
    height: auto;
    max-height: 420px;
    object-position: center top;
  }
  /* Stacked layout (crop briefing): the photo sits on top at full width in its
     OWN format, uncapped, and the cut moves from the left edge to the bottom
     edge. The ratio is fixed per asset, so the angle holds at every width. */
  .sun-area-hero--media-bleed .sun-area-hero__media .sun-area-hero__img {
    max-height: none;
    aspect-ratio: var(--sun-area-hero-media-ratio);
    object-fit: cover;
    object-position: 50% 50%;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .sun-area-hero__img--placeholder { height: 280px; }
  .sun-area-hero__customers { margin-top: 40px; }
}

@media (max-width: 600px) {
  .sun-area-hero__heading,
  .sun-area-hero--size-large .sun-area-hero__heading { font-size: clamp(26px, 8.5vw, 32px); line-height: 1.25; letter-spacing: -0.32px; }   /* Figma 375w: 32/40 */
  .sun-area-hero__customers-title { font-size: 16px; }
  /* Two logo boxes per row. */
  .sun-area-hero__logo { flex: 1 1 calc(50% - 8px); width: auto; min-width: 0; }
}

/* ---------------- Contained media variant ----------------
   Figma UMSTIEG 1394-19117: the media is a square inside the 1280 container,
   beside the copy, rather than an illustration bleeding to the window edge.
   The copy also steps up to 18/24 in navy here. Opt-in, so the five
   Einsatzbereich heroes keep the bleeding layout. */
@media (min-width: 1025px) {
  .sun-area-hero--media-contained .sun-area-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 620fr) minmax(0, 620fr);
    column-gap: 40px;
    align-items: center;
  }
  .sun-area-hero--media-contained .sun-area-hero__copy { max-width: none; }
  .sun-area-hero--media-contained .sun-area-hero__media {
    position: static;
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  /* Explicit cells: copy and logo strip come first in the markup (shared
     __text wrapper), so auto-placement would push the media into row 2. */
  .sun-area-hero--media-contained .sun-area-hero__copy { grid-column: 1; grid-row: 1; }
  .sun-area-hero--media-contained .sun-area-hero__media { grid-column: 2; grid-row: 1; }
  /* The logo strip, when used, spans the copy column only. */
  .sun-area-hero--media-contained .sun-area-hero__customers { grid-column: 1; grid-row: 2; max-width: none; }
  .sun-area-hero--media-contained { min-height: 0; }
}
.sun-area-hero--media-contained .sun-area-hero__media .sun-area-hero__img {
  object-fit: cover;
  object-position: center;
  border-radius: var(--sun-radius-card, 4px);
}
.sun-area-hero--media-contained .sun-area-hero__subtitle {
  max-width: 518px;
  font-size: 18px;
  font-weight: 500;
  color: var(--sun-secondary);
}

/* The bleeding variant hyphenates because its measure is narrow and German
   compounds would otherwise overflow. At the contained variant's 620px the
   headline wraps cleanly on word boundaries, exactly as Figma sets it, and
   auto-hyphenation only produces worse breaks ("si-cherer"). overflow-wrap
   above still catches a genuinely unbreakable word. */
.sun-area-hero--media-contained .sun-area-hero__heading {
  hyphens: manual;
  -webkit-hyphens: manual;
}
