@import 'src/styles/variables';
@import '~flexbin/flexbin';

.wrap {
  @include row_shadow;
  position: relative;
}

.lock,
.edit {
  position: absolute;
  right: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: $radius;
  transform: translate(10px, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition: opacity 0.25s, transform 0.25s;
  cursor: pointer;
  background: $color_danger;
  z-index: 2;

  & > div {
    width: 20px;
    height: 20px;
    border-radius: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  svg {
    width: 16px;
    height: 16px;
  }

  @include tablet {
    right: 0;
    border-radius: 0 0 0 $radius;
    opacity: 1;
    transform: translate(0, 0);
    background: $content_bg_danger;
  }
}

.edit {
  top: 28px;
}

.block {
  min-height: $comment_height;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  padding-bottom: 10px;
  box-sizing: border-box;
  flex-direction: column;

  &:first-child {
    border-top-right-radius: $radius;
  }

  &:last-child {
    border-bottom-right-radius: $radius;
  }

  &:hover {
    .lock,
    .edit {
      opacity: 1;
      pointer-events: all;
      touch-action: initial;
      transform: translate(0, 0);
    }
  }
}

.block_audio {
  align-items: stretch;
  justify-content: center;
  padding-bottom: 0 !important;
}

.block_image {
  padding-bottom: 0 !important;

  .date {
    background: $content_bg;
    border-radius: $radius 0 $radius 0;
    color: $gray_25;
  }
}

.block_text {
  padding: $gap * 0.5 0;
}

.date {
  position: absolute;
  bottom: 1px;
  right: 0;
  font: $font_12_regular;
  color: $gray_75;
  padding: 0 6px 2px;
  z-index: 2;
  background: $content_bg_light;
  border-radius: 4px;
  pointer-events: none;
  touch-action: none;
}

.images {
  cursor: pointer;

  img {
    max-height: 400px;
    border-radius: $radius;
    max-width: 100%;
  }

  &.multiple {
    img {
      max-height: none;
    }

    // Desktop devices
    @include flexbin(25vh, $flexbin-space);

    // Tablet devices
    @media (max-width: $flexbin-tablet-max) {
      @include flexbin($flexbin-row-height-tablet, $flexbin-space-tablet);
    }

    // Phone devices
    @media (max-width: $flexbin-phone-max) {
      @include flexbin($flexbin-row-height-phone, $flexbin-space-phone);
    }
  }
}

.audios {
  & > div {
    height: $comment_height;
    border-radius: $radius;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
}

.renderers {
  width: 100%;
  margin: 0 !important;
}

.prefix {
  @include row_shadow;

  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}
