// discussion - responses
// ====================

// Table of Contents
// * +wrapper - response list
// * +base - single response element
// * +element - add response area
// * +response - labels and banners
// * +CASE: answered question - collapsed comments in answers
// * +response - labels and banners
// * +comments styling

// +wrapper - response list
.discussion .responses {
  @extend %ui-no-list;

  &:empty {
    display: none;
  }

  // wrapper - response plus comment area
  .forum-response {
    @include animation(fadeIn .3s);
    position: relative;
    margin: $baseline 0;
    border: 1px solid $forum-color-border;
    border-radius: $forum-border-radius;
    box-shadow: 0 0 1px $shadow;
  }

  // wrapper - main response area
  .discussion-response {
    box-sizing: border-box;
    @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
    padding: $baseline;
    background-color: $forum-color-background;
  }
  
  .posted-by {
    @extend %t-ultrastrong;
  }
}

// +base - single response element
.discussion-response {
  .response-header-content {

    // CASE: larger username for responses 
    .username {
      @extend %t-weight5;
      font-size: $forum-base-font-size;
    }
  }

  // rtl resets for response list elements
  .response-body ol, .response-body ul { // Fix up the RTL-only _reset.scss, but only in specific places
    @include padding-left($baseline*2);
    @include padding-right(0);
  }
}

// +element - add response area
.discussion .add-response {
  display: inline;
  padding: $baseline/2;
}

// +CASE: answered question - collapsed comments in answers
.forum-response .action-show-comments {
  font-size: $forum-base-font-size;
  box-sizing: border-box;
  display: block;
  padding: ($baseline/2) $baseline;
  width: 100%;
  background: $gray-l6;
  box-shadow: 0 1px 3px -1px $shadow inset;
}

// +response - labels and banners
// NOTE - these styles seem to no longer be in use. They have been isolated here, but should be ideally removed or fixed. 
.discussion .responses .forum-response {

  // CASE: label - staff response
  &.staff {
    padding-top: 38px;
    border-color: #009fe2;
  }

  // CASE: label - community TA response
  &.community-ta{
    padding-top: 38px;
    border-color: $forum-color-community-ta;
  }

  // CASE: banner - staff response
  .staff-banner {
    @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
    @include left(0);
    position: absolute;
    top: 0;
    width: 100%;
    height: 14px;
    padding: 1px ($baseline/4);
    box-sizing: border-box;
    background: #009fe2;
    font-size: $forum-small-font-size;
    font-weight: 700;
    color: $white;
  }

  // CASE: banner - community TA response
  .community-ta-banner{
    @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
    @include left(0);
    position: absolute;
    top: 0;
    width: 100%;
    height: 14px;
    padding: 1px ($baseline/4);
    box-sizing: border-box;
    background: $forum-color-community-ta;
    font-size: $forum-small-font-size;
    font-weight: 700;
    color: $white;
  }

  // STATE: loading - response list
  &.loading {
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }
}

// +comments styling
.discussion .comments {
  @extend %ui-no-list;
  @include border-radius(0, 0, $forum-border-radius, $forum-border-radius);
  background: $gray-l6;
  box-shadow: 0 1px 3px -1px $shadow inset;

  > li {
    border-top: 1px solid $forum-color-border;
    padding: ($baseline/2) $baseline;
    position: relative;
  }

  blockquote {
    background: $forum-color-background-light;
    border-radius: $forum-border-radius;
    padding: ($baseline/4) ($baseline/2);
    font-size: $forum-base-font-size;
  }

  .comment-form {
    @include clearfix();
    padding: ($baseline/2) 0;

    .comment-form-input {
      padding: ($baseline/4) ($baseline/2);
      background-color: $forum-color-background;
      font-size: $forum-base-font-size;
    }

    .discussion-submit-comment {
      @include float(left);
      margin-top: 8px;
    }

    .wmd-input {
      @include transition(all .2s linear 0s);
      height: 40px;
    }

    .discussion-errors {
      margin: 0;
    }
  }
}

.response-count {
  @include float(right);
  @include margin-right($baseline / 2);
  color: $forum-color-response-count;
  font-size: $forum-base-font-size;
}

.response-pagination {
  visibility: visible;
  margin: ($baseline / 2) 0;

  &:empty {
    visibility: hidden;
  }

  .response-display-count {
    display: block;
    padding: ($baseline/2) 0;
    color: $forum-color-response-count;
    font-size: $forum-base-font-size;
  }

  .load-response-button {
    @include text-align(left);
    position: relative;
    margin: ($baseline/2) 0;
    width: 100%;
  }
}
