@import '../../../../assets/scss/abstracts/variables';
@import '../../../../assets/scss/abstracts/mixins';

.rdg-blocks .rdg-call-to-action {
    width: calc(var(--vw, 1vw) * 100);
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 99.55vw;

    .body {
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;
        background-image: var(--background-image);
        background-color: var(--color-rdg-call-to-action-bg);

        .container.content {
            width: 100%;
            display: flex;
            color: $color-white;
            text-align: center;
            justify-content: center;
            gap: 0 2rem;

            &.vertical {
                padding: 1.5rem 20px;
                flex-direction: column;
            }

            &.horizontal {
                padding: 2.5rem 20px;
                flex-direction: row;

                @media (max-width: $breakpoint-sm) {
                    & {
                        padding: 1.5rem;
                        flex-direction: column;
                    }
                }
            }

            .texts {
                display: flex;
                flex-direction: column;

                h1, h2, h3, span {
                    margin: 0;
                    font-weight: 400;
                    font-size: var(--font-size);
                    line-height: var(--line-height);
            
                    @media (max-width: $breakpoint-lg) {
                        & {
                            font-size: var(--font-size-lg);
                            line-height: var(--line-height-lg);
                        }
                    }
            
                    @media (max-width: $breakpoint-md) {
                        & {
                            font-size: var(--font-size-md);
                            line-height: var(--line-height-md);
                        }
                    }
            
                    @media (max-width: $breakpoint-sm) {
                        & {
                            font-size: var(--font-size-sm);
                            line-height: var(--line-height-sm);
                        }
                    }
                }
            }

            .footer {
                &.horizontal {
                    display: flex;
                    align-items: center;

                    @media (max-width: $breakpoint-sm) {
                        & {
                            align-items: inherit;
                            justify-content: center;
                        }
                    }
                }

                .buttons {
                    display: flex;
                    justify-content: center;
                    gap: 1rem;

                    &.vertical {
                        padding-top: 1rem;

                        @media (max-width: 350px) {
                            & {
                                flex-direction: column;
                            }
                        }

                        a {
                            margin-top: 1rem;
                        }
                    }

                    &.horizontal {
                        @media (max-width: $breakpoint-sm) {
                            & {
                                padding-top: 1rem;
                            }
                        }

                        @media (max-width: 350px) {
                            & {
                                width: 100%;
                                flex-direction: column;
                            }
                        }

                        a {
                            margin-top: 1rem;
                        }
                    }
            
                    a {
                        padding: .8rem 1.5rem;
                        font-size: 1rem;
                        font-weight: 500;
                        color: var(--color-white);
                        border-radius: .4rem;
                        min-width: 10rem;
                        text-align: center;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        transition: .2s background-color ease-in-out, .2s color ease-in-out, .2s border-color ease-in-out, .2s opacity ease-in-out, .2s box-shadow ease-in-out;
                        
                        &.link-success {
                            border-top: 3px solid var(--color-success-light);
                            background-color: var(--color-success);
                        }
            
                        &.link-warning {
                            border-top: 3px solid var(--color-warning-light);
                            background-color: var(--color-warning);
                        }
            
                        &.link-danger {
                            border-top: 3px solid var(--color-danger-light);
                            background-color: var(--color-danger);
                        }
            
                        &.link-default {
                            color: var(--color-primary);
                            border: 2px solid var(--color-primary);
                            background-color: var(--color-gray);
                        }
            
                        &:last-of-type {
                            @media (max-width: 350px) {
                                & {
                                    margin-top: 0;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

.acf-block-preview {
    .rdg-call-to-action {
        width: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;

        .buttons {
            a {
                text-decoration: none;
            }
        }
    }
}
