/* CTA Block - Frontend Styles */

.wp-block-socius-pro-blocks-cta-block {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ─── Shared Content ─────────────────────────────────────────── */
.cta-tagline {
  margin-bottom: 0.75rem;
}

.cta-heading {
  margin-top: 0;
  margin-bottom: 1rem;
}

.cta-content-text {
  margin-bottom: 1.5rem;
}

.cta-divider-wrap {
  margin-bottom: 1rem;
}

.cta-divider-wrap hr {
  border: none;
  margin: 0;
}

/* ─── Button Group ───────────────────────────────────────────── */
.cta-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ─── V1: Text Overlay ───────────────────────────────────────── */
.cta-text-overlay {
  position: relative;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.cta-text-overlay .cta-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.cta-text-overlay .cta-content-wrap {
  position: relative;
  z-index: 2;
  padding: 4rem 2rem;
}

/* Mobile-only background image - stacks above content on mobile */
.cta-text-overlay .cta-bg-image-mobile {
  display: none;
}

@media (max-width: 990px) {
  .cta-text-overlay {
    background-image: none !important;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .cta-text-overlay .cta-bg-image-mobile {
    display: block;
    width: 100%;
    height: auto;
    order: 1;
  }

  .cta-text-overlay .cta-overlay {
    display: none;
  }

  .cta-text-overlay .cta-content-wrap {
    order: 2;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 2rem 1rem;
  }

  .cta-text-overlay.cta-has-mobile-bg .cta-content-wrap {
    background-color: var(--v1-mobile-content-bg);
  }

  .cta-text-overlay.cta-has-mobile-text .cta-content-wrap,
  .cta-text-overlay.cta-has-mobile-text .cta-content-wrap .cta-tagline,
  .cta-text-overlay.cta-has-mobile-text .cta-content-wrap .cta-heading,
  .cta-text-overlay.cta-has-mobile-text .cta-content-wrap .cta-content-text {
    color: var(--v1-mobile-content-text) !important;
  }
}

/* ─── V2: Horizontal ─────────────────────────────────────────── */
.cta-horizontal {
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cta-horizontal .cta-horizontal-inner {
  padding: 3rem 2rem;
}

.cta-horizontal .cta-horizontal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 991px) {
  .cta-horizontal .cta-horizontal-grid {
    grid-template-columns: 1fr max-content;
  }

  .cta-horizontal .cta-button-group {
    flex-direction: column;
    align-items: stretch;
    margin-top: 0;
  }
}

/* ─── V3: Full-Width ─────────────────────────────────────────── */
.cta-full-width {
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cta-full-width .cta-full-width-inner {
  padding: 4rem 2rem;
  width: 100%;
}

@media (min-width: 991px) {
  .cta-full-width .cta-full-width-inner {
    /* max-width applied via inline style */
    margin-left: auto;
    margin-right: auto;
  }
}

/* ─── V4: Parallax ───────────────────────────────────────────── */
.cta-parallax {
  width: 100%;
  background-size: cover;
  background-position: center 50%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2rem;
}

.cta-parallax .cta-parallax-content {
  position: relative;
  width: 100%;
  z-index: 1;
}

/* Bottom section: stuck to the right on desktop with its own max-width
   slider. Inline CSS variables on the element supply both the desktop
   values and the top-section values, so the mobile media query below
   can swap to the top section's alignment without per-block CSS. */
.cta-parallax .cta-parallax-bottom {
  position: relative;
  width: 100%;
  z-index: 1;
  max-width: var(--cta-parallax-bottom-mw, 50%);
  margin-left: var(--cta-parallax-bottom-ml, auto);
  margin-right: var(--cta-parallax-bottom-mr, 0);
  text-align: var(--cta-parallax-bottom-ta, left);
}

.cta-parallax .cta-parallax-bottom-text {
  margin: 0 0 1rem;
}

@media (max-width: 990px) {
  .cta-parallax {
    background-attachment: scroll;
  }

  /* On mobile the bottom section sits directly below the top content
     and uses the same max-width and alignment as the top section. */
  .cta-parallax .cta-parallax-bottom {
    max-width: var(--cta-parallax-top-mw, 100%);
    margin-left: var(--cta-parallax-top-ml, auto);
    margin-right: var(--cta-parallax-top-mr, auto);
    text-align: var(--cta-parallax-top-ta, center);
  }
}
