// Documentation styles
// --------------------

body {
  margin: 0;
}

// Import rainbow.js highlighter.
@import "rainbow-github";

#kss-node {

  border-top: 4px solid @key-color;
  background: #fff;

  // Variables
  @text-color: #222;
  @key-color: #972;
  @border-color: #e3e3e3;
  @wrapper-width: 960px;
  @sidebar-width: 220px;

  // Mixins
  .base-styles() {
    line-height: 1.3;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: @text-color;
  }
  .doc-styles() {
    .base-styles();
    line-height: 1.5;   // Override
    word-wrap: break-word;
    font-size: 14px;
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      display: block;
      line-height: 1.3;
      font-weight: bold;
    }
    h1 {
      margin: 60px 0 20px;
      border-bottom: 2px solid @border-color;
      font-size: 36px;
    }
    h2 {
      margin: 30px 0 15px;
      font-size: 28px;
    }
    h3 {
      margin: 20px 0 15px;
      font-size: 20px;
    }
    h4,
    h5,
    h6 {
      margin: 15px 0;
      font-size: 16px;
    }
    p,
    ul,
    ol,
    blockquote,
    pre {
      display: block;
      margin: 15px 0;
    }
    ul {
      list-style-type: square;
      list-style-position: outside;
      padding-left: 25px;
    }
    ol {
      list-style-type: decimal;
      list-style-position: outside;
      padding-left: 25px;
    }
    blockquote {
      margin-left: 2px;
      padding: 0 0 0 16px;
      border-left: 2px solid @border-color;
    }
    pre {
      .pre-styles();
      overflow: auto;
      padding: 8px 12px;
      border: 1px solid @border-color;
    }
    a,
    img,
    strong,
    em,
    code {
      display: inline;
    }
    a {
      color: #08a;
      text-decoration: none;
      &:hover {
        text-decoration: underline;
        color: #068;
      }
    }
    img {
      vertical-align: bottom;
    }
    a img {
      border: none;
    }
    strong {
      font-weight: bold;
      font-style: normal;
    }
    em {
      font-weight: normal;
      font-style: italic;
    }
    code {
      .code-styles();
      padding: 1px 2px;
      border: 1px solid @border-color;
      vertical-align: 1px;
    }
    pre > code {
      padding: 0;
      border: none;
    }
  }
  .pre-styles() {
    white-space: pre;
    word-wrap: normal;
  }
  .code-styles() {
    line-height: 1.5;
    font-size: 13px;
    font-family: Consolas, Menlo,'Liberation Mono', Courier, monospace;
    color: @text-color
  }
  .clearfix() {
    &:before,
    &:after {
      content: " ";
      display: table;
    }
    &:after {
      clear: both;
    }
  }
  .ellipsis() {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  // Layout
  .kss-wrapper {
    .clearfix();
    width: @wrapper-width - 20px;
    margin: 0 auto;
    padding: 0 10px;
  }

  // Sidebar
  // -------

  // Sidebar column
  .kss-sidebar {
    float: left;
    width: @sidebar-width;
    overflow: hidden;
    &.kss-fixed {
      position: fixed;
      top: 0;
      .kss-sidebar-inner {
        padding-top: 40px + 4px;  // Keep border height
      }
    }
  }
  .kss-sidebar-inner {
    padding: 40px 0 10px;
  }
  // Header
  .kss-header {
    background: #fff;
  }
  // Document title
  .kss-doc-title {
    .base-styles();
    margin: 0 0 30px;
    text-align: right;
    font-size: 20px;
    font-weight: normal;
    color: @key-color;
    a {
      text-decoration: none;
      color: inherit;
    }
  }

  // Menu
  .kss-nav {
    margin: 30px 0;
  }

  .kss-menu {
    margin: 0;
    padding: 0;
    list-style-type: none;
    > .kss-menu-item {
      .base-styles();
      font-size: 14px;
      display: block;
      > a {
        .clearfix();
        display: block;
        padding: 7px 0 7px 5px;
        border-bottom: 1px solid @border-color;
        text-decoration: none;
        font-weight: bold;
        color: #888;
        &:hover {
          color: @key-color;
        }
        > .kss-ref {
          float: left;
          margin-right: 10px;
          color: @key-color;
        }
        > .kss-name {
          .ellipsis();
          text-align: right;
        }
      }
      &.kss-active > a {
        border-bottom-color: @key-color;
        color: @text-color;
      }
    }
  }

  .kss-menu-child {
    display: none;
    margin: 0;
    padding: 5px 0;
    list-style-type: none;
    border-bottom: 1px solid @border-color;
    > .kss-menu-item {
      .base-styles();
      font-size: 12px;
      > a {
        display: block;
        padding: 5px 0 6px 5px;
        text-decoration: none;
        color: #888;
        &:hover {
          color: @key-color;
        }
        > .kss-ref {
          float: left;
          margin-right: 10px;
          color: @key-color;
        }
        > .kss-name {
          .ellipsis();
          text-align: right;
        }
      }
      &.kss-active > a {
        color: @text-color;
      }
    }
  }

  // Documentation content
  // ---------------------

  // Content column
  .kss-content {
    overflow: hidden;
    margin-left: @sidebar-width + 30px;
    padding: 40px 0 10px;
  }

  // Section
  .kss-section {
    margin: -40px 0 60px;   // Adjust the target offset.
    padding-top: 40px;
  }

  // Overview content
  .kss-overview {
    .doc-styles();
  }

  // Title
  .kss-title {
    .base-styles();
    margin: 0 0 10px;
    font-weight: bold;
    .kss-ref {
      margin-right: .2em;
      color: @key-color;
    }
  }

  // Description
  .kss-description {
    .doc-styles();
    margin: 10px 0 20px;
  }

  // Modifier box
  .kss-modifier-block {
    margin: 20px 0;
  }

  // Modifiers
  .kss-modifier {
    border-top: 1px solid @border-color;
  }

  .kss-modifier-head {
    .doc-styles();
    padding: 8px 0 0;
    font-size: 12px;
    p,
    ul,
    ol,
    blockquote,
    pre {
      margin: 0;
    }
    code {
      font-size: 11px;
      color: inherit;
    }
    .kss-modifier-name {
      float: left;
      margin-right: 15px;
      font-weight: bold;
    }
    .kss-modifier-description {
      overflow: hidden;
      color: #888;
    }
  }

  .kss-modifier-example {
    .clearfix();
    padding: 25px 20px 35px;
  }
  .kss-modifier-original {
    .kss-modifier-example {
      padding-top: 35px;
    }
  }

  // Markup
  .kss-markup {
    pre {
      .pre-styles();
      overflow: auto;
      margin: 0;
      padding: 12px 15px;
      border-top: 1px solid @border-color;
      border-left: 2px solid @key-color;
      border-right: 1px solid @border-color;
      border-bottom: 1px solid @border-color;
    }
    code {
      .code-styles();
    }
  }

  // Top level section
  .kss-depth-1 .kss-title,
  .kss-overview > h1:first-child {
    margin: -0.15em 0 20px;
    border-bottom: 2px solid @key-color;
    font-size: 42px;
  }

  // Other sections
  .kss-depth-2,
  .kss-depth-3,
  .kss-depth-4,
  .kss-depth-5,
  .kss-depth-6 {
    .kss-title {
      font-size: 28px;
    }
  }

  // Copyright
  .kss-footer {
    .doc-styles();
    margin: 80px 0 20px;
    padding: 8px 0 0;
    border-top: 2px solid @border-color;
    font-size: 12px;
  }

}

// Responsive styles
// -----------------

// Large desctop
@media (min-width: 1260px) {
  #kss-node {
    .kss-wrapper {
      width: 1260px - 20px;
    }
  }
}
