<template>
  <div class="section-padding">
    <div class="container-content">
      <div class="mx-auto max-w-2xl">
        <div class="section-icon mx-auto mb-6">
          <div :class="`i-lucide-${content?.icon ?? 'users'}`" class="h-12 w-12" />
        </div>

        <p class="mb-2 font-mono text-sm tracking-widest text-primary uppercase text-center">
          {{ content?.kicker }}
        </p>

        <h1 class="font-display text-3xl font-bold mb-4 text-center" style="color: hsl(var(--color-text))">
          {{ content?.title }}
        </h1>

        <p class="text-lg leading-relaxed mb-8 text-center" style="color: hsl(var(--color-text-muted))">
          {{ content?.description }}
        </p>

        <span v-if="content?.gestation" class="gestation-badge mx-auto mb-8">
          <div class="i-lucide-flask-conical h-3 w-3" />
          En gestation
        </span>

        <!-- Content -->
        <div v-if="content?.content" class="prose-block mb-10">
          <p class="leading-relaxed whitespace-pre-line" style="color: hsl(var(--color-text-muted))">
            {{ content.content }}
          </p>
        </div>

        <div class="text-center">
          <UiBaseButton variant="ghost" to="/economique">
            <div class="i-lucide-arrow-left mr-2 h-4 w-4" />
            Autonomie économique
          </UiBaseButton>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
const { data: content } = await usePageContent('economique/productions-collectives')

useSeoPage({
  title: content.value?.meta?.title ?? 'Productions collectives',
  description: content.value?.description as string ?? 'Initiatives et productions collectives dans le cadre de l\'économie du don.',
})
</script>

<style scoped>
.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border-radius: 1rem;
  background: hsl(var(--color-primary) / 0.1);
  border: 1px solid hsl(var(--color-primary) / 0.2);
  color: hsl(var(--color-primary));
}

.gestation-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: hsl(var(--color-accent) / 0.12);
  color: hsl(var(--color-accent));
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-mono);
  width: fit-content;
}

.prose-block {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: hsl(var(--color-surface));
}
</style>
