{{ define "main" }}
  {{ if eq .Type "articles" }}
    <!-- Articles Section with Timeline -->
    <div class="page-header">
      <h1>{{ .Title }}</h1>
      <div class="filter-buttons">
        <button class="filter-btn active" data-filter="all">All</button>
        <button class="filter-btn" data-filter="tech">Tech</button>
        <button class="filter-btn" data-filter="life">Life</button>
        <button class="filter-btn" data-filter="quote">Quote</button>
        <button class="filter-btn" data-filter="link">Link</button>
        <button class="filter-btn" data-filter="photo">Photo</button>
      </div>
    </div>

    {{ $featured := (.Pages.ByDate.Reverse) }}
    {{ if and $featured (index $featured 0).Params.featured }}
      {{ partial "featured-card.html" (dict "page" (index $featured 0)) }}
    {{ end }}

    <section class="timeline-section">
      <div class="timeline-line"></div>
      <div class="timeline-feed">
        {{ $pages := .Pages.ByDate.Reverse }}
        {{ range $index, $page := $pages }}
          {{ partial "timeline-item.html" (dict "page" $page "index" $index) }}
        {{ end }}
      </div>
    </section>

    {{ $filters := resources.Get "js/filters.js" | fingerprint }}
    <script defer src="{{ $filters.RelPermalink }}"></script>

  {{ else }}
    <!-- Static Section (is/about, is/contact, etc.) -->
    <div class="container-narrow" style="padding-top: 2rem;">
      {{ .Content }}
    </div>
  {{ end }}
{{ end }}
