---
import LinkCard from "@/components/links/LinkCard.astro";
import LinksLayout from "@/components/links/LinksLayout.astro";
import { getLinks } from "@/lib/collections";

const links = await getLinks();
---

<LinksLayout title="All Links" description="Alle kuratierten Links von Adrian Altner." {links}>
  <div class="page">
    <header class="page__header">
      <h1 class="page__title">All Links</h1>
      <span class="page__count">{links.length}</span>
    </header>
    <ul class="link-list">
      {links.map((link) => <LinkCard {link} />)}
    </ul>
  </div>
</LinksLayout>

<style>
  .page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .page__header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
  }

  .page__title {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #111;
  }

  .page__count {
    font-size: 0.875rem;
    color: #999;
  }

  .link-list {
    margin: 0;
    padding: 0;
  }
</style>
