/*
-----------------------------------
AUTODOC STYLES
Sphinx autodoc API documentation
-----------------------------------
*/

// auto-doc, see: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoattribute
// adapted from https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/core/static/core/css/theme.css
dl.module,
dl.class,
dl.exception,
dl.function,
dl.decorator,
dl.data,
dl.method,
dl.attribute {
  dt {
    .headerlink {
      &:before {
        -webkit-font-smoothing: antialiased;
        font-family: "FontAwesome";
        display: inline-block;
        font-style: normal;
        font-weight: normal;
        line-height: 1;
        text-decoration: inherit;
      }

      display: inline-block;
      font: normal normal normal 14px/1 FontAwesome;
      font-size: inherit;
      text-rendering: auto;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      font-family: inherit;
      visibility: hidden;
      font-size: 14px;

      &:after {
        content: "";
        font-family: FontAwesome;
      }
    }

    .fa-pull-left.headerlink {
      margin-right: 0.3em;
    }

    .fa-pull-right.headerlink {
      margin-left: 0.3em;
    }

    .pull-left.headerlink {
      margin-right: 0.3em;
    }

    .pull-right.headerlink {
      margin-left: 0.3em;
    }

    a {
      .headerlink {
        display: inline-block;
        text-decoration: inherit;
      }
    }

    .btn {
      .headerlink {
        display: inline;
      }

      .fa-large.headerlink {
        line-height: 0.9em;
      }

      .fa-spin.headerlink {
        display: inline-block;
      }
    }

    .nav {
      .headerlink {
        display: inline;
      }

      .fa-large.headerlink {
        line-height: 0.9em;
      }

      .fa-spin.headerlink {
        display: inline-block;
      }
    }

    .btn.headerlink {
      &:before {
        opacity: 0.5;
        -webkit-transition: opacity 0.05s ease-in;
        -moz-transition: opacity 0.05s ease-in;
        transition: opacity 0.05s ease-in;
      }

      &:hover {
        &:before {
          opacity: 1;
        }
      }
    }

    .btn-mini {
      .headerlink {
        &:before {
          font-size: 14px;
          vertical-align: -15%;
        }
      }
    }

    .rst-versions {
      .rst-current-version {
        .headerlink {
          color: #fcfcfc;
        }
      }
    }

    &:hover {
      .headerlink {
        &:after {
          visibility: visible;
        }
      }
    }

    font-weight: bold;
  }

  margin-bottom: 24px;

  p {
    margin-bottom: 12px !important;
  }

  table {
    margin-bottom: 12px !important;
  }

  ul {
    margin-bottom: 12px !important;
  }

  ol {
    margin-bottom: 12px !important;
  }

  dd {
    margin: 0 0 12px 24px;
  }

  &:not(.docutils) {
    margin-bottom: 24px;

    dt {
      display: table;
      margin: 6px 0;
      font-size: 90%;
      line-height: normal;
      background: #e7f2fa;
      color: #2980b9;
      border-top: solid 3px #6ab0de;
      padding: 6px;
      position: relative;

      &:before {
        color: #6ab0de;
      }

      .headerlink {
        color: #404040;
        font-size: 100% !important;
      }

      &:first-child {
        margin-top: 0;
      }
    }

    dl {
      dt {
        margin-bottom: 6px;
        border: none;
        border-left: solid 3px #ccc;
        background: #f0f0f0;
        color: #555;

        .headerlink {
          color: #404040;
          font-size: 100% !important;
        }
      }
    }

    tt {
      font-weight: bold;
    }

    code {
      font-weight: bold;
    }

    tt.descname {
      background-color: transparent;
      border: none;
      padding: 0;
      font-size: 100% !important;
      font-weight: bold;
    }

    tt.descclassname {
      background-color: transparent;
      border: none;
      padding: 0;
      font-size: 100% !important;
    }

    code.descname {
      background-color: transparent;
      border: none;
      padding: 0;
      font-size: 100% !important;
      font-weight: bold;
    }

    code.descclassname {
      background-color: transparent;
      border: none;
      padding: 0;
      font-size: 100% !important;
    }

    .optional {
      display: inline-block;
      padding: 0 4px;
      color: #000;
      font-weight: bold;
    }

    .property {
      display: inline-block;
      padding-right: 8px;
    }
  }

  .viewcode-link {
    display: inline-block;
    color: #27ae60;
    font-size: 80%;
    padding-left: 24px;
  }
}
