.starter-card {
  background-color: $color-white;
  border-radius: 0.3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  height: 0;
  margin: 0 auto;
  padding-bottom: 95%;
  position: relative;
  position: relative;
  z-index: 0;

  &.open {
    z-index: 500;
  }
}

.starter-card--image-container {
  border-radius: 0.3rem 0.3rem 0 0;
  bottom: 0;
  display: block;
  left: 0;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: 0;
}

.starter-card--image {
  height: auto;
  width: 100%;
}

.starter-card--preview-link {
  background-color: $color-white;
  border: 1px solid $color-grey;
  border-radius: 0.3rem;
  color: #1d92ff;
  padding: 0.2rem 0.75rem;
  position: absolute;
  right: 1rem;
  text-decoration: none;
  top: 1rem;
  transition: all 0.3s cubic-bezier(0.694, 0, 0.335, 1);

  &:hover {
    background-color: $color-light-grey;
  }

  &:active {
    background-color: $color-grey;
  }
}

.preview-link--icon {
  fill: #1d92ff;
  height: 11px;
  position: relative;
}

.starter-card--info {
  background-color: $color-white;
  border-radius: 0 0 0.3rem 0.3rem;
  border-top: 1px solid $color-grey;
  bottom: 0;
  display: grid;
  grid-template-areas:
    "pills cta"
    "title cta";
  grid-template-columns: 1fr 3.5rem;
  left: 0;
  padding: 1.5rem 1.75rem;
  position: absolute;
  width: 100%;
}

.starter-card--pills {
  grid-area: pills;
  padding-bottom: 0.25rem;
}

.starter-card--title {
  color: $color-black;
  font-size: 1.35rem;
  font-weight: 700;
  grid-area: title;
}

.starter-card--subtitle {
  &::before {
    content: "–";
    display: inline-block;
    font-size: 1.35rem;
    margin-left: 0.25rem;
    margin-right: 0.5rem;
  }

  color: $color-medium-dark;
  font-weight: 400;
}

.starter-card--cta {
  align-content: center;
  align-items: center;
  align-self: end;
  background-color: $color-black;
  border: none;
  border-radius: 100%;
  color: $color-white;
  cursor: pointer;
  display: flex;
  grid-area: cta;
  height: 3.5rem;
  justify-content: center;
  margin-bottom: 0.25rem;
  outline: none;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.694, 0, 0.335, 1);
  width: 3.5rem;

  .starter-card.open.menu-position-bottom & {
    transform: rotate(90deg);
  }

  &:hover {
    background-color: $color-dark;
  }

  &:active {
    background-color: $color-medium-dark;
  }
}

@keyframes cta {
  0% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(3.5rem, 0, 0);
  }

  51% {
    transform: translate3d(-3.5rem, 0, 0);
  }

  100% {
    transform: translate3d(0, 0, 0);
  }
}

.cta--icon {
  display: inline-block;
  fill: white;
  flex: 0 0 auto;
  transform: translate3d(0, 0, 0);

  .starter-card:hover & {
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
    animation-name: cta;
    animation-timing-function: cubic-bezier(0.694, 0, 0.335, 1);
  }
}

@keyframes starter-menu {
  0% {
    opacity: 0;
    transform: translate3d(1rem, -50%, 0);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, -50%, 0);
  }
}

@keyframes starter-menu--bottom {
  0% {
    opacity: 0;
    transform: translate3d(-100%, 1rem, 0);
  }

  100% {
    opacity: 1;
    transform: translate3d(-100%, 0, 0);
  }
}

.starter-card--menu {
  animation-duration: 0.2s;
  animation-iteration-count: 1;
  animation-name: starter-menu;
  animation-timing-function: cubic-bezier(0.694, 0, 0.335, 1);
  background-color: white;
  border: 1px solid $color-grey;
  border-radius: 0.3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  left: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  top: 0;
  transform: translate3d(0, -50%, 0);
  z-index: 500;

  .starter-card & {
    display: none;
  }

  &.position-bottom {
    animation-name: starter-menu--bottom;
    transform: translate3d(-100%, 0, 0);
  }

  &.closed {
    opacity: 0;
    transform: translate3d(1rem, -50%, 0);
    transition: all 0.15s cubic-bezier(0.694, 0, 0.335, 1);

    &.position-bottom {
      transform: translate3d(-100%, 1rem, 0);
    }
  }
}

.starter-card--menu-item {
  &:not(:last-child) {
    border-bottom: 1px solid $color-grey;
  }
}

.starter-card--menu-link {
  background-color: $color-white;
  cursor: pointer;
  display: block;
  font-size: 1.3rem;
  min-width: 10rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.694, 0, 0.335, 1);

  &:hover {
    background-color: $color-light-grey;
  }

  &:active {
    background-color: $color-grey;
  }
}
