@import 'variables';
@import 'bourbon';
$highlighting-color: #ffdf60;

.discussion-editor-highlighting,
.discussion-preview-highlighting {
  background-color: mix(#fff, $highlighting-color, 60%);
  padding: 0.25em 0;

  @include transition(0.12s ease-out background-color);
}

.discussion-editor-highlighting--hover,
.discussion-editor-highlighting--selected,
.discussion-preview-highlighting--hover,
.discussion-preview-highlighting--selected {
  background-color: mix(#fff, $highlighting-color, 20%);

  * {
    background-color: transparent;
  }
}

.discussion-preview-highlighting {
  cursor: pointer;
}

.discussion-preview-highlighting--selected {
  cursor: auto;
}

.new-discussion-btn {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.07), 0 2px 2px 0 rgba(0, 0, 0, 0.049);
  color: rgba(128, 128, 128, 0.7);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.25;
  margin-left: 2px;
  margin-top: -10px;
  padding: 1px 2px 0;
  position: absolute;

  @include transition(0.16s ease-out color);

  &:hover {
    color: rgba(128, 128, 128, 1);
  }
}

.discussion-tab {
  padding: 0 15px;
}

.discussion-tab--selected {
  .discussion-entry {
    opacity: 0.15;

    &:hover {
      opacity: 0.4;
    }
  }

  .discussion-entry--selected {
    &,
    &:hover {
      opacity: 1;
    }
  }
}

.discussion-entry {
  margin: 20px 0;

  @include transition(0.12s ease-out opacity);

  .md-chips {
    padding-bottom: 0;
  }
}

.discussion-entry__selector {
  cursor: pointer;
}

.discussion-entry__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;

  .discussion-entry--selected & {
    text-overflow: clip;
    white-space: normal;

    .discussion-entry__text-span {
      background-color: mix($body-color, $highlighting-color, 20%);
    }
  }
}

.discussion-entry__text-span {
  padding: 0.2em 0;

  &,
  & span {
    background-color: transparent;
    display: inline;
  }
}

.discussion-entry__text-quote {
  color: rgba(0, 0, 0, 0.125);
  display: inline-block;
  font-size: 18px;
  line-height: 1;
}

.discussion-entry__chip {
  .discussion-entry & {
    cursor: pointer;
    font-size: 10px;
    height: 22px;
    line-height: 22px;
    margin: 0;
  }
}

.discussion-entry__btn {
  color: rgba(0, 0, 0, 0.54);
  font-size: 20px;
  line-height: 28px;
  padding: 0;
  width: 28px;
}

.comment-entry {
  margin: 6px 0;
  position: relative;

  &::before {
    background-color: rgba(0, 0, 0, 0.067);
    content: '';
    height: 100%;
    left: 12px;
    position: absolute;
    top: 20px;
    width: 2px;
    z-index: -1;
  }
}

.comment-entry__inner {
  padding-left: 34px;
}

.comment-entry--new::before {
  display: none;
}

.comment-entry__text {
  font-size: 14px;
}

$comment-btn-size: 20px;

.comment-entry__delete-btn {
  color: rgba(0, 0, 0, 0.54);
  font-size: 17px;
  height: $comment-btn-size;
  margin-left: -$comment-btn-size;
  margin-top: 6px;
  max-width: $comment-btn-size;
  min-width: $comment-btn-size;
  opacity: 0;
  padding: 0;

  @include transition(0.16s ease-out all);

  .comment-entry__inner:hover & {
    opacity: 1;
  }
}

.comment-entry__input {
  background-color: #fff;
  font-size: 0.9em;
  font-variant-ligatures: no-common-ligatures;
  margin: 5px 0 5px 25px;
  min-height: 80px;
  overflow: auto;
  padding: 4px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  word-wrap: break-word;
}

.comment-info {
  margin: 10px 0 5px;
}

.comment-info__created {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.7em;
  padding-left: 12px;
  text-shadow: 1px 1px rgba(255, 255, 255, 0.33);
}

.discussion-postit {
  cursor: pointer;
  font-size: 13px;
  height: 160px;
  left: 920px;
  top: -200px;
  width: 160px;

  .preview & {
    left: 840px;
  }
}

.discussion-postit__user-name {
  display: block;
  font-size: 14px;
}

.comment-text {
  width: 100%;

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-size: inherit;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  blockquote,
  pre,
  ul,
  ol,
  dl {
    margin: 0.5em 0;
  }

  pre {
    font-variant-ligatures: no-common-ligatures;
    white-space: pre-wrap;
    word-break: break-word;
    word-wrap: break-word;
  }

  img {
    max-width: 100%;
  }

  .table-wrapper {
    max-width: 100%;
    overflow: auto;
  }
}
