<template>
  <UiContainer class="space-55-75">
    <div class="space-25-55-75">
      <h2 class="h2-bold-bounded">
        {{ component.section_lang_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/files/${component.image_collection}/${component.section_id}/${component.section_img[0]}?thumb=1200x0')`,
            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.section_lang_data.section_1.sub_title }}
            </h4>
            <div class="flex flex-col">
              <p
                v-for="item in component.section_lang_data.section_1
                  .sub_description"
              >
                {{ item }}
              </p>
            </div>
          </div>
          <h4 class="h4-uppercase-bold-inter">
            {{ component.section_lang_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.section_lang_data.section_2.title }}
      </h2>
      <div class="space-25-55">
        <div class="flex flex-col w-full xl:w-[55%]">
          <p v-for="item in component.section_lang_data.section_2.description">
            {{ 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.section_lang_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/files/${component.image_collection}/${component.section_id}/${component.section_img[1]}?thumb=1200x0')`,
              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/files/${component.image_collection}/${component.section_id}/${component.section_img[2]}?thumb=1200x0')`,
              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/files/${component.image_collection}/${component.section_id}/${component.section_img[2]}?thumb=1200x0')`,
              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.section_lang_data.section_4.title }}
            </h4>
            <div class="flex flex-col">
              <p
                v-if="component.section_lang_data.section_4.description"
                v-html="component.section_lang_data.section_4.description[0]"
              ></p>
              <br />
              <p
                v-if="component.section_lang_data.section_4.description"
                v-html="component.section_lang_data.section_4.description[1]"
              ></p>
            </div>
            <h4 class="col-start-2 col-end-3 h4-uppercase-bold-inter">
              {{ component.section_lang_data.section_5.title }}
            </h4>
          </div>
        </div>
      </div>
    </div>
  </UiContainer>
</template>

<script lang="ts" setup>
const props = defineProps<{ component: Component }>();
interface ContentSection {
  title: string;
  sub_title?: string;
  sub_title_second?: string;
  sub_description?: string[];
  description?: string[];
}
type Component = {
  image_collection: string;
  section_id: string;
  section_img: string;
  section_lang_data: {
    section_1: ContentSection;
    section_2: ContentSection;
    section_3: ContentSection;
    section_4: ContentSection;
    section_5: ContentSection;
  };
};
</script>
