<template>
  <div :class="$style.heading">
    <img v-if="icon" :src="icon" :class="$style.icon">
    <div><slot></slot></div>
  </div>
</template>
<script>
export default {
  props: {
    icon: {
      type: String,
      required: true
    }
  }
}
</script>

<style module lang="scss">

/*-- 見出し --*/

.heading {
  font-weight: bold;
  letter-spacing: 0.22em;
  display: flex;
  align-items:center;
  justify-content: center;
}

.heading span {
  font-family: din-2014, sans-serif;
  font-weight: 600;
  font-size: 2rem;
}
/* .heading:before { */
.icon{
  vertical-align: middle;
  /* content: "";
  display: block;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -0.4rem; */
}
/* .heading.-project:before {
  background-image: url("~assets/images/shared/icon-project-purple.svg");
}
.heading.-work:before {
  background-image: url("~assets/images/shared/icon-work-purple.svg");
}
.heading.-what:before {
  background-image: url("~assets/images/shared/icon-what-purple.svg");
} */

/* pc */
@include mq-pc {
  .heading {
    font-size: 2.6rem;
    margin: 0 0 3.5rem 0;
    text-align: center;
  }
  .heading span {
    font-size: 3.1rem;
  }
  .icon {
    width: 3rem;
    height: 3rem;
    margin-right: 2rem;
  }
}

/* sp */
 @include mq-sp {
  .heading {
    font-size: 2rem;
    justify-content: flex-start;
    margin: 10rem 2rem 2rem 2rem;
  }
  .heading span {
    font-size: 2.4rem;
  }
  .icon {
    width: 2.4rem;
    height: 2.4rem;
    margin-right: 1rem;
  }
}

</style>
