<script setup lang="ts">
import { useTheme, useCopy } from '~/composables/useLanding'

definePageMeta({ layout: 'page' })

const t = useTheme()
const copy = useCopy()
const c = computed(() => copy.value.pages.changelog)

useHead({ title: () => `${copy.value.pages.changelog.label} · dezky` })
</script>

<template>
  <LandingPageHeader :label="c.label" :title="c.title" :intro="c.intro" />

  <LandingContainer pad="clamp(56px, 8vw, 56px) clamp(20px, 5vw, 64px) clamp(80px, 12vw, 160px)">
    <div :style="{ maxWidth: '760px' }">
      <div
        v-for="(entry, i) in c.entries" :key="i"
        class="changelog-entry"
        :style="{ display: 'grid', gap: '32px', padding: '32px 0', borderTop: `1px solid ${t.border}`, alignItems: 'start' }"
      >
        <div>
          <div :style="{ fontFamily: '\'Inter Tight\', sans-serif', fontWeight: 600, fontSize: '20px', color: t.fg, letterSpacing: '-0.015em' }">{{ entry[0] }}</div>
          <div :style="{ marginTop: '4px', fontFamily: '\'JetBrains Mono\', monospace', fontSize: '12px', color: t.fgDim }">{{ entry[1] }}</div>
        </div>
        <ul :style="{ margin: 0, padding: 0, listStyle: 'none', display: 'flex', flexDirection: 'column', gap: '12px' }">
          <li
            v-for="(item, j) in entry[2]" :key="j"
            :style="{ display: 'flex', gap: '12px', fontFamily: '\'Inter\', sans-serif', fontSize: '15px', lineHeight: 1.5, color: t.fg }"
          >
            <span :style="{ color: t.fgDim, flexShrink: 0 }">—</span>
            <span>{{ item }}</span>
          </li>
        </ul>
      </div>
    </div>
  </LandingContainer>
</template>

<style scoped>
.changelog-entry {
  grid-template-columns: 160px 1fr;
}

@media (max-width: 768px) {
  .changelog-entry {
    grid-template-columns: 1fr;
  }
}
</style>
