<template>
  <modal name="SeeMoreExhibitProfile" :clickToClose="false">
    <div class="tw-text-base-primary xl:tw-p-[5px]">
      <div
        class="modal-header tw-flex tw-w-full tw-justify-center tw-mb-[31px] md:tw-mb-[21px] xl:tw-justify-start"
      >
        <button
          class="close tw-transition tw-btn-md"
          @click="$modal.hide('SeeMoreExhibitProfile')"
        ></button>
        <div class="t18 xl:tw-text-[20px]">Exhibit Profile</div>
      </div>
      <div class="modal-content">
        <div v-if="Exhibit.categories">
          <div
            class="tw-w-[220px] tw-mb-[10px] md:tw-body-3 md:tw-w-[780px] md:tw-mb-[15px]"
          >
            <b>{{ $t("Categories") }}：</b>
            <span
              v-for="(categories, index) in Exhibit.categories"
              :key="categories.id"
            >
              <nuxt-link class="black--text" :to="localePath(categories.id)">
                <span class="tw-underline">{{ categories.name }}</span>
              </nuxt-link>
              <span v-if="index < Exhibit.categories.length - 1">, </span>
            </span>
          </div>
        </div>
        <div v-if="Exhibit.subcategories">
          <div
            class="tw-w-[220px] tw-mb-[20px] md:tw-body-3 md:tw-w-[780px] md:tw-mb-[30px]"
          >
            <b>{{ $t("Subcategories") }}：</b>
            <span
              v-for="(subcategories, index) in Exhibit.subcategories"
              :key="subcategories.id"
            >
              <nuxt-link class="black--text" :to="localePath(subcategories.id)">
                <span class="tw-underline">{{ subcategories.name }}</span>
              </nuxt-link>
              <span v-if="index < Exhibit.subcategories.length - 1">, </span>
            </span>
          </div>
        </div>
        <div
          class="tw-body-5 tw-grid tw-gap-[15px] tw-grid-cols-1 md:tw-body-3"
          v-html="SeeMoreExhibitProfile"
        ></div>
      </div>
    </div>
  </modal>
</template>
<script>
export default {
  name: "SeeMoreExhibitProfile",
  props: {
    SeeMoreExhibitProfile: {
      type: String,
    },
    Exhibit: {
      type: Object,
    },

    data() {
      return {};
    },
  },
};
</script>
<style lang="scss" scoped>
.close {
  position: absolute;
  left: 25px;
  top: 25px;
  background-image: url("~/assets/svg/close.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  width: 14px;
  height: 14px;

  @media screen and (min-width: 1366px) {
    margin-left: 530px;
  }
}

:deep() {
  .v--modal-overlay {
    position: fixed;
    box-sizing: border-box;
    left: 0;
    top: 0;
    align-items: flex-end !important;
    width: 100%;
    max-height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 1;

    @media screen and (min-width: 1366px) {
      width: max-content !important;
      display: flex;
      justify-content: center;
    }
  }

  .v--modal {
    background-color: #fefefe !important;
    text-align: left;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 20px 60px -2px rgb(27 33 58 / 40%);
    padding: 20px;
    min-width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0;
    height: auto !important;
    vertical-align: bottom;

    @media screen and (min-width: 1366px) {
      border-radius: 16px;
      width: max-content;
      vertical-align: middle;
    }
  }

  .v--modal-overlay {
    width: max-content !important;
    display: flex;
    justify-content: center;
  }

  .v--modal-box {
    top: 0;
    left: 0;
    width: 100%;
    max-height: 676px !important;
    overflow: auto !important;

    @media screen and (min-width: 1366px) {
      width: max-content;
      max-height: 904px;
    }
  }

  .v--modal-top-right {
    display: block;
    position: fixed;
    right: 0;
    top: 0;
  }

  .v--modal-background-click {
    display: flex;
    align-items: flex-end;
    margin: 0 auto;

    @media screen and (min-width: 1366px) {
      width: max-content;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
</style>
