{# Contributor card macro #}
{% macro contributor_card(contributor=none, display_name=none, slug=none, bio=none, website=none, verified=none, featured=false) %}
{% if contributor is none %}
{% set contributor = {
    "display_name": display_name,
    "slug": slug,
    "bio": bio,
    "website": website,
    "verified": verified
} %}
{% endif %}
{% if featured %}
<!-- Featured contributor (horizontal layout) -->
<article class="bg-white rounded-lg border border-gray-200 shadow-sm p-6 flex items-center space-x-6">
    <!-- Avatar -->
    <div class="flex-shrink-0 w-16 h-16 bg-gradient-to-br from-indigo-500 to-cyan-500 rounded-full flex items-center justify-center">
        <span class="text-white text-2xl font-bold">{{ contributor.display_name[0]|upper }}</span>
    </div>

    <!-- Info -->
    <div class="flex-1 min-w-0">
        <h3 class="text-xl font-semibold text-gray-900">{{ contributor.display_name }}</h3>
        <p class="text-sm text-gray-500">@{{ contributor.slug }}</p>
        <p class="mt-2 text-gray-600 line-clamp-2">{{ contributor.bio or 'Active community member and tool creator.' }}</p>
    </div>

    <!-- Actions -->
    <div class="flex-shrink-0">
        <a href="{{ url_for('web.publisher_profile', slug=contributor.slug) }}"
           class="inline-flex items-center px-4 py-2 border border-indigo-600 text-sm font-medium rounded-md text-indigo-600 hover:bg-indigo-50 transition-colors">
            View Profile
        </a>
    </div>
</article>
{% else %}
<!-- Regular contributor card (vertical layout) -->
<article class="bg-white rounded-lg border border-gray-200 shadow-sm p-4 text-center">
    <!-- Avatar -->
    <div class="w-12 h-12 bg-gradient-to-br from-indigo-500 to-cyan-500 rounded-full flex items-center justify-center mx-auto">
        <span class="text-white text-lg font-bold">{{ contributor.display_name[0]|upper }}</span>
    </div>

    <!-- Info -->
    <h3 class="mt-3 font-semibold text-gray-900">{{ contributor.display_name }}</h3>
    <p class="text-sm text-gray-500">@{{ contributor.slug }}</p>

    {% if contributor.bio %}
    <p class="mt-2 text-sm text-gray-600 line-clamp-2">{{ contributor.bio }}</p>
    {% endif %}

    <!-- Link -->
    <a href="{{ url_for('web.publisher_profile', slug=contributor.slug) }}"
       class="mt-3 inline-block text-sm font-medium text-indigo-600 hover:text-indigo-800 transition-colors">
        View Profile
    </a>
</article>
{% endif %}
{% endmacro %}
