@use "../../feature/lookAndFeel/style-guide" as style;

pre {
  color: black;
  background: none;
  text-shadow: 0 1px white;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  tab-size: 4;
  hyphens: none;
  padding: 1em;
  margin: .5em 0;
  overflow: auto;

  > code {
    display: block;
  }
}

pre *, code {
  &::selection {
    background: #b3d4fc;
  }
}

:not(pre) > code,
pre {
  background: style.$navy-025;
  border-radius: 16px;
}

:not(pre) > code {
  padding: .1em .2em;
  border: 1px solid #ededed;
  border-radius: .15em;
  white-space: normal;
  color: #666;
}

blockquote {
  :not(pre) > code {
    color: #999;
  }
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: slateGray;
}

.token.punctuation {
  color: #999;
}

.token.namespace {
  opacity: .7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #905;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #690;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #9a6e3a;
  background: hsla(0, 0%, 100%, .5);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #07a;
}

.token.function,
.token.class-name {
  color: #dd4a68;
}

.token.regex,
.token.important,
.token.variable {
  color: #e90;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

pre[class*="language-"].line-numbers {
  position: relative;
  padding-left: 3.8em;
  counter-reset: lineNumber;

  > code {
    position: relative;
    white-space: inherit;
  }
}

.line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 100%;
  left: -3.8em;
  width: 3em; /* works for line-numbers below 1000 lines */
  letter-spacing: -1px;
  border-right: 1px solid #999;

  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

  > span {
    pointer-events: none;
    display: block;
    counter-increment: lineNumber;

    &:before {
      content: counter(lineNumber);
      color: #999;
      display: block;
      padding-right: 0.8em;
      text-align: right;
    }
  }
}
