<template>
  <div class="skillbox layout layout--simple">
    <div class="close-button" v-on:click="back">
      <cross class="close-button__icon"></cross>
    </div>
    <router-view></router-view>
    <simple-footer class="layout__footer"></simple-footer>
  </div>
</template>

<script>
  import Cross from '@/components/icons/Cross';
  import SimpleFooter from '@/layouts/SimpleFooter';

  export default {
    components: {
      Cross,
      SimpleFooter
    },

    methods: {
      back() {
        this.$router.go(-1);
      }
    }
  }
</script>

<style lang="scss" scoped>
  @import "@/styles/_variables.scss";
  @import "@/styles/_mixins.scss";

  .layout {
    &--simple {
      display: -ms-grid;
      @supports (display: grid) {
        display: grid;
      }

      width: 100%;

      @include desktop {
        grid-template-columns: 1fr 640px 1fr;
        grid-template-rows: 60px 1fr 105px;
        -ms-grid-columns: 1fr 640px 1fr;

        & > :nth-child(2) {
          grid-column: 2;
          -ms-grid-column: 2;
        }
      }
    }

    &__footer {
      grid-column: 1 / span 3;
    }
  }

  .close-button {
    justify-self: end;
    cursor: pointer;

    display:flex;
    justify-content:end;

    @include desktop {
      grid-column: 3;
      -ms-grid-column: 3;
      margin-right: $medium-spacing;
      margin-top: $medium-spacing;
    }

    &__icon {
      width: 40px;
      height: 40px;
    }
  }
</style>
