/* Background */ .chroma { color: #f8f8f2; background-color: #272822 }
/* Error */ .chroma .err { color: #960050; background-color: #1e0010 }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #575E38 }
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* Keyword */ .chroma .k { color: #66d9ef }
/* KeywordConstant */ .chroma .kc { color: #66d9ef }
/* KeywordDeclaration */ .chroma .kd { color: #66d9ef }
/* KeywordNamespace */ .chroma .kn { color: #f92672 }
/* KeywordPseudo */ .chroma .kp { color: #66d9ef }
/* KeywordReserved */ .chroma .kr { color: #66d9ef }
/* KeywordType */ .chroma .kt { color: #66d9ef }
/* NameAttribute */ .chroma .na { color: #a6e22e }
/* NameClass */ .chroma .nc { color: #a6e22e }
/* NameConstant */ .chroma .no { color: #66d9ef }
/* NameDecorator */ .chroma .nd { color: #a6e22e }
/* NameException */ .chroma .ne { color: #a6e22e }
/* NameFunction */ .chroma .nf { color: #a6e22e }
/* NameOther */ .chroma .nx { color: #a6e22e }
/* NameTag */ .chroma .nt { color: #f92672 }
/* Literal */ .chroma .l { color: #ae81ff }
/* LiteralDate */ .chroma .ld { color: #e6db74 }
/* LiteralString */ .chroma .s { color: #e6db74 }
/* LiteralStringAffix */ .chroma .sa { color: #e6db74 }
/* LiteralStringBacktick */ .chroma .sb { color: #e6db74 }
/* LiteralStringChar */ .chroma .sc { color: #e6db74 }
/* LiteralStringDelimiter */ .chroma .dl { color: #e6db74 }
/* LiteralStringDoc */ .chroma .sd { color: #e6db74 }
/* LiteralStringDouble */ .chroma .s2 { color: #e6db74 }
/* LiteralStringEscape */ .chroma .se { color: #ae81ff }
/* LiteralStringHeredoc */ .chroma .sh { color: #e6db74 }
/* LiteralStringInterpol */ .chroma .si { color: #e6db74 }
/* LiteralStringOther */ .chroma .sx { color: #e6db74 }
/* LiteralStringRegex */ .chroma .sr { color: #e6db74 }
/* LiteralStringSingle */ .chroma .s1 { color: #e6db74 }
/* LiteralStringSymbol */ .chroma .ss { color: #e6db74 }
/* LiteralNumber */ .chroma .m { color: #ae81ff }
/* LiteralNumberBin */ .chroma .mb { color: #ae81ff }
/* LiteralNumberFloat */ .chroma .mf { color: #ae81ff }
/* LiteralNumberHex */ .chroma .mh { color: #ae81ff }
/* LiteralNumberInteger */ .chroma .mi { color: #ae81ff }
/* LiteralNumberIntegerLong */ .chroma .il { color: #ae81ff }
/* LiteralNumberOct */ .chroma .mo { color: #ae81ff }
/* Operator */ .chroma .o { color: #f92672 }
/* OperatorWord */ .chroma .ow { color: #f92672 }
/* Comment */ .chroma .c { color: #A2A8AE }
/* CommentHashbang */ .chroma .ch { color: #A2A8AE }
/* CommentMultiline */ .chroma .cm { color: #A2A8AE }
/* CommentSingle */ .chroma .c1 { color: #A2A8AE }
/* CommentSpecial */ .chroma .cs { color: #A2A8AE }
/* CommentPreproc */ .chroma .cp { color: #A2A8AE }
/* CommentPreprocFile */ .chroma .cpf { color: #A2A8AE }
/* GenericDeleted */ .chroma .gd { color: #f92672 }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericInserted */ .chroma .gi { color: #a6e22e }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { color: #75715e }

.chroma {
  box-shadow: 0 2px 6px #0003;
}

.highlight-wrapper {
  display: block;
}

/* Start: Turn off individual column border, margin, and padding when line numbers are showing */

.highlight-wrapper .lntd pre {
  padding: 0;
}

.chroma .lntd pre {
  border: 0 solid #ccc;
}

.chroma .lntd:first-child {
  padding: 7px 7px 7px 10px;
  margin: 0;
}

.chroma .lntd:last-child {
  padding: 7px 10px 7px 7px;
  margin: 0;
}

/* End: Turn off individual column border, margin, and padding when line numbers are showing */

.highlight {
  position: relative;
  z-index: 0;
  padding: 0;
}

.codeblock {
  background-color: #272822;
  border-radius: 4px;

  &-body {
    background-color: lighten(#272822, 5%) !important;
  }

  &-toolbar {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    height: 40px;
    border-bottom: 1px solid $gray-dark;
    line-height: normal;
    padding: 0 1rem;
    color: $gray-light;
    font-size: 14px;

    &--title {
      display: flex;
      flex: none;
      align-items: center;
    }

    &--lang {
      display: flex;
      flex: none;
      align-items: center;
      margin-right: 1rem;

      $icon-size: 15px;

      &-icon-ts {
        &::after {
          width: $icon-size;
          height: $icon-size;
          background-size: 100%;
          background: url(/images/icons/codeblocks/typescript-icon.svg) no-repeat;
          content: '';
          display: inline-block;
        }
      }
      &-icon-js {
        &::after {
          width: $icon-size;
          height: $icon-size;
          background-size: 100%;
          background: url(/images/icons/codeblocks/javascript-icon.svg) no-repeat;
          content: '';
          display: inline-block;
        }
      }
      &-icon-sh {
        &::after {
          width: $icon-size;
          height: $icon-size;
          background-size: 100%;
          background: url(/images/icons/codeblocks/terminal-icon.svg) no-repeat;
          content: '';
          display: inline-block;
        }
      }
    }

    + .codeblock-body {
      border-radius: 0 0 4px 4px !important;
      margin-top: 0;
    }
  }
}

.copy-code-button {
  position: absolute;
  z-index: 2;
  right: 0;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: none;
  margin-top: 12px;
  margin-right: 12px;
  padding: 0;
  line-height: 0;
  transition: all 100ms ease-in-out;

  &:hover, &:focus, &:active, .copy-code-button:active:hover {
    &::after {
      color: $gray-light;
    }
  }

  &::after {
    width: 16px;
    height: 16px;
    background-size: 100%;
    background-color: $gray-light;
    mask: url(/images/icons/copy.svg) no-repeat;
    content: '';
    display: inline-block;
    transition: .15s transform ease;
  }

  &.copy-code-button--copied {
    color: $gray-light;
    &:after {
      background-color: $green;
      mask: url(/images/icons/check.svg) no-repeat;

    }
    &:hover {
      &:after {
        color: $green;
      }
    }
  }
}
