<template>
  <div :class="'mb-4' + mdAndDown ? ' mt-12' : ''">
    <h1>
      <slot />
    </h1>
    <h2 v-if="mdAndUp">
      <slot name="subtitle" />
    </h2>
  </div>
</template>

<script setup lang="ts">
import { useDisplay } from 'vuetify'

const { mdAndDown, mdAndUp } = useDisplay()
</script>

<style scoped lang="scss">
h1,
h2 {
  text-align: center;
  text-transform: uppercase;
}

h1 {
  font-size: 4rem;
  line-height: 3.5rem;
  letter-spacing: 0.3rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  letter-spacing: 0.2rem;
  margin-left: 1rem;
  margin-right: 1rem;
}

@media (max-width: 1240px) {
  h1 {
    font-size: 2rem;
    line-height: 2.5rem;
  }

  h2 {
    letter-spacing: 0.1rem;
    width: 100%;
  }
}

@media (max-width: 600px) {
  h1,
  h2 {
    width: 80%;
    margin: auto;
  }

  h1 {
    font-size: 2rem;
    line-height: 2.5rem;
    margin-bottom: 18px;
  }

  h2 {
    letter-spacing: 0.1rem;
    font-size: 1.2rem;
  }
}
</style>
