{# brutalist event-list override — bordered event slabs (cards) or hard-ruled rows (list). Fields: heading, intro, layout, hidePast, events[] (past, media, datetime, start, end, timezone, title, venue, description, link, linkLabel). Keeps builtin hidePast guards. #}
<section class="bru-section bg-background text-foreground{% if class %} {{ class }}{% endif %}">
  <div class="bru-wrap">
    {% if heading %}<h2 class="bru-kicker" style="font-size:clamp(1.75rem,4vw,3rem)">{{ heading }}</h2>{% endif %}
    {% if intro %}<p class="mt-3 text-lg text-muted-foreground" style="max-width:44rem">{{ intro }}</p>{% endif %}
    {% if layout == "cards" %}
    <div class="mt-10 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
      {% for event in events %}{% if not (hidePast and event.past) %}
      <article class="bru-slab bru-shadow bru-hover flex flex-col overflow-hidden{% if event.past %} opacity-60{% endif %}">
        {% if event.media %}<div class="aspect-video overflow-hidden bg-muted" style="border-bottom:3px solid hsl(var(--border))">{% img event.media alt=event.title class="h-full w-full object-cover" %}</div>{% endif %}
        <div class="flex flex-1 flex-col gap-2 p-5">
          <div class="bru-meta text-accent"><time{% if event.datetime %} datetime="{{ event.datetime }}"{% endif %}>{{ event.start }}{% if event.end %} &ndash; {{ event.end }}{% endif %}</time>{% if event.timezone %} <span class="text-muted-foreground">{{ event.timezone }}</span>{% endif %}</div>
          <h3 class="bru-kicker" style="font-size:1.15rem;text-transform:none">{{ event.title }}</h3>
          {% if event.venue %}<p class="text-sm text-muted-foreground">{{ event.venue }}</p>{% endif %}
          {% if event.description %}<p class="text-sm text-muted-foreground">{{ event.description }}</p>{% endif %}
          {% if event.link %}<a href="{{ event.link }}" class="bru-meta mt-auto inline-flex items-center gap-1 pt-2 text-accent">{{ event.linkLabel|default:"Details" }} →</a>{% endif %}
        </div>
      </article>
      {% endif %}{% endfor %}
    </div>
    {% else %}
    <ul class="mt-10" style="border-top:3px solid hsl(var(--border));border-bottom:3px solid hsl(var(--border))">
      {% for event in events %}{% if not (hidePast and event.past) %}
      <li class="flex flex-col gap-3 py-5 sm:flex-row sm:items-center sm:gap-6{% if event.past %} opacity-60{% endif %}" style="border-bottom:1px solid hsl(var(--border))">
        <div class="shrink-0 sm:w-52">
          <div class="bru-meta text-foreground"><time{% if event.datetime %} datetime="{{ event.datetime }}"{% endif %}>{{ event.start }}</time></div>
          {% if event.end %}<div class="bru-meta text-muted-foreground">to {{ event.end }}</div>{% endif %}
          {% if event.timezone %}<div class="bru-meta text-muted-foreground">{{ event.timezone }}</div>{% endif %}
        </div>
        <div class="min-w-0 flex-1">
          <h3 class="bru-kicker" style="font-size:1.05rem;text-transform:none">{{ event.title }}</h3>
          {% if event.venue %}<p class="text-sm text-muted-foreground">{{ event.venue }}</p>{% endif %}
          {% if event.description %}<p class="mt-1 text-sm text-muted-foreground">{{ event.description }}</p>{% endif %}
        </div>
        {% if event.link %}<a href="{{ event.link }}" class="bru-btn bru-btn-ghost shrink-0" style="padding:0.4rem 0.9rem">{{ event.linkLabel|default:"Details" }}</a>{% endif %}
      </li>
      {% endif %}{% endfor %}
    </ul>
    {% endif %}
  </div>
</section>
