.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-icon-container {
        position: absolute;
        top: -16px; /* Adjust this value to center the icon vertically */
        left: 50%;
        transform: translateX(-50%);
        padding: 0 8px;
    }

    .c-icon {
        width: 2.875rem;
        height: 2.875rem;
        display: block;
        background: white;
        border: 2px solid;
        border-radius: 50%;
        margin-top: -0.6rem;
        border-color: var(--icon-border-color);
    }

    .c-icon {
        border-color: var(--icon-border-color);
    }

    @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--color-primary .c-icon {
    --icon-border-color: theme('colors.primary.600');
    fill: theme('colors.primary.600');
}

.c-infobox--color-secondary .c-icon {
    --icon-border-color: theme('colors.secondary.600');
    fill: theme('colors.secondary.600');
}

.c-infobox--color-cta .c-icon {
    --icon-border-color: theme('colors.cta.600');
    fill: theme('colors.cta.600');
}

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

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

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

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

.c-infobox--color-cta {
    border-color: theme('colors.cta.600');
    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__headline {
    font-family: sans-serif;
    font-size: 1.75rem;
    color: #333333;
    text-align: center;
    align-items: center;
}

.c-infobox__text {
    flex: 1 1 auto;
    padding: 1rem 0;
    -webkit-font-smoothing: antialiased;
    color: #333333;

    @screen sm {
        padding: 1rem 0;
    }
}

.c-infobox__content {
    margin: 0 auto;
    margin-top: 1rem;
    bottom: 4em;
    left: 2em;
    right: 2em;
    z-index: 3;
    padding: 0 1rem 1rem;
    transition: top .2s;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;

    @screen md {
        left: 4em;
        right: auto;
    }
}

.c-infobox__button {
    display: flex;
    width: 6.5rem;
    align-items: center;
    justify-content: center;
    margin: 0rem auto;
    margin-top: 1rem;
    background-color: var(--button-background-color);
    border-color: var(--button-background-color);

    &:hover,
    &:active,
    &:focus {
        background-color: var(--button-background-color);
        border-color: var(--button-background-color);
    }
}

.c-infobox__button {
    background-color: var(--button-background-color);
    border-color: var(--button-background-color);

    &:hover,
    &:active,
    &:focus {
        background-color: var(--button-background-color);
        border-color: var(--button-background-color);
    }

}

.c-infobox--color-primary .c-infobox__button {
    --button-background-color: theme('colors.primary.600');

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

.c-infobox--color-secondary .c-infobox__button {
    --button-background-color: theme('colors.secondary.600');

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

.c-infobox--color-cta .c-infobox__button {
    --button-background-color: theme('colors.cta.600');

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

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

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

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

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

.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;
    }
}
