/** CSS reset **/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
font,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
  margin        : 0;
  padding       : 0;
  border        : 0;
  outline       : 0;
  font-weight   : inherit;
  font-style    : inherit;
  font-family   : inherit;
  font-size     : 100%;
  vertical-align: baseline;
}

body {
  line-height: 1;
  color      : black;
  background : white;
}

ol,
ul {
  list-style: none;
}

a img {
  border: none;
}
/** Basics **/
body {
  font-family: 'Helvetica Neue', Helvetica, Arial;
}

pre {
  font-family: monospace;
}

code {
  font-family: monospace;
  white-space: pre;
  font-size  : 1.1em;

  &.hljs {
    padding: 1.2em 1em;
    margin : 0 auto;
    width  : 90%;
  }
}

pre code {
  font-size: 1.1em;
}

ul {
  list-style-type: disc;
  margin-top     : 1em;
  margin-bottom  : 1em;
  padding-left   : 40px;
}

dl {
  margin-top   : 1em;
  margin-bottom: 1em;
}

dd {
  margin-left: 40px;
}

h1,
h2,
h3,
h4 {
  color      : black;
  font-weight: bold;
}

h1 {
  font-size: 2em;
}

h1 {
  margin: 1.5em 0 0.67em;
}

h2 {
  font-size: 1.5em;
  margin   : 1.25em 0 0.5em;
}

h3 {
  font-size: 1.17em;
  margin   : 1em 0;
}

h4 {

}

p {
  margin-bottom: 1em;
}

em {
  font-style: italic;
}

a:hover {
  background-color: yellow;
}
/** Main pane **/
#main {
  margin     : 10px;
  line-height: 1.3;
  color      : #333;
}

#main strong {
  font-weight: bold;
}

#main h1 {
  border-style: solid none none none;
  border-color: #999;
  border-width: 2px;
}

#main h2 span {
  background-color: yellow;
  margin          : 0 -5px;
  padding         : 2px 5px;
}

#main a:link,
#main a:visited {
  text-decoration: none;
  border-bottom  : 1px dashed #000;
  color          : inherit;
}

#main code a:link,
#main code a:visited {
  border: none;
}

dl.involved {
  padding-left: 10px;
}

dl.involved dt {
  text-transform: uppercase;
  font-weight   : bold;
}

dl.involved dt span {
  background-color: yellow;
}

dl.involved dd {
  margin-left  : 20px;
  margin-bottom: 1em;
}

dl.involved a {
  font-weight: bold;
}

dl.involved code {
  font-weight: bold;
}

dl.example dt {
  font-weight: bold;
  margin-left: 10px;
}

dl.example dd {
  margin-bottom: 10px;
}

dl.objdesc dt {
  margin-top : 1em;
  margin-left: 1.5em;
}

dl.objdesc dt .name {
  font-weight: bold;
}

dl.objdesc dt .type {
  margin-left: 15px;
  font-size  : 0.9em;
  font-weight: 200;
  color      : black;
}

dl.objdesc dd {
  margin-bottom: 1em;
  margin-left  : 1.5em;
}

dl.callbacks dt .name,
dl.methods dt .name {
  /* like code tag */
  font-family: monospace;
  font-size  : 1.1em;
}

dl.callbacks {
  margin-left: 1.5em;
}

#main dd p {
  margin-top: 0.5em;
}
/** API **/
.warning {
  border-width: 0 0 0 3px;
  border-style: solid;
  border-color: red;
  margin      : 21px 0 21px 10px;
  padding-left: 15px;
  font-weight : bold;
  color       : red;
}

.note {
  border-width: 0 0 0 2px;
  border-style: solid;
  border-color: black;
  margin      : 21px 0 21px 10px;
  padding-left: 15px;
  font-style  : italic;
  color       : black;
}

.api {
  border       : 1px solid #ddd;
  margin-bottom: 1em;
  margin-top   : 2em;
}

.bareapi {
  border-width: 0;
}

.api h3,
h3.api-title {
  background: #eee;
  padding   : 5px 10px;
}

h3.api-title {
  margin-top: 2em;
}

.api h3.api-title {
  margin  : 0;
  overflow: auto;
}

.api h4 {
  font-weight    : normal;
  font-style     : italic;
  margin-bottom  : 0.25em;
  text-decoration: underline;
  margin-left    : 20px;
}

.api dl {
  margin-top: 0.25em;
}

.api dl.args {
  margin-left: 40px;
}

.api dl.constants {
  margin-left: 20px;
}

.api dt {
  margin-top: 1em;
}

.api dt .name {
  font-weight: bold;
}

.api dt .type {
  margin-left: 15px;
  font-size  : 0.9em;
  font-weight: 200;
  color      : black;
}

.api dd {
  margin-bottom: 1em;
  margin-left  : 0;
}

.api .desc {
  margin: 1em;
}

.api pre {
  margin-right: 10px;
}

ol {
  list-style   : decimal;
  padding-left : 30px;
  margin-bottom: 1em;
}

.api-title .locus {
  float        : right;
  font-weight  : normal;
  padding-right: 5px;
  font-style   : italic;
}

.api-title .src-code {
  font-size    : 11px;
  color        : #20338A !important;
  text-align   : left;
  clear        : both;
  border-bottom: none !important;
  display      : block;
  font-weight  : normal;
}

.or {
  font-size      : 0.9em;
  text-decoration: underline;
  font-style     : italic;
}

#main pre {
  margin: 1em 0;
}

#main a.selflink:link,
#main a.selflink:visited,
#main a.selflink:hover {
  text-decoration: none;
  border         : none;
  color          : inherit;
  background     : none;
}
/** layout control **/
#menu-ico {
  font-size: 30px;
  float    : right;
  position : fixed;
  top      : 3px;
  left     : 6px;
}

#menu-ico.hidden {
  display: none;
}
/** layout control **/
#menu-ico {
  font-size: 30px;
  float    : right;
  position : fixed;
  top      : 3px;
  left     : 6px;
}

#menu-ico.hidden {
  display: none;
}

@nav-width: 270px;
@top-bar-height: 50px;

/* default to no sidebar */
.hidden {
  display: none;
}

#nav {
  display                   : block;
  position                  : fixed;
  width                     : @nav-width;
  height                    : 100%;
  top                       : 0;
  overflow-y                : scroll;
}

.main-content {
  position                  : absolute;
  width                     : 100%;
  top                       : @top-bar-height;
  bottom                    : 0;
  z-index                   : 1;
  background                : white;
  overflow-y                : scroll;
  overflow-x                : hidden;
  margin-left               : 0;
  transition                : margin-left 300ms ease-out;
}

.overlay {
  margin-left     : 0;
  transition      : margin-left 300ms ease-out, opacity 300ms ease-out;
  opacity         : 0;
  background-color: rgba(0, 0, 0, 0.3);
}

#nav.show {
  left    : 0;
  overflow: auto;
}

.github-ribbon {
  display: none;
}

pre {
  white-space: pre-wrap;
}

#main {
  padding  : 10px;
  max-width: 700px;
}

.basic-or-full {
  font-size: 1em;
  margin   : 10px 0;
}

#nav {
  h1 {
    margin-top: 1em;
    font-size : 1.3em;

    a {
      text-decoration: none;
      color          : black;

      &:hover {
        background     : none;
        text-decoration: underline;
      }
    }
  }

  .logo {
    width        : 180px;
    margin-bottom: 10px;
  }
}

.top-bar {
  position     : absolute;
  background   : white;
  width        : 100%;
  top          : 0;
  left         : 0;
  height       : @top-bar-height;
  box-shadow   : 0 0 10px rgba(0, 0, 0, 0.3);
  z-index      : 2;
  margin-left  : 0;
  transition   : margin-left 300ms ease-out, opacity 300ms ease-out;
  border-bottom: 1px solid #aaa;

  .fa-bars {
    font-size: 25px;
    margin   : 13px 10px 13px 20px;
  }

  h1 {
    margin    : 13px auto;
    text-align: center;
    font-size : 25px;
    padding   : 0;
    margin-top: 8px;

    .logo {
      display       : inline;
      height        : 1.1em;
      vertical-align: baseline;
      margin-bottom : 1px;
      margin-right  : 3px;
    }
  }
}

.sidebar-open {
  overflow: hidden;
  width   : 100%;
  position: absolute;
  height  : 100%;

  .main-content {
    margin-left: @nav-width;
  }

  .top-bar {
    margin-left: @nav-width;
  }

  .overlay {
    position   : absolute;
    margin-left: @nav-width;
    width      : 100%;
    height     : 100%;
    z-index    : 3;
    opacity    : 1;
  }
}

@media (min-width: 768px) {
  /* ipad portrait or better */
  .main-content {
    height     : 100%;
    margin-left: 0;
    /* nav width + padding */
    padding-top: 0;
    left       : @nav-width;
    right      : 0;
    width      : auto;
    border-left: 1px solid #ccc;
    top        : 0;
  }

  #nav {
    display : block;
    width   : @nav-width;
    position: fixed;
    overflow: auto;
    height  : 100%;
    top     : 0;
    left    : 0;
  }

  .main-headline {
    display: none;
  }

  #menu-ico {
    display: none;
  }

  .overlay {
    display: none;
  }

  .top-bar {
    display: none;
  }

  #main {
    padding: 0 30px;
  }

  .sidebar-open {
    overflow: hidden;
    width   : 100%;
    position: absolute;
    height  : 100%;

    .main-content {
      margin-left: 0;
    }

    .top-bar {
      margin-left: 0;
    }

    .overlay {
      display: none;
    }
  }
}

.complete-link {
  font-size      : 0.9em;
  text-decoration: underline !important;
}

@media print {
  body {
    font-size: 10pt;
  }

  code,
  pre {
    font-size: 8pt;
  }

  #nav {
    display: none;
  }

  .main-content {
    position: relative;
    height  : auto;
    margin  : 0;
    left    : 0;
    top     : 0;
  }

  .top-bar {
    display: none;
  }
}

.search-overlay {
  position  : absolute;
  top       : 0;
  right     : 0;
  bottom    : 0;
  left      : 0;
  z-index   : 3;
  background: white;
  overflow  : hidden;

  .close-search {
    float          : right;
    font-size      : 2em;

    .hotkey {
      font-size     : 0.6em;
      color         : #777;
      vertical-align: middle;
    }
    text-decoration: none;

    &:hover {
      text-decoration: none;
      background     : none;
    }
  }

  .search-box {
    margin: 40px;

    h3 {
      font-size: 2em;
    }

    input {
      font-size    : 2em;
      padding      : 0.5em 0;
      background   : transparent;
      border       : none;
      border-bottom: 2px solid #777;
      width        : 80%;

      &:focus {
        outline: 0;
      }
    }
  }

  .search-results {
    margin    : 40px;
    position  : absolute;
    bottom    : 0;
    left      : 0;
    right     : 0;
    top       : 170px;
    overflow-y: scroll;
    list-style: none;
    padding   : 0;

    li {
      font-size    : 1em;
      margin-bottom: 0.5em;
      padding      : 10px;
      white-space  : nowrap;

      p {
        margin : 0;
        display: inline;
      }

      strong {
        font-weight: bold;
      }

      &.selected {
        background: yellow;
      }
    }
  }
}

// This menu icon is inspired by
// http://www.codesynthesis.co.uk/code-snippets/create-a-hamburger-icon-with-css
@hamburger-icon-size: 18px;

// Make the target larger than the icon
.hamburger-menu-target {
  height  : @hamburger-icon-size;
  width   : @hamburger-icon-size;
  padding : 19px 10px;
  display : inline-block;
  position: absolute;
  top     : 0;
  left    : 0;
}

.hamburger-menu,
.hamburger-menu:after,
.hamburger-menu:before {
  height          : @hamburger-icon-size / 6;
  width           : @hamburger-icon-size;
  background-color: #111;
  border-radius   : 10px;
  position        : relative;
}

.hamburger-menu:after,
.hamburger-menu:before {
  content : "";
  position: absolute;
}

.hamburger-menu:after {
  top: @hamburger-icon-size / 3;
}

.hamburger-menu:before {
  top: @hamburger-icon-size / 1.5;
}
/** Section nav **/
#nav-inner {
  padding: 10px;
}

#nav {
  line-height: 1.2;

  a {
    text-decoration: none;
    color          : black;
  }

  a:hover {
    margin : 0 -5px;
    padding: 2px 5px;
  }

  h1 {
    font-size: 1.3em;
    margin   : 0 0 0.6em;
  }

  h2 {
    font-size  : 1.2em;
    font-weight: normal;
    margin     : 0.3em 0 0;
  }

  h3 {
    font-size   : 0.8em;
    font-weight : normal;
    margin      : 4px 0 2px;
    padding-left: 10px;
    color       : #333;
  }

  h4 {
    font-size   : 0.8em;
    font-weight : normal;
    margin      : 4px 0;
    padding-left: 20px;
    color       : #333;
  }

  .spacer {
    height: 0.33em;
  }

  .noncode {
    font-style: italic;
  }

  .current {
    color: red;
  }
}

.desc p span.type {
  margin-right: 15px;
  font-size   : 0.9em;
  font-weight : 200;
  color       : black;
}

#nav .options {
  margin-top   : 15px;
  margin-bottom: 10px;
}

#nav .table-of-contents {
  margin-top: 1em;
}

#preamble > h1:first-child {
  margin: 0;
}
