<template>
  <section 
  :id="id"
  class="flex flex-col gap-8  rounded-3xl mb-8 px-4 pt-12 pb-16 md:p-16 md:pb-24"
  :class="{
    'bg-gradient-conic-cards': bgColor === 'gradient-conic',
    'bg-linear-to-t from-consumo-extra-light to-background-light': bgColor === 'consumo',
    'bg-linear-to-t from-iguales-extra-light to-background-light': bgColor === 'iguales',
    'bg-linear-to-t from-aula-extra-light to-background-light': bgColor === 'aula',
    'bg-linear-to-t from-certifica-extra-light to-background-light': bgColor === 'certifica',
    'bg-linear-to-t from-foro-extra-light to-background-light': bgColor === 'foro',
    'bg-linear-to-t from-ods-extra-light to-background-light': bgColor === 'ods',
  }">
    <div class="flex flex-col justify-center items-center w-full">
      <h2 class="font-bold mb-6">{{ title }}</h2>
      <p class="text-lg text-center" v-html="description"></p>
    </div>

    <ul  class="grid grid-cols-12 gap-8 mx-auto">
      <li 
        v-for="(item, index) in cards" :key="`cards-${id}-${index}`" 
        :class="{
          'col-span-12 md:col-span-6 lg:col-span-4': display === 'col-3',
          'col-span-12 lg:col-span-4': display === 'col-3-transparent',
          'col-span-12 md:col-span-6 lg:col-span-3': display === 'col-4',
        }">
        <CardTool 
          :color="item.color"
          :title="item.title"
          :description="item.description"
          :image="item.image"
          :link="item.link"
          class=""
        />
      </li>
    </ul>
  </section>
</template>

<script>
export default {
  props: {
    id: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "",
    },
    description: {
      type: String,
      default: "",
    },
    display: {
      type: String,
      default: "col-3",
    },
    bgColor: {
      type: String,
      default: "",
    },
    cards: {
      type: Array,
      default: () => [],
    },
  },
  
};
</script>
