// docs-next

$verticalMargin: 1em;
$argumentPadding: 15px;
$subtleGreen: lighten($greenLight, 15);

@mixin code-font {
  font-family: $codeFont;
  font-size: 14px;
}

.api-search-result {
  width: 780px;

  .highlights {
    //background-color:

    em {
      font-style: normal;
      font-weight: bold;
    }

    .highlight-separator {
      margin-left: 8px;
      margin-right: 8px;
    }
  }
}

.documents {
  line-height: 1.6;

  a:focus {
    outline: 0;
  }

  code {
    @include code-font;
    padding: 0.3em 0;
    border-radius: 3px;
    border: none;
    color: $codeTextColor;
    background: $codeBgColor;
  }

  .extended-methods-container {
    .extended-methods {
      display: none;
    }

    &.show .extended-methods {
      display: block;
    }

    &.show .extended-toggle .octicon:before {
      content: '\f0a3'; // chevron down
    }
  }

  .extended-toggle {
    display: block;
    margin: 20px 0;
    font-weight: normal;

    .octicon {
      color: $subtleGreen;
      width: 12px;
    }
  }

  .no-methods-message {
    opacity: .5;
    font-style: italic;
  }

  .markdown-body {
    font-size: 16px;

    // .anchor {
    //   .octicon {
    //     color: $lightText;
    //   }
    // }

    pre {
      margin: 0;
      font-family: $codeFont;
      font-size: 14px;
    }

    .reference-link {
      @include code-font;
    }
  }

  .column {
    &.sidebar {
      width: 30%;
    }
    &.main-column {
      width: 70%;
    }
  }

  .section {
    border-bottom: solid 1px $beigeMedium;
  }

  .detail-section {
    margin: 30px 0 20px 0;
  }

  .document-section-nav {
    h3 {
      margin-bottom: 4px;
      font-size: 18px;
    }

    h3 a {
      // Color the section links the same as the text.
      // TODO: When we move to revealing method bodies, we can remove this.
      color: $brownDark;
    }
  }

  .label {
    display: inline-block;
    border-radius: 2px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;

    &.label-extended {
      background: $warningColor;
    }

    &.label-essential {
      background: $subtleGreen;
    }
  }

  .page-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;

    .label {
      vertical-align: middle;
      margin-top: -2px;
      padding: 6px;
      font-size: 12px;
    }
  }

  .method-signature {
    .argument {
      color: #666;
    }
  }

  a:hover .octicon-file-code {
    color: darken($greenDark, 10);
  }

  .document-source {
    display: inline-block;
    vertical-align: middle;
    margin-top: -1px;
    margin-left: 4px;
    font-size: 14px;
    color: $subtleGreen;
  }

  .example {
    margin: $verticalMargin 0;

    .description {
      margin-bottom: $verticalMargin;
    }
  }

  .operator {
    color: $subtleGreen;
  }

  .api-entry {
    h1, h2, h3, h4, h5, h6 {
      margin: $verticalMargin 0 !important;
    }

    h3 {
      font-size: 16px;
    }

    h4, h5, h6 {
      font-size: 14px;
    }

    .method-summary-wrapper {
      display: none;
    }

    &.expanded {
      padding-bottom: 10px;
      .method-summary-wrapper {
        display: block;
        padding-bottom: 20px;
      }
    }

    > .name {
      @include code-font;
      margin-bottom: $verticalMargin / 2;
      margin-top: 0;
      font-weight: normal;
    }

    .source-link {
      display: inline;
      color: $greenLight;
    }
    .source-link .octicon {
      position: relative;
      top: -2px;
    }

    .summary p {
      margin-top: 0;

      &:last-child {
        margin-bottom: $verticalMargin;
      }
    }

    .return-values,
    .arguments {
      margin: $verticalMargin 0;
      width: 100%;
      border-spacing: 0;
      border-collapse: collapse;
      border: solid 1px $beigeMedium;

      .optional {
        float: right;
        background: lighten($beigeMedium, 5);
        margin-top: -8px;
        margin-right: -10px;
        display: block;
        padding: 0px 6px;
        line-height: 20px;
        height: 20px;
        font-size: 12px;
        color: rgba(0,0,0,0.5);
      }

      th {
        padding: 8px 10px;
        font-size: 14px;
        color: $brownMedium;
        text-align: left;
        background-color: lighten($beigeMedium, 6);
      }

      td {
        padding: 8px 10px;
        vertical-align: top;
        border-top: solid 1px $beigeMedium;
      }

      p {
        margin: 0;
      }

      .argument-depth-1 > td,
      .argument-depth-2 > td,
      .argument-depth-3 > td,
      .argument-depth-4 > td,
      .argument-depth-5 > td {
        border-top: none;

        > code {
          background-color: transparent;
          padding: 0;
          color: darken($brownDark, 15);

          &:before,
          &:after {
            content: none;
          }
        }
      }

      .argument-depth-1 > td:first-child {
        padding-left: 12px + $argumentPadding;
      }
      .argument-depth-2 > td:first-child {
        padding-left: 12px + $argumentPadding * 2;
      }
      .argument-depth-3 > td:first-child {
        padding-left: 12px + $argumentPadding * 3;
      }
      .argument-depth-4 > td:first-child {
        padding-left: 12px + $argumentPadding * 4;
      }
      .argument-depth-5 > td:first-child {
        padding-left: 12px + $argumentPadding * 5;
      }

      code .argument-list {
        opacity: .6;
      }
    }
  } // End .api-entry
}

// docs

.documents .navigation {
  text-align: right;
  padding: 0;
  font-weight: bold;

  a {
    color: $beigeDark;

    &:hover {
      color: $brownDark;
    }

    &.is-selected, &:active { color: $brownDark; }
  }
}

.atom-doc-index {
  h2 {
    margin: 0;
    padding: 0;
  }
  h3.subheader {
    font-weight: lighter;
    margin: 0;
    margin-bottom: 20px;
    padding: 0px;
  }
  .doc-section {
    .octicon {
      margin-right: 3px;
    }
    p {
      font-size: 0.9em;
      color: rgba(101, 90, 94, 0.85);
      padding-right: 25px;
    }
    h3 {
      border-bottom: 1px solid #eee;
    }
    ul {
      list-style-type: none;
      padding: 0;
      li {
        margin: 5px 0;
      }
    }
  }
  .documents-search {
    margin-bottom: 10px;
  }
}

.documents-search {
  line-height: 1.4;
  margin-bottom: 40px;
  display: table;
  width: 100%;

  .select-menu {
    display: table-cell;
    width: 1%;
    padding-right: 20px;
  }
}

input.documents-search-input {
  font-size: 16px;
  width: 100%;
  margin: 0;
  display: table-cell;
}

.documents-toc {

  .anchor { display: none; }

  h2, h3 {
    margin: 20px 0 10px;
    font-size: 22px;
  }

  ul {
    padding-left: 0;
    list-style-type: none;
    margin: 0;
  }

}

.inspectocat {
  display: block;
  width: 470px;
  height: 448px;
  @include background-image-retina('inspectocat', 'png', 470px, 448px);
}

.doc-version-warning {
  position: relative;
  display: block;
  font-weight: bold;
  vertical-align: middle;
  margin-bottom: 20px;
  padding: 10px;
  text-align: center;
  border-radius: 5px;
  border: 1px solid darken($beigeMedium, 20%);
  @include gradient($beigeMedium, darken($beigeMedium, 10%));
}

.breadcrumbs {
  padding-left: 0;
  margin: 0 0 20px;
  font-size: 15px;

  li {
    display: inline-block;
    list-style-type: none;


    &:after {
      content: '>';
    }

    &:last-child:after {
      content: '';
    }
  }
}

.toc {
  float: left;
  display: block;
  width: 260px;
  max-width: 260px;
  margin-right:15px;
  overflow: hidden;
  border-right: 1px solid #eee;
  h3 {
    padding:0;
    margin: 0;
    margin-bottom: 10px;
  }
  h4 {
    margin: 0;
    padding: 0;
    a {
      color: inherit;
    }
  }
  ul {
    list-style-type: none;
    margin: 0;
    margin-bottom: 1em;
    padding: 0;
    font-size: 0.95em;
    li {
      padding: 1px;
      padding-left: 30px;
      text-indent: -15px;

      &.selected {
        background: #eee;
      }
    }
  }
}

.content-column {
  float: left;
  width: 670px;
}

// Adjustments for page-specific links to improve the docs

.improve-link {
  margin-left: 2em;
}

h1.document-title {
  font-size: 1.0em;
  border-bottom: 0;
  text-align:right;
  font-weight: 200;
}


/* syntax highlighting and coloring text in general */
.document-content {
  padding-left:24px;

  h1, h2, h3, h4, h5, h6 {
    &:hover {
      .anchor {
        display: inline;
        margin-left: 5px;
      }
    }
  }

  pre.highlight {
    color: $codeTextColor;
    background: $codeBgColor;
  }
  /* Pygments with manni theme */
  pre code.hll { background-color: #ffffcc }
  pre code.c { color: #0099FF; font-style: italic } /* Comment */
  pre code.err { color: #AA0000 } /* Error */
  pre code.k { color: #006699; font-weight: bold } /* Keyword */
  pre code.o { color: #555555 } /* Operator */
  pre code.cm { color: #35586C; font-style: italic } /* Comment.Multiline */
  pre code.cp { color: #009999 } /* Comment.Preproc */
  pre code.c1 { color: #35586C; font-style: italic } /* Comment.Single */
  pre code.cs { color: #35586C; font-weight: bold; font-style: italic } /* Comment.Special */
  pre code.gd { background-color: #FFCCCC } /* Generic.Deleted */
  pre code.ge { font-style: italic } /* Generic.Emph */
  pre code.gr { color: #FF0000 } /* Generic.Error */
  pre code.gh { color: #003300; font-weight: bold } /* Generic.Heading */
  pre code.gi { background-color: #CCFFCC } /* Generic.Inserted */

  /* Overriding default manni style of #AAAAAA gray for Generic Output with #000000 black, which is better suited to ORM terminal output */
  pre code.go { color: #000000 } /* Generic.Output  */

  pre code.gp { color: #000099; font-weight: bold } /* Generic.Prompt */
  pre code.gs { font-weight: bold } /* Generic.Strong */
  pre code.gu { color: #003300; font-weight: bold } /* Generic.Subheading */
  pre code.gt { color: #99CC66 } /* Generic.Traceback */
  pre code.kc { color: #006699; font-weight: bold } /* Keyword.Constant */
  pre code.kd { color: #006699; font-weight: bold } /* Keyword.Declaration */
  pre code.kn { color: #006699; font-weight: bold } /* Keyword.Namespace */
  pre code.kp { color: #006699 } /* Keyword.Pseudo */
  pre code.kr { color: #006699; font-weight: bold } /* Keyword.Reserved */
  pre code.kt { color: #007788; font-weight: bold } /* Keyword.Type */
  pre code.m { color: #FF6600 } /* Literal.Number */
  pre code.s { color: #CC3300 } /* Literal.String */
  pre code.na { color: #330099 } /* Name.Attribute */
  pre code.nb { color: #336666 } /* Name.Builtin */
  pre code.nc { color: #00AA88; font-weight: bold } /* Name.Class */
  pre code.no { color: #336600 } /* Name.Constant */
  pre code.nd { color: #9999FF } /* Name.Decorator */
  pre code.ni { color: #999999; font-weight: bold } /* Name.Entity */
  pre code.ne { color: #CC0000; font-weight: bold } /* Name.Exception */
  pre code.nf { color: #CC00FF } /* Name.Function */
  pre code.nl { color: #9999FF } /* Name.Label */
  pre code.nn { color: #00CCFF; font-weight: bold } /* Name.Namespace */
  pre code.nt { color: #330099; font-weight: bold } /* Name.Tag */
  pre code.nv { color: #003333 } /* Name.Variable */
  pre code.ow { color: #000000; font-weight: bold } /* Operator.Word */
  pre code.w { color: #bbbbbb } /* Text.Whitespace */
  pre code.mf { color: #FF6600 } /* Literal.Number.Float */
  pre code.mh { color: #FF6600 } /* Literal.Number.Hex */
  pre code.mi { color: #FF6600 } /* Literal.Number.Integer */
  pre code.mo { color: #FF6600 } /* Literal.Number.Oct */
  pre code.sb { color: #CC3300 } /* Literal.String.Backtick */
  pre code.sc { color: #CC3300 } /* Literal.String.Char */
  pre code.sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */
  pre code.s2 { color: #CC3300 } /* Literal.String.Double */
  pre code.se { color: #CC3300; font-weight: bold } /* Literal.String.Escape */
  pre code.sh { color: #CC3300 } /* Literal.String.Heredoc */
  pre code.si { color: #AA0000 } /* Literal.String.Interpol */
  pre code.sx { color: #CC3300 } /* Literal.String.Other */
  pre code.sr { color: #33AAAA } /* Literal.String.Regex */
  pre code.s1 { color: #CC3300 } /* Literal.String.Single */

  /* Overriding manni default yellow #FFCC33 with brown #AA6600, which is easier to read */
  pre code.ss { color: #AA6600 } /* Literal.String.Symbol */

  pre code.bp { color: #336666 } /* Name.Builtin.Pseudo */
  pre code.vc { color: #003333 } /* Name.Variable.Class */
  pre code.vg { color: #003333 } /* Name.Variable.Global */
  pre code.vi { color: #003333 } /* Name.Variable.Instance */
  pre code.il { color: #FF6600 } /* Literal.Number.Integer.Long */

  /* Sanders's additions to manni */
  pre code.g { color: #005500 } /* Generic */
  pre code.l { color: #CC6600 } /* Literal */
  pre code.l { color: #FF9900 } /* Literal.Date */
  pre code.n { color: #000088 } /* Name */
  pre code.nx { color: #000088 } /* Name.Other */
  pre code.py { color: #9966FF } /* Name.Property */
  pre code.p { color: #000000 } /* Punctuation */
  pre code.x { color: #FF0066 } /* Other */

  /* Chacon's additions to make command line look more like a command line */
  pre[data-code-language="console"] {
    background: #ddd;
    padding: 10px;
  }
  pre[data-code-language="console"] code.go {
    color: #555;
    font-size: 1.0em;
  }
  pre[data-code-language="console"] code.gp {
    color: #009900;
    font-weight: bold;
  }
}

.training-video-cta {
  padding: 20px 0 50px 0;
  text-align: center;
}

.training-video-link {
  margin-left: 10px;
  padding: 7px 12px 7px 0;
  font-size: 0.9em;
  color: hsl(151, 45%, 45%);
  border-radius: 2px;
  border: 1px solid hsl(151, 45%, 45%);
}

.training-video-link a, .training-video-link a:hover {
  text-decoration: none;
  color: inherit;
}

.training-video-play {
  padding: 7px 9px;
  margin-right: 7px;
  margin-left: -4px;
  color: #fff;
  background: hsl(151, 45%, 45%);
  border-radius: 2px 0 0 2px;
  border: 1px solid hsl(151, 45%, 45%);
}

.training-video-link:hover {
  color: #fff;
  background: hsl(151, 45%, 60%);
  border-color: hsl(151, 45%, 60%);
}
