{# Reusable bento card macro. FlexiHub style: dark navy2 surface, decorative watermark number, gradient icon corner.
   `span` controls column span via a static lookup table (Tailwind's content scanner only sees literal class strings,
   so dynamic `col-span-{{ span }}` would produce dead classes — the lookup keeps the utilities discoverable).
   `icon` is rendered via `| safe` so callers can pass either inline SVG markup (preferred) or a plain string.
   The default is a small inline sparkle SVG to avoid any emoji fallback. #}
{% macro bento_card(number, title, description, icon=None, span='1') %}
{%- set span_classes = {'1': 'col-span-1', '2': 'sm:col-span-2', '3': 'sm:col-span-2 md:col-span-3'} -%}
{%- set default_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-7 h-7" aria-hidden="true"><path d="M12 3l1.8 5.4L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.6z"/></svg>' -%}
<div class="relative bg-brand-navy2 p-6 rounded overflow-hidden border border-white/[0.045] {{ span_classes.get(span, 'col-span-1') }}">
  <div class="absolute top-2 right-4 text-[80px] font-black grad-text opacity-20 leading-none" aria-hidden="true">{{ number }}</div>
  <div class="relative">
    <div class="text-brand-b1 mb-4" aria-hidden="true">{{ (icon or default_icon) | safe }}</div>
    <h3 class="text-lg font-bold mb-2 text-white">{{ title | safe }}</h3>
    <p class="text-sm text-white/70">{{ description | safe }}</p>
  </div>
</div>
{% endmacro %}
