/*
 * Based on the file described below, but edited for compatibility with Curie.
 */

/* PrismJS 1.22.0
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+bash+batch+c+csharp+cpp+http+java+json+json5+powershell+jsx+tsx+typescript+typoscript+yaml&plugins=line-highlight+line-numbers+custom-class+autoloader+normalize-whitespace+toolbar+copy-to-clipboard+match-braces */
/**
 * okaidia theme for JavaScript, CSS and HTML
 * Loosely based on Monokai textmate theme by http://www.monokai.nl/
 * @author ocodia
 */

/** CODE BOX **/
code[class*='language-'],
pre[class*='language-'] {
  color: #dadbe0;
  background: none;
  font-family: Noto Sans Mono, monospace;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05rem;

  line-height: 1.5;
  text-align: left;
  white-space: pre;

  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;

  padding-right: 3rem;
}

/* Code blocks */
pre[class*='language-'] {
  padding: 1.5rem;
  margin: 0.5rem 0;
  overflow: auto;
  border-radius: 0.25rem;
}

:not(pre) > code[class*='language-'],
pre[class*='language-'] {
  background: #000000;
}

/* Inline code */
:not(pre) > code[class*='language-'] {
  padding: 0.1rem;
  border-radius: 0.25rem;
  white-space: normal;
}

/** TOKENS **/
.prism-token.prism-comment,
.prism-token.prism-prolog,
.prism-token.prism-doctype,
.prism-token.prism-cdata {
  color: #6a6c75;
}

.prism-token.prism-punctuation {
  color: #f9f9fa;
}

.prism-token.prism-namespace {
  opacity: 0.7;
}

.prism-token.prism-property,
.prism-token.prism-tag,
.prism-token.prism-constant,
.prism-token.prism-symbol,
.prism-token.prism-deleted {
  color: #ca4247;
}

.prism-token.prism-boolean,
.prism-token.prism-number {
  color: #009bb9;
}

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

.prism-token.prism-operator,
.prism-token.prism-entity,
.prism-token.prism-url,
.language-css .prism-token.prism-string,
.style .prism-token.prism-string,
.prism-token.prism-variable {
  color: #f8f8f2;
}

.prism-token.prism-atrule,
.prism-token.prism-attr-value,
.prism-token.prism-function,
.prism-token.prism-class-name {
  color: #007890;
  font-weight: 600;
}

.prism-token.prism-keyword {
  color: #66cde1;
}

.prism-token.prism-regex,
.prism-token.prism-important {
  color: #ffad1f;
}

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

.prism-token.prism-entity {
  cursor: help;
}

pre[data-line] {
  position: relative;
  padding: 1rem 0 1rem 3rem;
}

/** HIGHLIGHTING **/
.line-highlight {
  position: absolute;
  left: 0;
  right: 0;
  padding: inherit 0;
  margin-top: 1rem; /* Same as .prism’s padding-top */

  background: hsla(24, 20%, 50%, 0.08);
  background: linear-gradient(to right, hsla(24, 20%, 50%, 0.1) 70%, hsla(24, 20%, 50%, 0));

  pointer-events: none;

  line-height: inherit;
  white-space: pre;
}

.line-highlight:before,
.line-highlight[data-end]:after {
  content: attr(data-start);
  position: absolute;
  top: 0.4rem;
  left: 0.6rem;
  min-width: 1rem;
  padding: 0 0.5rem;
  background-color: hsla(24, 20%, 50%, 0.4);
  color: hsl(24, 20%, 95%);
  font: bold 65%/1.5 sans-serif;
  text-align: center;
  vertical-align: 0.3rem;
  border-radius: 999px;
  text-shadow: none;
  box-shadow: 0 1px white;
}

.line-highlight[data-end]:after {
  content: attr(data-end);
  top: auto;
  bottom: 0.4rem;
}

/** LINE NUMBERS **/
.line-numbers .line-highlight:before,
.line-numbers .line-highlight:after {
  content: none;
}

pre[id].linkable-line-numbers span.line-numbers-rows {
  pointer-events: all;
}
pre[id].linkable-line-numbers span.line-numbers-rows > span:before {
  cursor: pointer;
}
pre[id].linkable-line-numbers span.line-numbers-rows > span:hover:before {
  background-color: #6a6c75;
}

pre[class*='language-'].line-numbers {
  position: relative;
  padding-left: 5rem;
  counter-reset: linenumber;
}

pre[class*='language-'].line-numbers > code {
  position: relative;
  white-space: inherit;
}

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

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

.line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.line-numbers-rows > span:before {
  content: counter(linenumber);
  color: #51535c;
  display: block;
  padding-right: 1rem;
  text-align: right;
}

/** TOOLBAR / COPY BUTTON **/
div.code-toolbar {
  position: relative;
  display: grid;
}

div.code-toolbar > .toolbar {
  position: absolute;
  right: 0;
  top: 0;
}

div.code-toolbar > .toolbar .toolbar-item {
  display: inline-block;
}

div.code-toolbar > .toolbar a {
  cursor: pointer;
}

div.code-toolbar > .toolbar button {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  line-height: normal;
  overflow: visible;
  padding: 0;
  -webkit-user-select: none; /* for button */
  -moz-user-select: none;
  -ms-user-select: none;
}

div.code-toolbar > .toolbar a,
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
  background-color: #000000;
  background-image: url(../assets/copy-solid.png);
  background-repeat: no-repeat;
  background-position: center;

  font-size: 0px;
  height: 1rem;
  width: 1rem;

  position: absolute;
  right: 0;
  top: 0.5rem;
  padding: 1.75rem;
  box-sizing: content-box;
  border-radius: 0.25rem;
}

div.code-toolbar > .toolbar a:hover,
div.code-toolbar > .toolbar a:focus,
div.code-toolbar > .toolbar button:hover,
div.code-toolbar > .toolbar button:focus,
div.code-toolbar > .toolbar span:hover,
div.code-toolbar > .toolbar span:focus {
  color: inherit;
  text-decoration: none;
  outline: none;
}

/** BRACE HIGHLIGHTING **/
.prism-token.prism-punctuation.brace-hover,
.prism-token.prism-punctuation.brace-selected {
  outline: solid 1px;
}
