@cta_background: default;
@overlay_color: default;
@overlay_alpha: default;
@heading_color: default;
@heading_size: default;
@subheading_color: default;
@subheading_size: default;
@text_color: default;
@button_bg: default;
@button_bg_hover: default;
@button_color: default;
@button_radius: default;
@padding_y: default;
@padding_x: default;
@border_radius: default;

.zaso-cta-banner {
  position: relative;
  overflow: hidden;
  background: @cta_background;
  border-radius: @border_radius;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  &__overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: fade(@overlay_color, percentage(@overlay_alpha));
    z-index: 1;
  }

  &__inner {
    position: relative;
    z-index: 2;
    padding: @padding_y @padding_x;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  &__content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  &__heading {
    margin: 0;
    color: @heading_color;
    font-size: @heading_size;
    line-height: 1.2;
  }

  &__subheading {
    margin: 0;
    color: @subheading_color;
    font-size: @subheading_size;
    line-height: 1.4;
  }

  &__text {
    color: @text_color;

    p:last-child {
      margin-bottom: 0;
    }
  }

  &__button {
    display: inline-block;
    background-color: @button_bg;
    color: @button_color;
    border-radius: @button_radius;
    padding: 0.75em 1.75em;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.15s ease-in-out;

    &:hover,
    &:focus {
      background-color: @button_bg_hover;
      color: @button_color;
    }

    // Distinct, theme-reset-proof focus indicator separate from the hover color.
    &:focus-visible {
      outline: 2px solid @button_color;
      outline-offset: 3px;
    }
  }

  // Visually-hidden text for assistive tech (new-tab hint).
  .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  // Text alignment modifiers.
  &--align-left {
    text-align: left;
  }

  &--align-center {
    text-align: center;

    .zaso-cta-banner__inner {
      align-items: center;
    }
  }

  &--align-right {
    text-align: right;

    .zaso-cta-banner__inner {
      align-items: flex-end;
    }
  }

  // Inline layout: content beside the action on wider screens.
  &--inline .zaso-cta-banner__inner {
    flex-direction: column;
  }

  @media (min-width: 768px) {
    &--inline .zaso-cta-banner__inner {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      text-align: left;
    }

    &--inline .zaso-cta-banner__action {
      flex-shrink: 0;
    }
  }
}

// ── Theme-robustness (1.10.1) ───────────────────────────────────────────────
// Re-assert chrome at higher specificity so themes that style bare `a`/`h2`
// (e.g. `a:not(.wp-block-button__link)`) cannot hijack the button or heading.
// Flat selectors, same @vars, no !important; SiteOrigin's `.so-widget-<id>`
// prefix adds the extra class that wins the specificity tie.
.zaso-cta-banner a.zaso-cta-banner__button {
  background-color: @button_bg;
  color: @button_color;
  text-decoration: none;
}

.zaso-cta-banner a.zaso-cta-banner__button:hover,
.zaso-cta-banner a.zaso-cta-banner__button:focus {
  background-color: @button_bg_hover;
  color: @button_color;
}

.zaso-cta-banner h2.zaso-cta-banner__heading {
  font-family: inherit;
}

// ===========================================================================
// LAYOUT VARIANTS (structure only)
// ---------------------------------------------------------------------------
// Orthogonal to the colour skin and to the button-placement / alignment
// options. The Style preset still drives bg/text/button colour via the vars
// above; these rules only restructure shape (elevation, divider, measure).
// They reuse the existing colour vars (e.g. @heading_color for the divider) and
// add no new colour vars and no !important. The "default" layout emits no class
// and is intentionally untouched here. Each block lives at a higher specificity
// than the var-driven base so it wins cleanly.
// ===========================================================================

// ----- Layout: card --------------------------------------------------------
// Elevated, contained promo card: larger corner radius plus a soft drop shadow
// so the banner reads as a floating surface. Spacing still follows the skin's
// padding vars; only the elevation and radius are restructured.
.zaso-cta-banner--layout-card {
  border-radius: 16px;
  box-shadow: 0 18px 40px -16px rgba( 0, 0, 0, 0.35 ), 0 4px 12px rgba( 0, 0, 0, 0.10 );
}

// ----- Layout: split -------------------------------------------------------
// Two distinct zones on wider screens: the content on the left, the action on
// the right, separated by a thin vertical divider. Distinct from the "inline"
// placement (a plain space-between row) by the divider rule, the dedicated
// action gutter, and an emphasised button. The divider uses the heading colour
// faded down, so it tracks the skin without a new colour var.
.zaso-cta-banner--layout-split .zaso-cta-banner__inner {
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .zaso-cta-banner--layout-split .zaso-cta-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .zaso-cta-banner--layout-split .zaso-cta-banner__content {
    flex: 1 1 auto;
    text-align: left;
  }

  .zaso-cta-banner--layout-split .zaso-cta-banner__action {
    flex-shrink: 0;
    padding-left: 2rem;
    border-left: 1px solid fade( @heading_color, 18% );
  }
}

.zaso-cta-banner--layout-split .zaso-cta-banner__button {
  padding: 0.9em 2.1em;
}

// ----- Layout: centered ----------------------------------------------------
// A centered spotlight: content is centred and constrained to a comfortable
// reading measure, the vertical rhythm opens up, and the button is enlarged.
// Distinct from the "center" text-alignment option, which only changes text
// alignment; this also caps the content width and scales the call to action.
.zaso-cta-banner--layout-centered .zaso-cta-banner__inner {
  align-items: center;
  text-align: center;
  gap: 1.75rem;
}

.zaso-cta-banner--layout-centered .zaso-cta-banner__content {
  align-items: center;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.zaso-cta-banner--layout-centered .zaso-cta-banner__button {
  padding: 1em 2.5em;
  font-size: 1.05rem;
}

// ===========================================================================
// PRE-MADE DESIGNS (self-contained skins) — 1.10.7
// ---------------------------------------------------------------------------
// One-click "Browse designs" looks. Each `.zaso-cta-banner--design-{id}` block
// is fully self-contained (hardcoded hex, no @vars) and, being source-ordered
// after the var-driven base and the layout variants, wins every specificity tie
// without !important. Each design sets its OWN alignment and flow so it renders
// consistently regardless of the Button Placement / Text Alignment / Layout
// Structure fields. The empty design_variant ('') adds no class, so existing
// banners are untouched. Buttons override the flat `a.zaso-cta-banner__button`
// base selector via an equal-specificity, later-in-source rule.
// Six ship free; Zen Addons Pro adds twenty-four more in the Pro plugin.
// ===========================================================================

// ----- Design: Solid Centered (indigo) -------------------------------------
.zaso-cta-banner--design-solid-centered {
  background: #4f46e5;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba( 79, 70, 229, 0.22 );
  text-align: center;
}
.zaso-cta-banner--design-solid-centered .zaso-cta-banner__inner {
  padding: 2.5rem 2.75rem;
  align-items: center;
}
.zaso-cta-banner--design-solid-centered .zaso-cta-banner__content {
  align-items: center;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}
.zaso-cta-banner--design-solid-centered .zaso-cta-banner__heading {
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 800;
}
.zaso-cta-banner--design-solid-centered .zaso-cta-banner__subheading,
.zaso-cta-banner--design-solid-centered .zaso-cta-banner__text {
  color: rgba( 255, 255, 255, 0.85 );
}
.zaso-cta-banner--design-solid-centered a.zaso-cta-banner__button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background-color: #ffffff;
  color: #4f46e5;
  border-radius: 10px;
  padding: 0.8em 1.7em;
  font-weight: 700;
}
// Design glyph: trailing arrow_forward (U+E5C8), as-is to the source design.
.zaso-cta-banner--design-solid-centered a.zaso-cta-banner__button::after {
  content: "\e5c8";
  font-family: "ZASO Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  font-size: 1.15em;
  font-variation-settings: 'wght' 600;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.zaso-cta-banner--design-solid-centered a.zaso-cta-banner__button:hover,
.zaso-cta-banner--design-solid-centered a.zaso-cta-banner__button:focus {
  background-color: #eef2ff;
  color: #4f46e5;
}

// ----- Design: Horizontal Split (teal) -------------------------------------
.zaso-cta-banner--design-horizontal-split {
  background: #0d9488;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba( 13, 148, 136, 0.22 );
  text-align: left;
}
.zaso-cta-banner--design-horizontal-split .zaso-cta-banner__inner {
  padding: 2rem 2.25rem;
  align-items: stretch;
}
.zaso-cta-banner--design-horizontal-split .zaso-cta-banner__heading {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
}
.zaso-cta-banner--design-horizontal-split .zaso-cta-banner__subheading,
.zaso-cta-banner--design-horizontal-split .zaso-cta-banner__text {
  color: rgba( 255, 255, 255, 0.85 );
}
.zaso-cta-banner--design-horizontal-split a.zaso-cta-banner__button {
  background-color: #ffffff;
  color: #0d9488;
  border-radius: 10px;
  padding: 0.8em 1.5em;
  font-weight: 700;
}
.zaso-cta-banner--design-horizontal-split a.zaso-cta-banner__button:hover,
.zaso-cta-banner--design-horizontal-split a.zaso-cta-banner__button:focus {
  background-color: #f0fdfa;
  color: #0d9488;
}
@media ( min-width: 768px ) {
  .zaso-cta-banner--design-horizontal-split .zaso-cta-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .zaso-cta-banner--design-horizontal-split .zaso-cta-banner__content {
    flex: 1 1 auto;
  }
  .zaso-cta-banner--design-horizontal-split .zaso-cta-banner__action {
    flex-shrink: 0;
  }
}

// ----- Design: Soft Tint (blue) --------------------------------------------
.zaso-cta-banner--design-soft-tint {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  box-shadow: none;
  text-align: left;
}
.zaso-cta-banner--design-soft-tint .zaso-cta-banner__inner {
  padding: 2rem 2.25rem;
  align-items: stretch;
}
.zaso-cta-banner--design-soft-tint .zaso-cta-banner__heading {
  color: #1e3a8a;
  font-size: 1.5rem;
  font-weight: 800;
}
.zaso-cta-banner--design-soft-tint .zaso-cta-banner__subheading,
.zaso-cta-banner--design-soft-tint .zaso-cta-banner__text {
  color: #3b5bdb;
}
.zaso-cta-banner--design-soft-tint a.zaso-cta-banner__button {
  background-color: #2563eb;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.8em 1.5em;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba( 37, 99, 235, 0.3 );
}
.zaso-cta-banner--design-soft-tint a.zaso-cta-banner__button:hover,
.zaso-cta-banner--design-soft-tint a.zaso-cta-banner__button:focus {
  background-color: #1d4ed8;
  color: #ffffff;
}
@media ( min-width: 768px ) {
  .zaso-cta-banner--design-soft-tint .zaso-cta-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .zaso-cta-banner--design-soft-tint .zaso-cta-banner__content {
    flex: 1 1 auto;
  }
  .zaso-cta-banner--design-soft-tint .zaso-cta-banner__action {
    flex-shrink: 0;
  }
}

// ----- Design: Gradient Centered (violet) ----------------------------------
.zaso-cta-banner--design-gradient-centered {
  background: linear-gradient( 135deg, #7c3aed, #c026d3 );
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba( 124, 58, 237, 0.28 );
  text-align: center;
}
.zaso-cta-banner--design-gradient-centered .zaso-cta-banner__inner {
  padding: 2.5rem 2.75rem;
  align-items: center;
}
.zaso-cta-banner--design-gradient-centered .zaso-cta-banner__content {
  align-items: center;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}
.zaso-cta-banner--design-gradient-centered .zaso-cta-banner__heading {
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 800;
}
.zaso-cta-banner--design-gradient-centered .zaso-cta-banner__subheading,
.zaso-cta-banner--design-gradient-centered .zaso-cta-banner__text {
  color: rgba( 255, 255, 255, 0.88 );
}
.zaso-cta-banner--design-gradient-centered a.zaso-cta-banner__button {
  background-color: #ffffff;
  color: #7c3aed;
  border-radius: 10px;
  padding: 0.8em 1.75em;
  font-weight: 700;
}
.zaso-cta-banner--design-gradient-centered a.zaso-cta-banner__button:hover,
.zaso-cta-banner--design-gradient-centered a.zaso-cta-banner__button:focus {
  background-color: #f5f3ff;
  color: #7c3aed;
}

// ----- Design: Outlined (minimal) ------------------------------------------
.zaso-cta-banner--design-outlined {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba( 15, 23, 42, 0.05 );
  text-align: center;
}
.zaso-cta-banner--design-outlined .zaso-cta-banner__inner {
  padding: 2.375rem 2.75rem;
  align-items: center;
}
.zaso-cta-banner--design-outlined .zaso-cta-banner__content {
  align-items: center;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}
.zaso-cta-banner--design-outlined .zaso-cta-banner__heading {
  color: #0f172a;
  font-size: 1.625rem;
  font-weight: 800;
}
.zaso-cta-banner--design-outlined .zaso-cta-banner__subheading,
.zaso-cta-banner--design-outlined .zaso-cta-banner__text {
  color: #64748b;
}
.zaso-cta-banner--design-outlined a.zaso-cta-banner__button {
  background-color: #0f172a;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.8em 1.75em;
  font-weight: 700;
}
.zaso-cta-banner--design-outlined a.zaso-cta-banner__button:hover,
.zaso-cta-banner--design-outlined a.zaso-cta-banner__button:focus {
  background-color: #1e293b;
  color: #ffffff;
}

// ----- Design: Dark --------------------------------------------------------
.zaso-cta-banner--design-dark {
  background: #0f172a;
  border-radius: 16px;
  box-shadow: none;
  text-align: center;
}
.zaso-cta-banner--design-dark .zaso-cta-banner__inner {
  padding: 2.5rem 2.75rem;
  align-items: center;
}
.zaso-cta-banner--design-dark .zaso-cta-banner__content {
  align-items: center;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}
.zaso-cta-banner--design-dark .zaso-cta-banner__heading {
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 800;
}
.zaso-cta-banner--design-dark .zaso-cta-banner__subheading,
.zaso-cta-banner--design-dark .zaso-cta-banner__text {
  color: #94a3b8;
}
.zaso-cta-banner--design-dark a.zaso-cta-banner__button {
  background-color: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.8em 1.75em;
  font-weight: 700;
}
.zaso-cta-banner--design-dark a.zaso-cta-banner__button:hover,
.zaso-cta-banner--design-dark a.zaso-cta-banner__button:focus {
  background-color: #e2e8f0;
  color: #0f172a;
}
