.flipwall {
  font-size: 0;
  max-width: 1060px;
  text-align: center;
}

.flipwall_item {
  position: relative;
  z-index: 1;
  @include perspective(1000px);
  display: inline-block;
  width: 90%;
  margin: 25px 0;

  // 3 in a row
  @media screen and (min-width: 450px) and (max-width: 599px) {
    width: 31%;
    margin: 25px calc(6% / 7);

    &:nth-of-type(3n) {
      .flipped .backside {
        left: calc(-100% - 20px);
      }
    }
  }

  // 4 in a row
  @media screen and (min-width: 600px) /*and (max-width: $breakpoint_columns - 1)*/ {
    width: 23%;
    margin: 25px calc(8% / 9);

    &:nth-of-type(4n) {
      .flipped .backside {
        left: calc(-100% - 20px);
      }
    }
  }

  /*
  // 5 in a row
  @media screen and (min-width: $breakpoint_columns) {
    width: 18%;
    margin: 25px calc(10% / 11);

    &:nth-of-type(5n) {
      .flipped .backside {
        left: calc(-100% - 20px);
      }
    }
  }
*/
  img {
    max-width: 100%;
  }

  &.flippable .frontside {
    cursor: pointer;
  }

  .card {
    text-align: left;

    .card_inner {
      position: relative;
    }
  }

  .frontside {
    position: relative;
    overflow: hidden;
    z-index: 20;
    text-align: center;
    transition: all .3s .3s;

    img {
      max-width: 80%;
    }
  }

  .backside {
    background: $bg_white;
    position: absolute;
    z-index: 1;
    transform: rotateY(-90deg);
    transition: all .3s;
    overflow: hidden;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, .5);
    padding: 10px 20px;
    text-align: left;

    img {
      max-height: 100px;
      margin-bottom: 10px;
    }

    h2,
    .richtext {
      font-family: $normal;
      font-size: 14px;
      text-align: left;
      line-height: 1.4em;
    }

    .closetop {
      //@include svg_element('sprites-kreuz_schwarz');
      display: inline-block;
      position: absolute;
      right: 20px;
      top: 15px;
      cursor: pointer;

      &:hover {
        //@include svg_element('sprites-kreuz_rot');
      }
    }

    .closebottom {
      display: none;
    }
  }

  .frontside,
  .backside {
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
  }

  &.flipping,
  &.flipped {
    z-index: 100;

    .backside {
      z-index: 100;
      height: auto;

      @media screen and (min-width: 450px) {
        width: calc(200% + 20px);
      }
    }
  }

  &.flipped {
    .frontside {
      transition: all .3s;
      transform: rotateY(90deg);
    }

    .backside {
      transition: all .3s .3s;
      transform: rotateY(0deg);
    }
  }

  &.unflipping {
    z-index: 90;
  }
}