// flap cards

// import global variables
@import './variables.less';

@lightBG: #f5f7f8;

.cards {
  display: flex;
  flex-flow: row wrap;
  margin: 1.5em auto 12.5em;
}

.flap-card {
  width: 30%;
  max-width: 300px;
  box-shadow: @cardBoxShadow;
  background: white;
  margin: 20px 1.6%;
  position: relative;
  text-align: left;
  transition: all 0.3s 0s ease-in;
  z-index: 1;

  a.btn-toggle {
    background: @bannerBgColor;
    border-radius: 4px;
    box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.1);
    color: white;
    display: inline-block;
    padding: 6px 30px 8px;
    position: relative;
    text-decoration: none;
    font-size: @regularFontSize;
    transition: all 0.1s 0s ease-out;
  }

  a.btn-toggle:hover {
    background: lighten(@bannerBgColor, 2.5);
    box-shadow: 0 8px 1px 0 rgba(0, 0, 0, 0.075);
    transform: translateY(-2px);
    transition: all 0.25s 0s ease-out;
  }

  a.btn-toggle:active,
  a.btn-toggle:active {
    background: darken(@bannerBgColor, 2.5);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.1);
    transform: translate3d(0, 1px, 0);
    transition: all 0.025s 0s ease-out;
  }

  .card__thumbnail {
    // width: 55%;
    // height: 120px;
    margin: 0 auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: white;
  }

  .card__title {
    border-top: 1px solid @lightBG;
    background: white;
    padding: 15px;
    position: relative;
    z-index: 0;
    cursor: pointer;

    a.toggle-info {
      border-radius: 26px;
      height: 26px;
      width: 26px;
      padding: 0;
      position: absolute;
      right: 15px;
      top: 15px;

      span {
        background: white;
        display: block;
        height: 2px;
        position: absolute;
        top: 13px;
        transition: all 0.15s 0s ease-out;
        width: 9px;
      }

      .left {
        right: 11px;
        transform: rotate(45deg);
      }

      .right {
        left: 11px;
        transform: rotate(-45deg);
      }
    }

    h2 {
      font-weight: 400;
      letter-spacing: -0.05em;
      margin: 0 32px 0 0;
      padding: 0;
      font-size: @regularFontSize;
      line-height: 26px;
      color: @titleColor;
    }
  }

  .card__description {
    padding: 10px 15px;
    position: relative;
    font-size: 14px;
    line-height: 24px;
    color: @lightDimGray;
  }

  .card__actions {
    box-shadow: 0 10px 20px -2px rgba(0, 0, 0, 0.1);
    padding: 15px;
    text-align: center;
  }

  .card__flap {
    background: darken(white, 10);
    position: absolute;
    width: 100%;
    transform-origin: top;
    transform: rotateX(-90deg);
  }

  .flap1 {
    transition: all 0.3s 0.3s ease-out;
    z-index: -1;
  }

  .flap2 {
    transition: all 0.3s 0s ease-out;
    z-index: -2;
  }
}

.cards.showing {
  .card {
    cursor: pointer;
    opacity: 0.6;
    transform: scale(0.88);

    &:hover {
      opacity: 0.94;
      transform: scale(0.92);
    }
  }
}

.card.show {
  opacity: 1 !important;
  transform: scale(1) !important;

  .card__title {
    a.toggle-info {
      background: @salmon !important;

      span {
        width: 10px;
        top: 12px;
      }

      span.left {
        right: 8px;
      }

      span.right {
        left: 8px;
      }
    }
  }

  .card__flap {
    background: white;
    transform: rotateX(0deg);
  }

  .flap1 {
    transition: all 0.3s 0s ease-out;
  }

  .flap2 {
    transition: all 0.3s 0.2s ease-out;
  }
}

@media (max-width: 767px) {
  .flap-card {
    width: 100%;
  }
}

@media (max-width: 649px) {
  .cards {
    justify-content: center;
  }
}
