/* style.css */
:root {
  --od-bg: #282c34;
  --od-bg-dark: #21252b;
  --od-bg-highlight: #2c313c;
  --od-selection: #3e4451;
  --od-text: #abb2bf;
  --od-text-muted: #7d8799;
  --od-blue: #61afef;
  --od-green: #98c379;
  --od-orange: #d19a66;
  --od-red: #e06c75;
  --od-purple: #c678dd;
  --od-cyan: #56b6c2;
}

html {
  scrollbar-gutter: stable;
}

body {
  background: var(--od-bg);
  color: var(--od-text);
  -webkit-text-size-adjust: 100%;

  & > header {
    max-width: 1280px;
    margin: auto;
  }

  & > main {
    max-width: 1280px;
    margin: auto;
  }
}

body, table, h5 {
  font-family: Open Sans, sans-serif;
  font-size: 17px;
  font-weight: normal;
  line-height: 1.6;
}

#app .docs-container {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 80px;
}

#app .docs-container > header {
  position: fixed;
  z-index: 2;
  background: var(--od-bg);
  top: 0;
  left: 0;
  right: 0;
}

#app .docs-container > header .header-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  center;
  gap: 12px 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 0;
}

header .header-brand {
  display: flex;
  align-items:  center;
  gap: 8px;
}

header .header-brand .logo {
  vertical-align: middle;
  width: auto;
  height: 1.5em;
}

.docs-body {
  display: flex;
  margin-top: 0;

  & main {
    flex: 1;
    min-width: 0;
  }

  & .body {
    margin-left: 0;
  }
}

.docs-sidebar-wrapper {
  flex-shrink: 0;
  width: 260px;
}

.docs-sidebar {
  position: fixed;
  overflow-y: auto;
  z-index: 1;
  width: 260px;
  max-height: calc(100vh - 80px);
  padding-right: 24px;
  top: 80px;
  left: max(0px, 50vw - 640px);
}

.docs-nav-sections {
  display: flex;
  flex-direction: column;
  gap: 1em 0;
}

.docs-nav-section {
  display: flex;
  position: relative;
  z-index: 1;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-section-label, .docs-nav-section-title {
  color: var(--od-text);
  font-weight: 600;
}

.docs-nav-links {
  display: flex;
  border-left: 3px solid var(--od-blue);
  flex-direction: column;
  gap: 2px 0;
  margin: 4px 0 2px;
  padding-left: 15px;
}

.docs-nav-link {
  margin: 0;
  padding: 0;

  & a {
    color: var(--od-blue);
    text-decoration: none;

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

  &.docs-nav-link--active a {
    color: var(--od-text);
    font-weight: 600;
  }
}

.docs-nav-link a.docs-nav-link-external:after {
  content: " ↗";
  opacity: .8;
  font-size: .85em;
}

.docs-nav-page-toc .docs-sidebar-toc {
  border-top: none;
  border-left: none;
  margin-top: .5em;
  padding-top: .5em;
  padding-left: 0;
}

.docs-sidebar .docs-sidebar-toc {
  border-top: 1px solid var(--od-selection);
  border-left: 3px solid var(--od-blue);
  position: relative;
  z-index: 1;
  overflow-wrap: break-word;
  word-wrap: break-word;
  margin-top: 1.5em;
  padding-top: 1em;
  padding-left: 15px;
  padding-right: 0;

  &:before {
    content: "On this page";
    display: block;
    color: var(--od-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
  }

  & li {
    list-style: none;
    margin: 2px 0;
    padding-left: 0;
  }

  & li::marker {
    content: none;
    display: none;
  }

  & a {
    display: inline;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  & a.docs-toc-link--active {
    color: var(--od-text);
    font-weight: 600;
  }
}

header nav {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 4px 0;

  & a {
    border-left: 1px solid var(--od-selection);
    color: var(--od-text);
    padding: 0 10px;

    &:first-child {
      border: 0;
      padding-left: 0;
    }

    &:hover {
      color: var(--od-blue);
    }

    &.active {
      color: var(--od-blue);
      font-weight: 600;
    }
  }
}

main {
  margin-bottom: 100px;
}

.body {
  margin-left: 270px;
}

.body h1 + ul {
  display: none;
}

.body h2[id], .body h3[id], .body h4[id] {
  scroll-margin-top: 80px;
}

.body-crossfade {
  position: relative;
}

.body-crossfade .body-current {
  animation: body-fade-out .2s ease-out forwards;
}

.body-crossfade .body-next {
  position: absolute;
  animation: body-fade-in .2s ease-out forwards;
  inset: 0;
}

@keyframes body-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes body-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

p {
  margin: 0 0 15px;
}

pre, code {
  background: var(--od-bg-dark);
  font-family: monospace;
  font-size: 15px;
}

pre {
  border-left: 3px solid var(--od-blue);
  overflow: auto;
  margin: 20px 0;
  padding: 10px 20px;

  & code {
    border: 0;
    margin: 0;
    padding: 0;
  }
}

code {
  border: 1px solid var(--od-selection);
  display: inline-block;
  white-space: pre;
  margin: 0 0 1px;
  padding: 5px 3px;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 30px;

  & tbody tr:nth-child(odd) {
    background: var(--od-bg-dark);
  }

  & thead tr {
    background: var(--od-bg-highlight);
  }

  & tbody tr:nth-child(2n) {
    background: var(--od-bg-highlight);
  }

  & tr {
    border-bottom: 1px solid var(--od-selection);
  }

  & th {
    text-align: left;
  }

  & th {
    vertical-align: top;
    padding: 3px 10px;
  }

  & td {
    vertical-align: top;
    padding: 3px 10px;
  }

  & th:first-child {
    min-width: 6em;
  }

  & td:first-child {
    min-width: 6em;
  }

  & th:nth-child(2) {
    min-width: 8em;
  }

  & td:nth-child(2) {
    min-width: 8em;
  }

  & th:nth-child(3) {
    min-width: 4em;
  }

  & td:nth-child(3) {
    min-width: 4em;
  }

  & th:nth-child(4) {
    min-width: 12em;
  }

  & td:nth-child(4) {
    min-width: 12em;
  }
}

a {
  color: var(--od-blue);
  text-decoration: none;

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

hr {
  border: 0;
  border-bottom: 1px solid var(--od-selection);
  margin: 30px 0;
}

h1, h2, h3, h4, h5 {
  position: relative;
}

h1 {
  margin: 0 0 15px;
  font-size: 24px;

  & img {
    vertical-align: middle;
    width: 20px;
    padding-right: .25em;
  }

  & .version {
    font-size: 16px;
    font-weight: normal;
  }

  & .version-aa {
    color: var(--od-red);
    font-weight: bold;
  }

  & .version-aa-icon {
    display: inline-block;
    vertical-align: -.15em;
    color: var(--od-red);
    opacity: .9;
    width: 1em;
    height: 1em;
    margin-left: .2em;
  }

  & small {
    font-size: 16px;
  }

  & + ul {
    position: absolute;
    z-index: 1;
    width: 250px;
    margin: 40px 0 0 -270px;
    padding: 0;

    & + hr {
      display: none;
    }

    & li {
      list-style: none;
      margin: 0;
      padding: 0;

      &:last-child {
        border-bottom: 0;
      }
    }

    & ul {
      margin: 0 0 2px;
      padding: 0 0 0 15px;

      & li {
        border: 0;
      }
    }

    & strong + ul {
      border-left: 3px solid var(--od-blue);
    }
  }
}

h2, h3, h4, h5 {
  position: relative;
  color: var(--od-text);

  & a {
    color: var(--od-text);
    text-decoration: none;
  }

  & a:hover {
    color: var(--od-text);
    text-decoration: none;
  }

  & a:active {
    color: var(--od-text);
    text-decoration: none;
  }

  & a:visited {
    color: var(--od-text);
    text-decoration: none;
  }

  &:before {
    content: "#";
    position: absolute;
    visibility: hidden;
    left: -20px;
  }

  &:hover:before {
    visibility: visible;
  }
}

h2 {
  margin: 45px 0 15px;
  font-size: 22px;
}

h3 {
  margin: 45px 0 15px;
  font-size: 20px;
}

h4 {
  margin: 30px 0 15px;
  font-size: 18px;
}

h5 {
  margin: 15px 0;
  font-weight: bold;
}

#signature + p code {
  padding: 3px 10px;
}

.footer {
  position: relative;
  border-top: 1px solid var(--od-selection);
  margin: 15px 0;
  padding: 15px 0;

  & > * {
    position: absolute;
    font-size: 80%;
  }

  & > :first-child {
    left: 0;
  }

  & > :last-child {
    right: 0;
  }
}

.hamburger {
  display: none;
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.demo-scale {
  animation-name: grow;
  animation-timing-function: linear;
  background: var(--od-blue);
  transform-origin: 0;
  height: 3px;
  margin: 0 10px 10px 0;
}

@media (width <= 767px) {
  .hamburger {
    display: block;
    position: fixed;
    z-index: 2;
    padding: 0 10px;
    font-size: 30px;
    top: 0;
    right: 0;

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

  .docs-body .body {
    margin: 0;
  }

  header .header-section {
    margin: 0 0 20px;
  }

  .docs-sidebar-wrapper, .docs-sidebar {
    display: none;
  }

  .navigating {
    overflow: hidden;

    & .docs-sidebar {
      background: var(--od-bg-dark);
      border: 1px solid var(--od-selection);
      box-sizing: border-box;
      display: block;
      overflow: auto;
      position: fixed;
      z-index: 1;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 20px;
      top: 0;
      right: 0;
    }
  }
}

@media (width <= 1024px) {
  table, table tbody, table tr, table th, table td {
    display: block;
  }

  table thead {
    display: none;
  }

  table td:before {
    display: inline-block;
    width: 100px;
    padding: 0 10px 0 0;
    font-style: italic;
    font-weight: bold;
  }

  table tr:not(:last-child) td:first-child:before {
    content: "Argument:";
  }

  table tr:last-child td:nth-child(3) {
    display: none;
  }

  table td:nth-child(2):before {
    content: "Type:";
  }

  table td:nth-child(3):before {
    content: "Required:";
  }

  table td:nth-child(4):before {
    content: "Description:";
  }

  #structure ~ table td:first-child:before {
    content: "Property:";
  }

  #structure ~ table td:nth-child(2):before {
    content: "Type:";
  }

  #structure ~ table td:nth-child(3):before {
    content: "Description:";
  }

  #vnode-types ~ table td:first-child:before {
    content: "Vnode type:";
  }

  #vnode-types ~ table td:nth-child(2):before {
    content: "Example:";
  }

  #vnode-types ~ table td:nth-child(3):before {
    content: "Description:";
  }

  #lifecycle-methods ~ table td:first-child:before {
    content: "Hook:";
  }

  #lifecycle-methods ~ table td:nth-child(2):before {
    content: "Description:";
  }

  #react ~ table td:first-child:before {
    content: "React:";
  }

  #angular ~ table td:first-child:before {
    content: "Angular:";
  }

  #vue ~ table td:first-child:before {
    content: "Vue:";
  }

  #comparisons ~ table td:nth-child(2):before {
    content: "Mithril:";
  }
}

@media print {
  nav, .docs-sidebar-wrapper, .docs-sidebar {
    display: none;
  }

  .docs-body .body {
    margin: 0;
  }
}

.docs-code-block {
  border-left: 3px solid var(--od-blue);
  overflow: auto;
  margin: 20px 0;
}

.docs-code-block .cm-editor {
  min-height: 0;
}

.docs-code-block .cm-scroller {
  min-height: 0;
  padding: 10px 20px;
}

.docs-code-block .cm-content {
  padding: 0;
}

.token.comment, .token.prolog, .token.doctype, .token.cdata {
  color: var(--od-text-muted);
}

.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol {
  color: var(--od-orange);
}

.token.selector, .token.attr-name, .token.string, .token.builtin {
  color: var(--od-green);
}

.token.atrule, .token.attr-value, .token.punctuation, .token.keyword {
  color: var(--od-blue);
}

.token.regex, .token.important {
  color: var(--od-orange);
}

.docs-sandbox {
  border: 1px solid var(--od-selection);
  overflow: hidden;
  border-radius: 4px;
  margin: 20px 0;
}

.docs-sandbox-tabs {
  display: flex;
  background: var(--od-bg-dark);
  border-bottom: 1px solid var(--od-selection);
  gap: 0;
  padding: 0;
}

.docs-sandbox-tab {
  color: var(--od-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid #0000;
  padding: 8px 16px;
  font-size: 13px;
}

.docs-sandbox-tab:hover {
  color: var(--od-text);
}

.docs-sandbox-tab.active {
  color: var(--od-blue);
  border-bottom-color: var(--od-blue);
}

.docs-sandbox-panel-hidden {
  display: none;
}

.docs-sandbox-toolbar {
  background: var(--od-bg-dark);
  border-bottom: 1px solid var(--od-selection);
  padding: 8px 12px;
}

.docs-sandbox-run {
  background: var(--od-blue);
  color: var(--od-bg);
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 13px;
}

.docs-sandbox-run:hover {
  background: var(--od-cyan);
}

.docs-sandbox-editor, .docs-sandbox-editor .cm-editor, .docs-sandbox-editor .cm-scroller {
  background: var(--od-bg-dark);
  min-height: 180px;
}

.docs-sandbox-preview {
  border-top: 1px solid var(--od-selection);
  background: var(--od-bg-dark);
  min-height: 140px;
  padding: 16px;
}

.docs-sandbox-iframe {
  display: block;
  background: var(--od-bg);
  border: none;
  border-radius: 4px;
  width: 100%;
  min-height: 120px;
  box-shadow: inset 0 1px 3px #0003;
}

.tippy-box[data-theme~="docs-one-dark"] {
  background: var(--od-bg-highlight);
  color: var(--od-text);
  border: 1px solid var(--od-selection);
}

.tippy-box[data-theme~="docs-one-dark"] > .tippy-arrow:before {
  border-top-color: var(--od-bg-highlight);
  border-bottom-color: var(--od-bg-highlight);
  border-left-color: var(--od-bg-highlight);
  border-right-color: var(--od-bg-highlight);
}

.docs-tippy-wrap {
  cursor: help;
}
