.c-infobox__container {
    display: flex;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.c-infobox {
    position: relative;
    padding: 1.875rem;
    border: 2px solid theme('colors.primary.500');
    height: 100%;
    margin: auto;
    margin-top: 2rem;
    max-width: 100%;

    .c-infobox__icon-container {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 3rem;
        height: 3rem;
        top: -1.5rem;
        left: 50%;
        transform: translateX(-50%);
        padding: 0 8px;
        border-radius: 50%;
        background: #fff;
        border: 2px solid;
    }

    .c-icon {
        width: 1.5rem;
        height: 1.5rem;
        margin-top: -.4rem;
    }

    @screen lg {
        max-width: 50%;
    }
}

// Style infobox border-radius according to button roundness (buttonType property)
.c-infobox.c-button--soft-rounded {
    border-radius: 6px;
}

.c-infobox.c-button--hard-rounded {
    border-radius: 24px;
}

.c-infobox__content {
    margin: 0 auto;
    margin-top: 1rem;
}

.c-infobox__headline {
    font-family: 'HeadingFontFamily', 'BaseFontFamily', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: theme('colors.primary.500');
    text-align: center;
    align-items: center;
}

.c-infobox__text {
    flex: 1 1 auto;
    margin-top: 1rem;
    color: #333333;
}

.c-infobox__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 1.5rem auto 0;
}

.c-infobox-grid__listitem {
    padding: 1rem 0 0;
    width: theme('width.full');
    margin-bottom: 1rem;

    @screen md {
        width: theme('width.1/2');
    }

    @screen lg {
        width: theme('width.1/3');
        padding: 0;
    }
}

// Color adjustments
.c-infobox--color-primary {
    border-color: theme('colors.primary.500');
    background-color: theme('colors.primary.200');
}

.c-infobox--color-secondary {
    border-color: theme('colors.secondary.500');
    background-color: theme('colors.secondary.200');
}

.c-infobox--color-cta {
    border-color: theme('colors.cta.500');
    background-color: theme('colors.cta.100');
}

.c-infobox--color-accent {
    border-color: theme('colors.accent.500');
    background-color: theme('colors.accent.200');
}

.c-infobox--color-ambient {
    border-color: theme('colors.ambient.500');
    background-color: theme('colors.ambient.200');
}

.c-infobox--color-transparent {
    border-color: theme('colors.primary.500');
    background-color: transparent;
}

.c-infobox--color-primary,
.c-infobox--color-transparent {
    .c-infobox__icon-container {
        border-color: theme('colors.primary.500');
    }

    .c-icon {
        fill: theme('colors.primary.500');
    }

    .c-infobox__button {
        background-color: theme('colors.primary.500');
        border-color: theme('colors.primary.500');

        &:hover,
        &:active,
        &:focus {
            background-color: theme('colors.primary.600');
            border-color: theme('colors.primary.600');
        }
    }
}

.c-infobox--color-secondary {
    .c-infobox__icon-container {
        border-color: theme('colors.secondary.500');
    }

    .c-icon {
        fill: theme('colors.secondary.500');
    }

    .c-infobox__button {
        background-color: theme('colors.secondary.500');
        border-color: theme('colors.secondary.500');

        &:hover,
        &:active,
        &:focus {
            background-color: theme('colors.secondary.600');
            border-color: theme('colors.secondary.600');
        }
    }
}

.c-infobox--color-cta {
    .c-infobox__icon-container {
        border-color: theme('colors.cta.500');
    }

    .c-icon {
        fill: theme('colors.cta.500');
    }

    .c-infobox__button {
        background-color: theme('colors.cta.500');
        border-color: theme('colors.cta.500');

        &:hover,
        &:active,
        &:focus {
            background-color: theme('colors.cta.600');
            border-color: theme('colors.cta.600');
        }
    }
}

.c-infobox--color-accent {
    .c-infobox__icon-container {
        border-color: theme('colors.accent.500');
    }

    .c-icon {
        fill: theme('colors.accent.500');
    }

    .c-infobox__button {
        background-color: theme('colors.accent.500');
        border-color: theme('colors.accent.500');

        &:hover,
        &:active,
        &:focus {
            background-color: theme('colors.accent.600');
            border-color: theme('colors.accent.600');
        }
    }
}

.c-infobox--color-ambient {
    .c-infobox__icon-container {
        border-color: theme('colors.ambient.500');
    }

    .c-icon {
        fill: theme('colors.ambient.500');
    }

    .c-infobox__button {
        background-color: theme('colors.ambient.500');
        border-color: theme('colors.ambient.500');

        &:hover,
        &:active,
        &:focus {
            background-color: theme('colors.ambient.600');
            border-color: theme('colors.ambient.600');
        }
    }
}
