<template>
  <div class="trim--info--column3">
    <ul>
      <li v-for="(item, index) in items" :key="index">
        <h2>{{ item.title }}</h2>
        <div>
          <span>{{ item.value }}</span>
          <em>{{ item.unit }}</em>
        </div>
        <div v-if="item.subText">{{ item.subText }}</div>
      </li>
    </ul>
    <div class="caution--text">
      <span v-if="cautionText" v-html="cautionText"></span>
    </div>
  </div>
</template>

<script setup>
  defineProps({
    items: {
      type: Array,
      required: true,
      default: () => [],
    },
    cautionText: {
      type: String,
      default: "",
    },
  });
</script>

<style scoped>
  .trim--info--column3 {
    width: 100%;
    padding: 0 var(--page-margin) var(--spacing-relative-xl) var(--page-margin);
  }

  .trim--info--column3 ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    margin: 0 auto;
    list-style: none;
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
  }

  .trim--info--column3 li {
    width: 100%;
    text-align: center;
    -webkit-box-flex: 1;
    flex-grow: 1;
    background-color: rgba(252, 252, 253, 0.15);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: start;
    justify-content: flex-start;
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
    animation-delay: 0s;
    text-align: center;
    border-right: 1px solid rgb(16, 19, 25);
  }

  .trim--info--column3 h2 {
    margin: 0px;
    color: rgba(252, 252, 253, 0.7);
    letter-spacing: 0px;
    font-weight: 400;
    text-decoration: none;
    font-size: 16px;
    line-height: 24px;
    font-stretch: 105%;
    padding-bottom: var(--spacing-relative-md);
  }

  .trim--info--column3 li > div:first-of-type {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
    padding-bottom: 4px;
  }

  .trim--info--column3 span {
    color: rgb(252, 252, 253);
    letter-spacing: 0px;
    font-weight: 400;
    text-decoration: none;
    font-size: 52px;
    line-height: 76px;
    font-stretch: 130%;
  }

  .trim--info--column3 em {
    color: rgba(252, 252, 253, 0.7);
    letter-spacing: 0px;
    font-weight: 400;
    text-decoration: none;
    font-size: 16px;
    line-height: 24px;
    font-style: normal;
    font-stretch: 105%;
  }

  .trim--info--column3 li > div:last-child {
    color: rgba(252, 252, 253, 0.7);
    font-family: AudiType, sans-serif;
    letter-spacing: 0px;
    font-weight: 400;
    text-decoration: none;
    font-size: 16px;
    line-height: 24px;
    font-stretch: 105%;
  }

  .trim--info--column3 .caution--text {
    padding-top: var(--spacing-relative-lg);
    margin: var(--spacing-relative-xs) 0 0 0;
  }
  .trim--info--column3 .caution--text span {
    color: rgba(252, 252, 253, 0.7);
    letter-spacing: 0px;
    font-weight: 400;
    text-decoration: none;
    font-size: 12px;
    line-height: 20px;
    font-stretch: 105%;
  }

  /* 반응형 */
  @media (max-width: 768px) {
    .trim--info--column3 {
      padding: 40px 20px;
    }

    .trim--info--column3 ul {
      grid-template-columns: 1fr;
      gap: 30px;
    }

    .trim--info--column3 span {
      font-size: 36px;
    }

    .trim--info--column3 em {
      font-size: 16px;
    }
  }
</style>
