{# "In den Kalender übernehmen" — .ics download for the offer's dates.
   Include with { offer, variant? } only; variant 'primary' (default) or
   'secondary' (e.g. when a wishlist button takes the primary role). #}

{% set ics_url = offer.alias
    ? path('cms_offer_ics_slug', { alias: offer.edition.alias, offerUuid: offer.uuid.toBase58, offerSlug: offer.alias })
    : path('cms_offer_ics', { alias: offer.edition.alias, offerUuid: offer.uuid.toBase58 }) %}
{% set classes = variant|default('primary') == 'secondary'
    ? 'inline-flex items-center justify-center gap-2 rounded-md bg-white px-4 py-2.5 text-sm font-semibold text-gray-700 ring-1 ring-inset ring-gray-300 transition-colors hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:ring-white/10 dark:hover:bg-white/5'
    : 'inline-flex items-center justify-center gap-2 rounded-md bg-primary-600 px-4 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 transition-colors' %}
<a href="{{ ics_url }}"
   class="{{ classes }}"
   download>
    <svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><path d="M16 2v4M8 2v4M3 10h18"/><path d="m9 16 2 2 4-4"/></svg>
    {{ 'applicationForm.empty.saveCalendar'|trans({}, 'cms') }}
</a>
