.d35-section-cta__inner {
  /* Stay within the site content width and centre, like the other sections. */
  width: min(100%, var(--d35-container));
  margin-inline: auto;
  padding-inline: var(--d35-gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

/* Dark variant: the full-bleed dark band comes from the shared
   .d35-section-dark utility, and the nested SectionHeader carries its own dark
   text treatment via --variant-dark — so nothing dark-specific is needed here. */

.d35-section-cta__body {
  min-width: 0;
}

/* The nested SectionHeader ships with its own card chrome and centered
   actions in stacked layout; strip both so the CTA reads as one section with
   flush, left-aligned content and buttons. */
.d35-section-cta__body .d35-section-header {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.d35-section-cta__body .d35-section-header__actions {
  justify-content: flex-start;
}

.d35-section-cta__media {
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--d35-radius, 0);
  /* Kein eigener Backdrop: Fotos füllen die Box per object-fit:cover ohnehin,
     freigestellte (transparente) Bilder sollen dagegen nahtlos mit dem
     Section-/Body-Hintergrund verschmelzen statt in einem sichtbaren Kasten zu
     sitzen. */
  background: transparent;
}

.d35-section-cta__media--2-1 {
  aspect-ratio: 2 / 1;
}

.d35-section-cta__media--4-3 {
  aspect-ratio: 4 / 3;
}

.d35-section-cta__media--3-2 {
  aspect-ratio: 3 / 2;
}

.d35-section-cta__media--1-1 {
  aspect-ratio: 1 / 1;
}

.d35-section-cta__image,
.d35-section-cta__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Freigestellte (transparente) Produktbilder vollständig zeigen, statt sie per
   cover zu beschneiden — zusammen mit dem transparenten Media-Backdrop „schwebt"
   das Motiv dann randlos auf dem Section-Hintergrund. Opt-in via media_fit="contain". */
.d35-section-cta__media--contain .d35-section-cta__image,
.d35-section-cta__media--contain img {
  object-fit: contain;
}

.d35-section-cta--media-left .d35-section-cta__media {
  order: -1;
}

/* Panel layout: a full-bleed hero band. The image fills its grid cell with no
   contained aspect-ratio box and no gap — so a photo with a baked-in edge
   graphic (e.g. the torn brand shape) meets the content flush — and bleeds all
   the way to the boxed-layout edge on its side. The content half re-indents its
   text to the shared container so it still lines up with the rest of the page.

   Vertical section padding is dropped too, so the image runs flush top-to-bottom
   and sets the section height itself; the content keeps its own __body padding
   for breathing room. */
.d35-section-cta--layout-panel {
  padding-block: 0;
}

/* Break out of the content container: the grid spans the full section width
   (= the boxed-layout width, capped at --d35-layout-max), so the media reaches
   the edge instead of stopping at the 1200px container. */
.d35-section-cta--layout-panel > .d35-section-cta__inner {
  width: 100%;
  max-width: none;
  gap: 0;
  align-items: stretch;
  padding-inline: 0;
}

.d35-section-cta--layout-panel .d35-section-cta__body {
  align-self: center;
  padding-block: clamp(2rem, 4vw, 3.5rem);
  /* Outer edge aligns to the container gutter — (boxed width − container) / 2,
     clamped to --d35-gap on narrow/mobile — while the inner edge toward the
     media keeps a normal gap. */
  padding-inline:
    max(var(--d35-gap), (min(100vw, var(--d35-layout-max)) - var(--d35-container)) / 2)
    var(--d35-gap);
}

/* Panel media is a flat 2:1 band, hard-wired (independent of image_ratio / the
   rendered ratio class). On mobile the media is full-width, so 2:1 comes from
   its own aspect ratio; the desktop rule below overrides this to stretch-fill. */
.d35-section-cta--layout-panel .d35-section-cta__media {
  aspect-ratio: 2 / 1;
  border-radius: 0;
}

/* Media-left mirror: the container-gutter indent moves to the body's right. */
.d35-section-cta--layout-panel.d35-section-cta--media-left .d35-section-cta__body {
  padding-inline:
    var(--d35-gap)
    max(var(--d35-gap), (min(100vw, var(--d35-layout-max)) - var(--d35-container)) / 2);
}

/* Side-by-side band (above the mobile stacking breakpoint): lock the band to a
   flat 2:1 — the media column is half the width, so its height is width ÷ 4 —
   and let the image stretch to cover that height instead of sitting at its own
   aspect size, so no white gaps appear above/below. Taller content grows the
   band and the image still covers it. */
@media (min-width: 783px) {
  .d35-section-cta--layout-panel > .d35-section-cta__inner {
    min-height: calc(min(100vw, var(--d35-layout-max)) / 4);
  }

  .d35-section-cta--layout-panel .d35-section-cta__media {
    align-self: stretch;
    aspect-ratio: auto;
    /* Positioning context for the absolutely-filled image below. */
    position: relative;
  }

  /* Take the image out of flow so its intrinsic height can't inflate the grid
     row — the band height then comes purely from min-height (2:1) or taller
     content, and the image covers whatever that is. */
  .d35-section-cta--layout-panel .d35-section-cta__media > img,
  .d35-section-cta--layout-panel .d35-section-cta__media > .d35-section-cta__image {
    position: absolute;
    inset: 0;
  }
}

/* Overlay layout: the image + dark scrim live inside the constrained, rounded
   inner box (the surrounding section stays on the page background), with the
   content layered on top. The nested header uses its dark variant for readable
   light text. */
.d35-section-cta--layout-overlay > .d35-section-cta__inner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Die Overlay-Box ist selbst die sichtbare Fläche und trägt ihr Padding innen.
     Breite deshalb exakt gleich der SICHTBAREN Content-Breite der übrigen
     Sektionen: deren __inner ist min(100%, container) mit padding-inline gap, der
     Inhalt also (min(100%, container) − 2·gap). Dieselbe Rechnung hier, damit die
     CTA-Box bündig mit card-/slider-showcase & Co. läuft statt ~2·gap breiter. */
  width: calc(min(100%, var(--d35-container)) - 2 * var(--d35-gap));
  border-radius: var(--d35-radius);
  grid-template-columns: minmax(0, 1fr);
  min-height: clamp(18rem, 26vw, 24rem);
  padding: clamp(2rem, 4vw, 3.5rem);
  align-content: center;
}

.d35-section-cta--layout-overlay .d35-section-cta__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  aspect-ratio: auto;
  border-radius: 0;
  background: var(--d35-color-dark);
}

.d35-section-cta--layout-overlay .d35-section-cta__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.64) 55%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.d35-section-cta--layout-overlay .d35-section-cta__body {
  position: relative;
  z-index: 2;
}

.d35-section-cta--layout-overlay .d35-section-header {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (max-width: 782px) {
  .d35-section-cta__inner {
    grid-template-columns: 1fr;
  }

  .d35-section-cta--media-left .d35-section-cta__media {
    order: 0;
  }
}
