/**
 * CTA banner: a standardized call to action. Small: a boxed bar inside the
 * content width with text on the left and the button on the right. Large: a
 * full-width centered section with a big heading and buttons.
 *
 * globalClass: cta-banner
 *
 * Variants:
 *   (none)               small: boxed bar, text left, actions right; stacks
 *                        on mobile. Put a palette wrapper on it
 *                        (wrapper-alternate-color / wrapper-extra-color).
 *   cta-banner--large    full-width section (alignfull + color-section +
 *                        palette wrapper): centered heading, text and actions
 *   cta-banner--center   small bar with everything centered and stacked
 *
 * Structure:
 *   .cta-banner.gb-container[.wrapper-alternate-color]
 *     .cta-banner-content.gb-container > h3|h2.cta-banner-title + p.cta-banner-text
 *     .cta-banner-action.gb-container  > a.gb-button (+ a.gb-button.btn-no-bg)
 *   large: .cta-banner.cta-banner--large.gb-container.alignfull.color-section.wrapper-alternate-color
 *            > .cta-banner-inner.gb-container (useGlobalMaxWidth) > .cta-banner-content + .cta-banner-action
 *
 * Tuning: --cta-banner-radius (12px), --cta-banner-padding (32px)
 *
 * Chain animations: the banner is the chain: content (1), action (2).
 *
 * Editor: the flex layout is repeated on GB's editor layout element.
 */

:root {
    --cta-banner-radius: 12px;
    --cta-banner-padding: 32px;
}

/* Small bar */
.cta-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 40px;
    padding: var(--cta-banner-padding);
    border-radius: var(--cta-banner-radius);
}

.cta-banner > .block-editor-inner-blocks {
    width: 100%;
}

.cta-banner > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 40px;
}

.cta-banner-content {
    flex: 1 1 320px;
    min-width: 0;
}

.cta-banner-content > * {
    margin: 0;
}

.cta-banner-title {
    font-size: var(--h3-size);
}

.cta-banner-text {
    margin-top: 8px;
}

.cta-banner-action,
.cta-banner-action > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    flex: 0 0 auto;
}

/* Centered small bar */
.cta-banner--center,
.cta-banner--center > .block-editor-inner-blocks > .block-editor-block-list__layout {
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.cta-banner--center .cta-banner-content {
    flex-basis: auto;
    max-width: 640px;
}

.cta-banner--center .cta-banner-action {
    justify-content: center;
}

/* Large section */
.cta-banner--large {
    display: block;
    padding: var(--section-padding);
    border-radius: 0;
    text-align: center;
}

.cta-banner--large .cta-banner-inner,
.cta-banner--large .cta-banner-inner > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.cta-banner--large .cta-banner-content {
    flex-basis: auto;
    max-width: 720px;
}

.cta-banner--large .cta-banner-title {
    font-size: var(--h2-size);
}

.cta-banner--large .cta-banner-text {
    margin-top: 16px;
    font-size: 1.1rem;
}

.cta-banner--large .cta-banner-action {
    justify-content: center;
}

@media only screen and (min-width: 768px) {
    :root {
        --cta-banner-padding: 40px 48px;
    }
}
