@import (less) "COLOURSCHEME.css";

@borders: mix(@fg, @bg, 15%);


body {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
  font-size: 15px;
  line-height: 22px;
  margin: 0;
  padding: 0;
  background: mix(@fg, @bg, -10%);
  color: mix(@bg, @fg, 5%);
}

p, h1, h2, h3, h4, h5, h6 {
  margin: 0 0 15px 0;
}

h1 {
  margin-top: 40px;
}

a {
  color: @link;

  &:visited {
    color: @link;
  }
}

#tree, #headings {
  position: absolute;
  top: 30px;
  left: 0;
  bottom: 0;
  width: 290px;
  padding: 10px 0;
  overflow: auto;
}

#sidebar_wrapper {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  overflow: hidden;
  background: mix(@fg, @bg, 5%);
}

#sidebar_switch {
  position: absolute;
  top: 0;
  left: 0;
  width: 290px;
  height: 29px;
  border-bottom: 1px solid;
  background: mix(@fg, @bg, 8%);
  border-bottom-color: @borders;

  span {
    display: block;
    float: left;
    width: 50%;
    text-align: center;
    line-height: 29px;
    cursor: pointer;
    color: mix(@bg, @fg, 4%);

    &:hover {
      background: mix(@fg, @bg, 5%);
    }
  }

  .selected {
    font-weight: bold;
    background: mix(@fg, @bg, 2%);
    color: @fg;
  }
}

.slidey #sidebar_wrapper {
  -webkit-transition: width 250ms linear;
  -moz-transition: width 250ms linear;
  -ms-transition: width 250ms linear;
  -o-transition: width 250ms linear;
  transition: width 250ms linear;
}

.sidebar #sidebar_wrapper {
  width: 290px;
}

#tree {
  .nodename {
    text-indent: 12px;
    background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAg0lEQVQYlWNIS0tbAcSK////Z8CHGTIzM7+mp6d/ASouwqswKyvrO1DRfyg+CcRaxCgE4Z9A3AjEbIQUgjHQOQvwKgS6+ffChQt3AiUDcCqsra29d/v27R6ghCVWN2ZnZ/9YuXLlRqBAPBALYvVMR0fHmQcPHrQBOUZ4gwfqFj5CAQ4Al6wLIYDwo9QAAAAASUVORK5CYII=");
    background-repeat: no-repeat;
    background-position: left center;
    cursor: pointer;
  }
  .open > .nodename {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAlElEQVQYlWNIS0tbCsT/8eCN////Z2B49OhRfHZ29jdsioDiP27evJkNVggkONeuXbscm8Jly5atA8rzwRSCsG5DQ8MtZEU1NTUPgOLGUHm4QgaQFVlZWT9BijIzM39fuHChDCaHohBkBdCq9SCF8+bN2wHkC+FSCMLGkyZNOvb9+3dbNHEMhSDsDsRMxCjEiolWCADeUBHgU/IGQQAAAABJRU5ErkJggg==");
    background-position: left 7px;
  }
  .dir, .file {
    position: relative;
    min-height: 20px;
    line-height: 20px;
    padding-left: 12px;

    &>.children {
      display: none;
    }
    &.open>.children {
      display: block;
    }
  }
  .file {
    padding-left: 24px;
    display: block;
    text-decoration: none;
    color: @fg;
  }
  &>.dir {
    padding-left: 0;
  }
}

#headings {
  .heading a {
    text-decoration: none;
    padding-left: 10px;
    display: block;
    color: @fg;
  }
  .h1 {
    padding-left: 0;
    margin-top: 10px;
    font-size: 1.3em;
  }
  .h2 {
    padding-left: 10px;
    margin-top: 8px;
    font-size: 1.1em;
  }
  .h3 {
    padding-left: 20px;
    margin-top: 5px;
    font-size: 1em;
  }
  .h4 {
    padding-left: 30px;
    margin-top: 3px;
    font-size: 0.9em;
  }
  .h5 {
    padding-left: 40px;
    margin-top: 1px;
    font-size: 0.8em;
  }
  .h6 {
    padding-left: 50px;
    font-size: 0.75em;
  }
}

#sidebar-toggle {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  bottom: 0;
  z-index: 2;
  cursor: pointer;
  background: mix(@fg, @bg, 10%);

  &:hover {
    width: 10px;
    background: mix(@fg, @bg, 15%);
  }
}

.slidey {
  #sidebar-toggle, #container {
    -webkit-transition: all 250ms linear;
    -moz-transition: all 250ms linear;
    -ms-transition: all 250ms linear;
    -o-transition: all 250ms linear;
    transition: all 250ms linear;
  }
}

.sidebar #sidebar-toggle {
  left: 290px;
}

#container {
  position: fixed;
  left: 5px;
  right: 0;
  top: 0;
  bottom: 0;
  overflow: auto;
}

.sidebar #container {
  left: 295px;
}


.no-sidebar {
  #sidebar_wrapper, #sidebar-toggle {
    display: none;
  }
  #container {
    left: 0;
  }
}

#page {
  padding-top: 40px;
}

table td {
  border: 0;
  outline: 0;
}

.docs.markdown {
  padding: 10px 50px;
}

td.docs {
  max-width: 450px;
  min-width: 450px;
  min-height: 5px;
  padding: 10px 25px 1px 50px;
  overflow-x: hidden;
  vertical-align: top;
  text-align: left;
}

.docs {
  pre {
    margin: 15px 0 15px;
    padding: 5px;
    padding-left: 10px;
    border: 1px solid @borders;
    background: @bg;
    font-size: 12px;
    overflow: auto;
    &.code_stats {
      font-size: 60%;
    }
  }
  p, li {
    tt, code {
      border: 1px solid @borders;
      font-size: 12px;
      padding: 0 0.2em;
      background: mix(@fg, @bg, 5%);
    }
  }
}

.dox {
  border-top: 1px solid mix(@bg, @borders, 25%);
  padding-top: 10px;
  padding-bottom: 10px;

  .details {
    padding: 10px;
    background: @bg;
    border: 1px solid @borders;
    margin-bottom: 10px;
  }
  .dox_tag_title {
    font-weight: bold;
  }
  .dox_tag_detail {
    margin-left: 10px;

    span {
      margin-right: 5px;
    }
  }
  .dox_type {
    font-style: italic;
  }
  .dox_tag_name {
    font-weight: bold;
  }
}

.pilwrap {
  position: relative;
  padding-top: 1px;

  .pilcrow {
    font: 12px Arial;
    text-decoration: none;
    color: #454545;
    position: absolute;
    left: -20px;
    padding: 1px 2px;
    opacity: 0;
    -webkit-transition: opacity 0.2s linear;
    -moz-transition: opacity 0.2s linear;
    -ms-transition: opacity 0.2s linear;
    -o-transition: opacity 0.2s linear;
    transition: opacity 0.2s linear;
    color: mix(@bg, @fg, 10%);

    &:before {
      content: '\b6';
    }
  }

  &:hover .pilcrow {
    opacity: 1;
  }
}

td.code {
  padding: 8px 15px 8px 25px;
  width: 100%;
  vertical-align: top;
  border-left: 1px solid @borders;
  background: @bg;
}

.background {
  border-left: 1px solid @borders;
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 525px;
  background: @bg;
}

pre, tt, code {
  font-size: 12px;
  line-height: 18px;
  font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  background: @bg;
}

.line-num {
  display: inline-block;
  width: 50px;
  text-align: right;
  opacity: 0.3;
  margin-left: -20px;
  text-decoration: none;
  color: @comment;

  &:before {
    content: attr(data-line);
  }
}
