<template>
  <section 
    class="rounded-3xl mb-8 px-4 py-12 md:p-12 lg:p-16"
    :class="{
      'bg-gradient-conic-2': bgColor === 'conic-2',
      'bg-background-light': bgColor === 'light'
    }">
    <div 
      class="flex flex-col lg:flex-row"
      :class="{
        'lg:flex-row': position === 'left',
        'lg:flex-row-reverse': position === 'right',
        'items-center gap-12': image.display === 'circle',
        'items-center lg:items-start gap-8': image.display === 'normal' && position === 'left',
        'items-center lg:items-start justify-between gap-8': image.display === 'normal' && position === 'right'
      }">

      <div 
        v-if="image"
        :class="{
          'h-20.1 w-20.1 rounded-full overflow-hidden border-4 border-white': image.display === 'circle',
          'h-fit lg:h-20.9 w-full lg:w-fit': image.display === 'normal'
        }">
        <img 
          :src="`/img/${image.src}`"
          :alt="image.alt"
          class="w-full h-full"
          :class="{
            'object-cover': image.display === 'circle',
            'object-contain': image.display === 'normal'
          }"
        />
      </div>

      <div 
        class="flex flex-col gap-4 w-full"
        :class="{
          'lg:w-2/3': image.display === 'circle',
          'lg:w-1/2': image.display === 'normal',
        }">
        <h2 class="font-bold ">{{ title }}</h2>
        <ul v-if="paragraphs" class="flex flex-col gap-6">
          <li v-for="(paragraph, index) in paragraphs" :key="`paragraph-${id}-${index}`">
            <p class="text-lg" v-html="paragraph"></p>
          </li>
        </ul>
        <ul v-if="list" class="flex flex-col gap-4">
          <li v-for="(item, index) in list" :key="`item-list-${id}-${index}`">
            <p class="text-lg" v-html="item"></p>
          </li>
        </ul>
      </div>
    </div>
  </section>
</template>

<script>
export default {
  props: {
    id: {
      type: String,
      default: ""
    },
    title: {
      type: String,
      default: 'title'
    },
    paragraphs: {
      type: Array,
      default: () => []
    },
    list: {
      type: Array,
      default: () => []
    },
    position: {
      type: String,
      default: 'left'
    },
    bgColor: {
      type: String,
      default: 'conic-2'
    },
    image: {
      type: Object,
      default: () => ({
        src: '',
        alt: '',
        display: ''
      })
    }
  }
}
</script>

<style scoped>
.custom-clip {
  clip-path: polygon(0 10%, 100% 0%, 100% 90%, 0% 100%);
}
</style>