<template>
  <div class="box-container">
    <div class="header" v-if="props.title || props.subtitle">
      <h2 class="box-title h400 caps" v-if="props.title">
        <!-- <span class="icon lg-large" v-if="icon">
          <img :src="icon" svg-inline />
        </span> -->

        {{ props.title }}
      </h2>

      <p
        v-if="props.subtitle"
        class="box-subtitle h600"
        v-html="props.subtitle"
      ></p>
    </div>

    <slot />
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    title: {
      type: String,
      default: "",
    },
    subtitle: {
      type: String,
      default: "",
    },
  },
  setup(props) {
    return {
      props,
    };
  },
});
</script>

<style lang="scss">
.box-container {
  min-height: 100%;
  padding: 24px 16px 16px;
  background-color: var(--background-primary);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex-shrink: 0;

  .header {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;

    // .box-title {
    //   // display: flex;
    //   // align-items: center;

    //   span {
    //     display: inline-block;
    //   }

    //   .icon {
    //     position: relative;
    //     top: 4px;
    //     margin-right: 4px;
    //   }
    // }

    .box-subtitle {
      margin-top: 4px;
      color: var(--text-color-secondary);
    }
  }

  .footer {
    margin-top: 32px;
  }

  @include screen-md() {
    min-height: 74.5vh;
    padding: 24px 48px 32px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    border-radius: 16px;

    .header {
      text-align: left;
      display: block;
    }
  }

  @include screen-lg() {
    padding: 32px 64px 48px;

    .header {
      margin-top: 16px;
      margin-bottom: 48px;

      // .box-title {
      //   .icon {
      //     margin-right: 8px;
      //   }
      // }

      .box-subtitle {
        margin-top: 8px;
      }
    }

    .footer {
      margin-top: 48px;
    }
  }
}
</style>
