<script setup>
import BoxIcon from '@/components/icons/BoxIcon.vue'

defineProps({
  merch: {
    type: Object,
    required: true,
  }
})
</script>

<template>
  <n-card class="responsive-card">
    <template #header>
      <h3 class="card-title">{{ merch.name }}</h3>
    </template>
    <template #cover>
      <div class="cover-wrapper">
        <BoxIcon />
      </div>
    </template>
  </n-card>
</template>

<style scoped>
.responsive-card {
  width: 180px;
  height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.cover-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 12px 0;
  overflow: hidden;
}

.cover-wrapper :deep(svg) {
  width: 100%;
  height: auto;
  max-width: 80%;
}
</style>
