/**
 * Footer CTA Block Styles
 */

.kf-footer-cta {
    --border-radius: 100px;
    position: relative;
    width: 100%;
    aspect-ratio: 144 / 50;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    position: relative;
}

.kf-footer-cta.kf-footer-cta.kf-footer-cta {
    margin-block-start: 100px;
}

.kf-footer-cta::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--border-radius);
    background-color: #191919;
    z-index: 0;
}

/* Background layer with gradient and image */
.kf-footer-cta__background {
    border-radius: var(--border-radius);
    overflow: hidden;

    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        var(--footer-cta-desktop-start, #9697FF),
        var(--footer-cta-desktop-end, #C1C7FF)
    );
    background: linear-gradient(
        to bottom in oklch ,
        var(--footer-cta-desktop-start, #9697FF),
        var(--footer-cta-desktop-end, #C1C7FF)
    );
}

/* Background image positioned on the left for desktop */
.kf-footer-cta__background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-image: var(--footer-cta-desktop-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Content wrapper */
.kf-footer-cta__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin-left: 48%;
}

/* Title */
.kf-footer-cta__title.kf-footer-cta__title {
    margin: 0 0 18px 0;
    font-family: Degular;
    font-weight: 500;
    font-size: clamp(50px, 5.15px + 5.85vw, 80px);
    line-height: 1;
    max-width: 510px;

    /* color: #ffffff; */
}

/* Description */
.kf-footer-cta__description {
    margin: 0 0 38px 0;
    max-width: 600px;
    font-size: 16px;
    line-height: 22px;
    /* color: #ffffff; */
}

.kf-footer-cta__description p {
    margin: 0 0 12px 0;
}

.kf-footer-cta__description p:last-child {
    margin-bottom: 0;
}

.kf-footer-cta__description a {
    color: #ffffff;
    text-decoration: underline;
}

.kf-footer-cta__description a:hover {
    text-decoration: none;
}

/* Buttons container */
.kf-footer-cta__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

/* Button base styles */
.kf-footer-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    cursor: pointer;

    border-radius: 100px;
}

/* Primary button */
.kf-footer-cta__button--primary {
    background-color: #5F61FF;
    color: #fff;
}

.kf-footer-cta__button--primary:hover {
    /* background-color: #f0f0f0; */
    color: #fff;
    transform: translateY(-2px);
}

/* Secondary button */
.kf-footer-cta__button--secondary {
    background-color: transparent;
    color: #ffffff;
    border: 3px solid #191919;
}

.kf-footer-cta__button--secondary:hover {
    color: #191919;
    transform: translateY(-2px);
}

/* Placeholder for editor preview */
.kf-footer-cta__placeholder {
    margin: 0;
    padding: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

@media (max-width: 900px) {
    .kf-footer-cta__content {
        padding: 30px;
        margin-left: 43%;
    }
}

/* Mobile styles (<=767px) */
@media (max-width: 767px) {
    .kf-footer-cta {
        --border-radius: 40px;
        aspect-ratio: unset;
        aspect-ratio: 3/4;
        align-items: flex-start;
    }

    .kf-footer-cta.kf-footer-cta.kf-footer-cta {
        margin-block-start: 60px;
    }

    /* Switch to mobile gradient */
    .kf-footer-cta__background {
        background: linear-gradient(
            to bottom,
            var(--footer-cta-mobile-start, #9697FF),
            var(--footer-cta-mobile-end, #C1C7FF)
        );
        background: linear-gradient(
            to bottom in oklch,
            var(--footer-cta-mobile-start, #9697FF),
            var(--footer-cta-mobile-end, #C1C7FF)
        );
    }

    /* Background image positioned at the bottom for mobile */
    .kf-footer-cta__background::before {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 66%;
        background-image: var(--footer-cta-mobile-image, none);
        background-position: top center;
    }

    /* Content adjustments */
    .kf-footer-cta__content {
        align-items: center;
        text-align: center;
        padding: 60px 40px;
        width: 100%;
        margin: 0 auto;
    }

    .kf-footer-cta__title.kf-footer-cta__title {
        font-size: 42px;
        margin-bottom: 30px;
    }

    .kf-footer-cta__description {
        font-size: 16px;
        margin-bottom: 40px;
    }

    .kf-footer-cta__buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 20px;
    }

    .kf-footer-cta__button {
        width: 100%;
        max-width: 280px;
        padding: 12px 24px;
    }
}

@media (max-width: 600px) {
    .kf-footer-cta {
        aspect-ratio: 2/3;
    }
    .kf-footer-cta__background::before {
        height: 55%;
    }
}
@media (max-width: 500px) {
    .kf-footer-cta {
        aspect-ratio: 1/2;
    }
    .kf-footer-cta__background::before {
        height: 53%;
    }
}
@media (max-width: 430px) {
    .kf-footer-cta {
        aspect-ratio: 1/2;
    }
    .kf-footer-cta__background::before {
        height: 40%;
    }
}

@media (max-width: 375px) {
    .kf-footer-cta {
        aspect-ratio: 1/2.5;
    }
    .kf-footer-cta__background::before {
        height: 40%;
    }
}

/* Editor-specific styles */
.block-editor-block-list__block .kf-footer-cta {
    margin-left: auto;
    margin-right: auto;
}