@media (max-width: $screen-sm-max) {
  .issuable-affix {
    margin-top: 20px;
  }
}

@media (max-width: $screen-md-max) {
  .issuable-affix {
    position: static;
  }
}

@media (min-width: $screen-md-max) {
  .issuable-affix {
    &.affix-top {
      position: static;
    }

    &.affix {
      position: fixed;
      top: 70px;
      margin-right: 35px;

      &.no-affix {
        position: relative;
        top: 0;
      }
    }
  }
}

.issuable-details {
  section {
    .issuable-discussion {
      margin-right: 1px;
    }
  }
}

.issuable-filter-count {
  span {
    display: block;
    margin-bottom: -16px;
    padding: 13px 0;
  }
}

.issuable-show-labels {
  a {
    margin-right: 5px;
    margin-bottom: 5px;
    display: inline-block;
    .color-label {
      padding: 6px 10px;
    }
  }
}

.issuable-sidebar {
  .block {
    @include clearfix;
    padding:  $gl-padding 0;
    border-bottom: 1px solid $border-gray-light;
    // This prevents the mess when resizing the sidebar
    // of elements repositioning themselves..
    width: $gutter_inner_width;
    overflow-x: hidden;
    // --

    &:first-child {
      padding-top: 5px;
    }

    &:last-child {
      border: none;
    }

    span {
      margin-top: 7px;
      display: inline-block;
    }

    .issuable-count {

    }

    .gutter-toggle {
      margin-left: 20px;
      border-left: 1px solid $border-gray-light;
      padding-left: 10px;
    }
  }

  .title {
    color: $gl-text-color;
    margin-bottom: 8px;

    .avatar {
      margin-left: 0;
    }

    label {
      font-weight: normal;
      margin-right: 4px;
    }

    .edit-link {
      color: $gl-gray;
    }
  }

  .cross-project-reference {
    color: $gl-link-color;

    span {
      white-space: nowrap;
      width: 85%;
      overflow: hidden;
      position: relative;
      display: inline-block;
      text-overflow: ellipsis;
    }

    cite {
      font-style: normal;
    }

    button {
      float: right;
      padding: 3px 5px;
    }
  }

  .selectbox {
    display: none
  }

  .btn-clipboard {
    color: $gl-gray;
  }

  .participants .avatar {
    margin-top: 6px;
    margin-right: 2px;
  }
}


.right-sidebar {
  position: fixed;
  top: 58px;
  right: 0;
  height: 100%;
  transition-duration: .3s;
  background: $gray-light;
  overflow: scroll;
  padding: 10px 20px;

  &.right-sidebar-expanded {
    width: $gutter_width;

    hr {
      display: none;
    }
  }

  .subscribe-button {
    span {
      margin-top: 0;
    }
  }

  &.right-sidebar-collapsed {
    width: $sidebar_collapsed_width;
    padding-top: 0;
    overflow-x: hidden;

    hr {
      margin: 0;
      color: $gray-normal;
      border-color: $gray-normal;
      width: 62px;
      margin-left: -20px
    }

    .block {
      border-bottom: none;
      padding: 15px 0 0 0;
    }
  }

  .btn {
    background: $gray-normal;
    border: 1px solid $border-gray-normal;
  }

  &.right-sidebar-collapsed {
    .issuable-count,
    .issuable-nav,
    .assignee > *,
    .milestone > *,
    .labels > *,
    .participants > *,
    .light > *,
    .project-reference > * {
      display: none;
    }

    .gutter-toggle {
      margin-left: -$gutter_inner_width + 4;
    }

    .sidebar-collapsed-icon {
      display: block;
      float: left;
      width: 62px;
      text-align: center;
      margin-left: -19px;
      padding-bottom: 10px;
      color: #999999;

      span {
        display: block;
        margin-top: 0;
      }
    }

  }

  &.right-sidebar-expanded {
    .sidebar-collapsed-icon {
      display: none;
    }
  }
}
