/*
 * Image CTA section layout.
 * Olive band with a required inset image panel (green frame on all sides).
 * Right deco hangs below the section into the next band.
 * Typography tokens live in shared.css.
 */

.fx-section--image-cta {
  --fx-image-cta-frame-x: var(--fx-content-pad-x);
  --fx-image-cta-frame-y: var(--fx-section-pad);
  --fx-image-cta-frame-top: var(--fx-pad-top-collapsed, var(--fx-image-cta-frame-y));
  --fx-image-cta-title-size: 2.5rem;
  --fx-image-cta-body-size: 1.125rem;
  --fx-image-cta-measure: 40rem;
  /*
   * Right accent (Figma 2058:7 / Group 8). Shown from 600px up only.
   * Desktop: slightly under Figma size, nudged down/right so it clears copy.
   */
  --fx-image-cta-deco-w: 6rem;
  --fx-image-cta-deco-hang: 1rem;
  --fx-image-cta-deco-out: 0.35;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 22rem;
  /* Visible so the right accent can hang into the next section */
  overflow: visible;
  padding: var(--fx-image-cta-frame-top) var(--fx-image-cta-frame-x) var(--fx-image-cta-frame-y);
  background-color: var(--fx-color-olive);
  color: #ffffff;
  text-align: center;
}

/* Same-tone stacked Image CTAs handled via shared --fx-pad-top-collapsed. */

.fx-section--image-cta.fx-image-cta--deco-right {
  z-index: 2; /* keep hanging accent above the following section */
}

.fx-section--image-cta .fx-section__inner.fx-image-cta__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 16rem;
  max-width: none;
  margin: 0;
  padding: 2.5rem var(--fx-content-pad-x);
}

.fx-image-cta__media {
  position: absolute;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Inset to match section padding = visible olive frame */
  top: var(--fx-image-cta-frame-top);
  right: var(--fx-image-cta-frame-x);
  bottom: var(--fx-image-cta-frame-y);
  left: var(--fx-image-cta-frame-x);
  background-color: var(--fx-color-olive-dark);
}

.fx-image-cta__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center bottom;
  filter: grayscale(0.35) contrast(1.05);
}

.fx-section--image-cta .fx-image-cta__img {
  height: 100%;
  max-width: none;
}

.fx-image-cta__scrub {
  position: absolute;
  inset: 0;
  /* Olive-tinted darken so type stays readable on the panel */
  background-color: rgba(72, 74, 59, 0.55);
}

/*
 * Right accent: Figma 2058:7 places Group 8 flush to the section right/bottom
 * (x=1543 on a 1857 x 967 frame). Hidden below 600px; sits under copy (z-index).
 */
.fx-image-cta__deco-right {
  display: none;
  position: absolute;
  right: calc(0px - (var(--fx-image-cta-deco-w) * var(--fx-image-cta-deco-out)));
  bottom: calc(-1 * var(--fx-image-cta-deco-hang));
  z-index: 1;
  width: var(--fx-image-cta-deco-w);
  height: auto;
  aspect-ratio: 410.53 / 618.05;
  pointer-events: none;
}

@media (min-width: 600px) {
  .fx-image-cta__deco-right {
    display: block;
  }
}

.fx-image-cta__deco-right svg {
  display: block;
  width: 100%;
  height: 100%;
}

.fx-image-cta__deco-top {
  margin: 0 0 1.5rem;
  width: 5.5rem;
  height: auto;
  pointer-events: none;
}

.fx-image-cta__deco-top svg {
  display: block;
  width: 100%;
  height: auto;
  margin-right: auto;
  margin-left: auto;
}

.fx-image-cta__body {
  width: 100%;
  max-width: var(--fx-image-cta-measure);
  color: #ffffff;
}

/* Ratio sets size/weight/uppercase on all h1/h2; lock Figma type on WYSIWYG tags. */
.fx-section--image-cta .fx-image-cta__body h1,
.fx-section--image-cta .fx-image-cta__body h2,
.fx-section--image-cta .fx-image-cta__body h3,
.fx-section--image-cta .fx-image-cta__body h1.fx-image-cta__title,
.fx-section--image-cta .fx-image-cta__body h2.fx-image-cta__title {
  margin: 0 0 1rem;
  color: #ffffff !important;
  font-family: var(--fx-font-display) !important;
  font-size: var(--fx-image-cta-title-size) !important;
  font-style: normal !important;
  font-weight: 400 !important;
  line-height: 0.89 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
}

.fx-section--image-cta .fx-image-cta__body p {
  margin: 0 0 1.25rem;
  color: #ffffff !important;
  font-family: var(--fx-font-intro) !important;
  font-size: var(--fx-image-cta-body-size) !important;
  font-style: normal !important;
  font-weight: 400 !important;
  line-height: 1.29 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
}

.fx-image-cta__body > :last-child {
  margin-bottom: 0;
}

.fx-image-cta__body a:not(.fx-section__button) {
  color: inherit;
  text-decoration: underline;
}

.fx-image-cta__body .fx-section__button,
.fx-image-cta__actions {
  margin-top: 2rem;
}

.fx-image-cta__actions .fx-section__button {
  margin-top: 0;
}

/* Let the hanging deco paint over the next Bakery row */
.vc_row:has(.fx-section--image-cta),
.vc_row:has(.fx-section--image-cta) > .wpb_column,
.vc_row:has(.fx-section--image-cta) > .vc_column_container,
.vc_row:has(.fx-section--image-cta) .wpb_wrapper {
  overflow: visible;
}

@media (min-width: 768px) {
  .fx-section--image-cta {
    --fx-image-cta-frame-y: clamp(2.25rem, 5.5vw, 5rem);
    --fx-image-cta-title-size: 3.75rem;
    --fx-image-cta-body-size: 1.5rem;
    --fx-image-cta-measure: 48rem;
    --fx-image-cta-deco-w: 10rem;
    --fx-image-cta-deco-hang: 2rem;
    --fx-image-cta-deco-out: 0.2;
    min-height: 40rem;
  }

  .fx-section--image-cta .fx-section__inner.fx-image-cta__content {
    min-height: 24rem;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .fx-image-cta__deco-top {
    width: 7rem;
    margin-bottom: 2rem;
  }
}

@media (min-width: 1024px) {
  .fx-section--image-cta {
    --fx-image-cta-frame-y: 4.75rem;
    --fx-image-cta-title-size: 4.6875rem;
    --fx-image-cta-body-size: 1.875rem;
    /* Figma body measure 1040px */
    --fx-image-cta-measure: 65rem;
    /* ~80% of Figma Group 8 width; hangs below + peeks past right */
    --fx-image-cta-deco-w: 20.5rem;
    --fx-image-cta-deco-hang: 5rem;
    --fx-image-cta-deco-out: 0.22;
    min-height: 48rem;
  }

  .fx-section--image-cta .fx-section__inner.fx-image-cta__content {
    min-height: 30rem;
  }

  .fx-image-cta__deco-top {
    width: 8.8rem;
  }
}

@media (min-width: 1400px) {
  .fx-section--image-cta {
    --fx-image-cta-frame-y: 5.25rem;
    --fx-image-cta-deco-w: 22rem;
    --fx-image-cta-deco-hang: 5.5rem;
    --fx-image-cta-deco-out: 0.18;
    min-height: 50rem;
  }
}
