.book-summary {
  position: absolute;
  top: 0;
  left: -@sidebar-width;
  bottom: 0px;
  z-index: 1;
  overflow-y: auto;

  width: @sidebar-width;
  color: @sidebar-color;
  background: @sidebar-background;
  border-right: @sidebar-border-right;

  .transition(left @sidebar-transition-duration ease);

  ul.summary {
    list-style: none;
    margin: 0px;
    padding: 0px;

    .transition(top 0.5s ease);

    > ul.articles {
      padding-left: unset;
    }

    hr {
      height: 2px;
      padding: 0;
      overflow: hidden;
      background-color: #e7e7e7;
      border: none;
      margin-left: 20px;
    }

    .chapter {
      > .articles {
        overflow: hidden;
        max-height: 0px;
      }

      hr {
        display: none;
      }

      &.expanded {
        > .articles {
          max-height: 9999px;
        }

        > hr {
          margin-left: 40px;
          display: block;
        }
      }
    }

    .exc-trigger {
      position: absolute;
      left: 5px;
      top: 12px;

      &:before {
        content: "\f105";
      }
    }

    .expanded {
      > a,
      > span {
        .exc-trigger:before {
          content: "\f107";
        }
      }
    }

    li {
      list-style: none;

      &.header {
        padding: @sidebar-link-padding-v @sidebar-link-padding-h;
        padding-top: 20px;
        text-transform: capitalize;
        color: @sidebar-header-color;
      }

      &.divider {
        height: 1px;
        margin: 7px 0;
        overflow: hidden;
        background: @sidebar-divider-color;
      }

      i.fa-check {
        display: none;
        position: absolute;
        right: 9px;
        top: 16px;
        font-size: 9px;
        color: @sidebar-icon-color;
      }

      &.done {
        > a {
          color: @sidebar-link-completed;
          font-weight: @sidebar-link-completed-weight;

          i {
            display: inline;
          }
        }
      }

      a,
      span {
        display: block;
        padding: @sidebar-link-padding-v @sidebar-link-padding-h;
        padding-left: 20px;
        border-bottom: none;
        color: @sidebar-link-color;
        background: @sidebar-link-background;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        position: relative;
      }

      a:hover {
        text-decoration: underline;
      }

      a:focus {
        outline: none;
      }

      &.active > a {
        color: @sidebar-link-hover-color;
        background: @sidebar-link-hover-background;
        text-decoration: none;
      }

      ul {
        padding-left: @sidebar-nested-padding;
      }
    }

    a > b {
      padding-right: 5px;
    }
  }

  @media (max-width: @sidebar-breakpoint) {
    width: calc(~"100% - 60px");
    bottom: 0px;
    left: -100%;
  }
}

.book {
  &.with-summary {
    .book-summary {
      left: 0px;
    }
  }

  &.without-animation {
    .book-summary {
      .transition(none) !important;
    }
  }

  &.color-theme-1 {
    .book-summary {
      color: @sidebar-color-1;
      background: @sidebar-background-1;
      border-right: @sidebar-border-right-1;

      .book-search {
        background: @sidebar-search-background-1;

        input,
        input:focus {
          border: 1px solid @sidebar-search-input-border-color-1;
        }
      }

      ul.summary {
        li {
          &.divider {
            background: @sidebar-divider-color-1;
            box-shadow: none;
          }

          i.fa-check {
            color: @sidebar-icon-color-1;
          }

          &.done > a {
            color: @sidebar-link-completed-1;
          }

          a,
          span {
            color: @sidebar-link-color-1;
            background: @sidebar-link-background-1;
            font-weight: @sidebar-link-weight-1;
          }

          &.active > a,
          a:hover {
            color: @sidebar-link-hover-color-1;
            background: @sidebar-link-hover-background-1;
            font-weight: @sidebar-link-hover-weight-1;
          }
        }

        hr {
          background-color: @page-hr-color-1;
        }
      }
    }
  }

  &.color-theme-2 {
    .book-summary {
      color: @sidebar-color-2;
      background: @sidebar-background-2;
      border-right: @sidebar-border-right-2;

      .book-search {
        background: @sidebar-search-background-2;

        input,
        input:focus {
          border: 1px solid @sidebar-search-input-border-color-2;
        }
      }

      ul.summary {
        li {
          &.divider {
            background: @sidebar-divider-color-2;
            box-shadow: none;
          }

          i.fa-check {
            color: @sidebar-icon-color-2;
          }

          &.done > a {
            color: @sidebar-link-completed-2;
          }

          a,
          span {
            color: @sidebar-link-color-2;
            background: @sidebar-link-background-2;
            font-weight: @sidebar-link-weight-2;
          }

          &.active > a,
          a:hover {
            color: @sidebar-link-hover-color-2;
            background: @sidebar-link-hover-background-2;
            font-weight: @sidebar-link-hover-weight-2;
          }
        }

        hr {
          background-color: @page-hr-color-2;
        }
      }
    }
  }
}