{{ region_emoji }} {{ region_title }} Weekly Beatdown Report
Week of {{ week_start.strftime('%B %d') }} - {{ week_end.strftime('%B %d, %Y') }}

📊 Week Summary: {{ summary.total_beatdowns }} beatdowns, {{ summary.total_attendance }} total attendance, {{ summary.unique_pax }} unique PAX

{% if summary.ao_fngs -%}
:fng: New Guys (FNGs) by AO:
{%- for ao_name, fngs in summary.ao_fngs.items() -%}
{% if fngs %}
- #{{ ao_name.lower() }}:
{%- for fng in fngs %}
  - {{ fng }}
{%- endfor -%}
{% endif -%}
{% endfor -%}
{% endif %}

{% if summary.ao_max_attendance -%}
📈 Highest Attended Workout at Each AO:
{% for ao_name, result in summary.ao_max_attendance.items() | sort(attribute='1.attendance_count', reverse=true) -%}
{{ "%2d"|format(result.attendance_count) }} #{{ ao_name.lower() }} (Q: {{ result.q_names | at_prefix | join(', ') }}) on {{ result.date }} - {{ result.title.replace('Backblast!', '').strip() }}
{% endfor -%}
{% endif -%}

{% if summary.top_pax %}
💪 Top HIMs Who Posted This Week:
{% for pax_name, count in summary.top_pax -%}
{{ count }} @{{ pax_name }}
{% endfor -%}
{% endif -%}

{% if summary.top_qs %}
👑 Leaders in Q Counts:
{% for q_name, count in summary.top_qs -%}
{{ count }} @{{ q_name }}
{% endfor -%}
{% else -%}
👑 Leaders in Q Counts:
• No one has Q'd 2 or more times this week
{% endif -%}

{% if summary.top_aos %}
🏆 AO Stats:
{% for ao in summary.top_aos | sort(attribute='total_posts', reverse=true) -%}
- {{ ao.total_posts }} posts — #{{ ao.ao_name }} (avg {{ ao.avg_pax_per_beatdown()|int }} per BD)
    - {{ ao.total_beatdowns }} BDs, {{ ao.unique_pax_count() }} Unique Pax
{% endfor -%}

REGION TOTAL: {{ summary.total_attendance }} posts, {{ summary.total_beatdowns }} beatdowns, {{ summary.unique_pax }} unique PAX

{% endif %}

{% if summary.top_aos %}
🏆 AO Stats:
```
| AO Name              | BDs/DDs | Unique PAX | Posts | Avg PAX/BD |
|----------------------|---------|------------|-------|------------|
{% for ao in summary.top_aos | sort(attribute='total_posts', reverse=true) -%}
| {{ ao.ao_name.ljust(20) }} | {{ '%7d'|format(ao.total_beatdowns) }} | {{ '%10d'|format(ao.unique_pax_count()) }} | {{ '%5d'|format(ao.total_posts) }} | {{ '%10d'|format(ao.avg_pax_per_beatdown()|int) }} |
{% endfor -%}
|----------------------|---------|------------|-------|------------|
| REGION TOTAL         | {{ '%7d'|format(summary.total_beatdowns) }} | {{ '%10d'|format(summary.unique_pax) }} | {{ '%5d'|format(summary.total_attendance) }} |      -     |
```
{% endif %}
