{% extends '@Contao/content_element/download.html.twig' %}

{% set container = html_cva(
    base = 'flex',
    variants = {
        position: {
            left: 'justify-begin',
            center: 'justify-center',
            right: 'justify-end',
        }
    }
) %}

{% set button = html_cva(
    base = 'rounded-md font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600',
    variants = {
        style: {
            primary: 'text-white bg-primary-600 hover:bg-primary-500',
            secondary: 'text-gray-900 bg-white ring-1 ring-inset ring-gray-300 hover:bg-gray-50',
        },
        size: {
            sm: 'px-2 py-1 text-sm',
            md: 'px-3.5 py-2.5 text-sm',
            lg: 'px-5 py-3 text-base',
            xl: 'px-5 py-3 text-lg',
        }
    },
    defaultVariant = {
        style: 'secondary',
        size: 'md'
    }
) %}

{% set attributes = attrs().addClass(container.apply({position: data.cvaPosition})) %}
{% set download_link_attributes = attrs(download_link_attributes|default).addClass(button.apply({style: data.cvaButtonStyle, size: data.cvaSize})) %}
