<template>
  <UiContainer class="space-55-75">
    <div class="space-25-55-75">
      <h2 class="h2-bold-bounded">
        {{ component.front_section_lang[0].data.section_1.title }}
      </h2>
      <div class="flex flex-col xl:flex-row gap-12">
        <div class="rounded-2xl h-[255px] sm:h-[435px] md:h-[500px] w-full xl:min-w-[700px]" :style="{
          backgroundImage: `url('/api/public/file/${component.img[0]}_l.webp')`,
          backgroundSize: 'cover',
          backgroundPosition: 'bottom',
        }" />
        <div class="flex flex-col justify-between space-25-55">
          <div class="flex flex-col gap-4">
            <h4 class="h4-uppercase-bold-inter">
              {{ component.front_section_lang[0].data.section_1.sub_title }}
            </h4>
            <div class="flex flex-col">
              <p v-for="(item, index) in component.front_section_lang[0].data.section_1.sub_description" :key="index">
                {{ item }}
              </p>
            </div>
          </div>
          <h4 class="h4-uppercase-bold-inter">
            {{ component.front_section_lang[0].data.section_1.sub_title_second }}
          </h4>
        </div>
      </div>
    </div>
    <div class="space-25-55-75">
      <h2 class="h2-bold-bounded sm:text-center">
        {{ component.front_section_lang[0].data.section_2.title }}
      </h2>
      <div class="space-25-55">
        <div class="flex flex-col w-full xl:w-[55%]">
          <p v-for="(item, index) in component.front_section_lang[0].data.section_2.description" :key="index">
            {{ item }}
          </p>
        </div>
        <div class="w-full md:ml-10 xl:m-0 xl:grid xl:grid-cols-2">
          <h4 class="col-start-2 col-end-3 h4-uppercase-bold-inter">
            {{ component.front_section_lang[0].data.section_3.title }}
          </h4>
        </div>
      </div>
      <div class="flex flex-col xl:flex-row gap-12">
        <div class="flex flex-col sm:flex-row gap-3 min-w-[60%]">
          <div class="rounded-2xl h-[230px] sm:h-[300px] w-full xl:h-[770px]" :style="{
            backgroundImage: `url('/api/public/file/${component.img[1]}_l.webp')`,
            backgroundSize: 'cover',
            backgroundPosition: 'center',
          }" />
          <div class="rounded-2xl xl:hidden w-full h-[230px] sm:h-[300px] xl:w-full xl:h-[328px]" :style="{
            backgroundImage: `url('/api/public/file/${component.img[2]}_l.webp')`,
            backgroundSize: 'cover',
            backgroundPosition: 'center',
          }" />
        </div>
        <div class="flex flex-col justify-between space-25-55 xl:w-[70%]">
          <div class="hidden xl:block rounded-2xl max-full min-h-[330px]" :style="{
            backgroundImage: `url('/api/public/file/${component.img[2]}_l.webp')`,
            backgroundSize: 'cover',
            backgroundPosition: 'center',
          }" />
          <div class="h-full flex flex-col gap-5 xl:gap-0 justify-between">
            <h4 class="col-start-2 col-end-3 h4-uppercase-bold-inter">
              {{ component.front_section_lang[0].data.section_4.title }}
            </h4>
            <div class="flex flex-col">
              <p v-if="component.front_section_lang[0].data.section_4.description"
                v-html="component.front_section_lang[0].data.section_4.description[0]"></p>
              <br />
              <p v-if="component.front_section_lang[0].data.section_4.description"
                v-html="component.front_section_lang[0].data.section_4.description[1]"></p>
            </div>
            <h4 class="col-start-2 col-end-3 h4-uppercase-bold-inter">
              {{ component.front_section_lang[0].data.section_5.title }}
            </h4>
          </div>
        </div>
      </div>
    </div>
  </UiContainer>
</template>

<script lang="ts" setup>
defineProps<{
  component: {
    id: number
    name: string
    img: string[]
    component_name: string
    is_no_lang: boolean
    page_name: string
    front_section_lang: {
      data: {
        section_1: {
          title: string
          sub_title: string
          sub_description: string[]
          sub_title_second: string
        }
        section_2: {
          title: string
          description: string[]
        }
        section_3: {
          title: string
        }
        section_4: {
          title: string
          description: string[]
        }
        section_5: {
          title: string
        }
      }
      id_front_section: number
      id_lang: number
    }[]
  }
}>();

</script>
