/* I've mashed two themes together to work with light and dark mode */

/*
 * Laserwave Theme originally by Jared Jones for Visual Studio Code
 * https://github.com/Jaredk3nt/laserwave
 *
 * Ported for PrismJS by Simon Jespersen [https://github.com/simjes]
 */

:where(:root.dark code[class*='language-']),
:where(:root.dark pre[class*='language-']) {
  background: #27212e;
  color: #ffffff;
  font-size: 1em;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  line-height: 1.5;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}
:where(:root.dark code[class*='language-']::-moz-selection),
:where(:root.dark code[class*='language-'] ::-moz-selection),
:where(:root.dark pre[class*='language-']::-moz-selection),
:where(:root.dark pre[class*='language-'] ::-moz-selection) {
  background: #eb64b927;
  color: inherit;
}
:where(:root.dark code[class*='language-']::selection),
:where(:root.dark code[class*='language-'] ::selection),
:where(:root.dark pre[class*='language-']::selection),
:where(:root.dark pre[class*='language-'] ::selection) {
  background: #eb64b927;
  color: inherit;
}
:where(:root.dark pre[class*='language-']) {
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
  border-radius: 0.5em;
}
:where(:root.dark :not(pre) > code[class*='language-']) {
  padding: 0.2em 0.3em;
  border-radius: 0.5rem;
  white-space: normal;
}
:where(:root.dark .token.comment),
:where(:root.dark .token.prolog),
:where(:root.dark .token.cdata) {
  color: #91889b;
}
:where(:root.dark .token.punctuation) {
  color: #7b6995;
}
:where(:root.dark .token.builtin),
:where(:root.dark .token.constant),
:where(:root.dark .token.boolean) {
  color: #ffe261;
}
:where(:root.dark .token.number) {
  color: #b381c5;
}
:where(:root.dark .token.important),
:where(:root.dark .token.atrule),
:where(:root.dark .token.property),
:where(:root.dark .token.keyword) {
  color: #40b4c4;
}
:where(:root.dark .token.doctype),
:where(:root.dark .token.operator),
:where(:root.dark .token.inserted),
:where(:root.dark .token.tag),
:where(:root.dark .token.class-name),
:where(:root.dark .token.symbol) {
  color: #74dfc4;
}
:where(:root.dark .token.attr-name),
:where(:root.dark .token.function),
:where(:root.dark .token.deleted),
:where(:root.dark .token.selector) {
  color: #eb64b9;
}
:where(:root.dark .token.attr-value),
:where(:root.dark .token.regex),
:where(:root.dark .token.char),
:where(:root.dark .token.string) {
  color: #b4dce7;
}
:where(:root.dark .token.entity),
:where(:root.dark .token.url),
:where(:root.dark .token.variable) {
  color: #ffffff;
}
:where(:root.dark .token.bold) {
  font-weight: bold;
}
:where(:root.dark .token.italic) {
  font-style: italic;
}
:where(:root.dark .token.entity) {
  cursor: help;
}
:where(:root.dark .token.namespace) {
  opacity: 0.7;
}

/* ---------------- */

/**
 * One Light theme for prism.js
 * Based on Atom's One Light theme: https://github.com/atom/atom/tree/master/packages/one-light-syntax
 */

/**
 * One Light colours (accurate as of commit eb064bf on 19 Feb 2021)
 * From colors.less
 * --mono-1: hsl(230, 8%, 24%);
 * --mono-2: hsl(230, 6%, 44%);
 * --mono-3: hsl(230, 4%, 64%)
 * --hue-1: hsl(198, 99%, 37%);
 * --hue-2: hsl(221, 87%, 60%);
 * --hue-3: hsl(301, 63%, 40%);
 * --hue-4: hsl(119, 34%, 47%);
 * --hue-5: hsl(5, 74%, 59%);
 * --hue-5-2: hsl(344, 84%, 43%);
 * --hue-6: hsl(35, 99%, 36%);
 * --hue-6-2: hsl(35, 99%, 40%);
 * --syntax-fg: hsl(230, 8%, 24%);
 * --syntax-bg: hsl(230, 1%, 98%);
 * --syntax-gutter: hsl(230, 1%, 62%);
 * --syntax-guide: hsla(230, 8%, 24%, 0.2);
 * --syntax-accent: hsl(230, 100%, 66%);
 * From syntax-variables.less
 * --syntax-selection-color: hsl(230, 1%, 90%);
 * --syntax-gutter-background-color-selected: hsl(230, 1%, 90%);
 * --syntax-cursor-line: hsla(230, 8%, 24%, 0.05);
 */

:where(:root:not(.dark) code[class*='language-']),
:where(:root:not(.dark) pre[class*='language-']) {
  background: hsl(230, 1%, 98%);
  color: hsl(230, 8%, 24%);
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  line-height: 1.5;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Selection */
:where(:root:not(.dark) code[class*='language-']::-moz-selection),
:where(:root:not(.dark) code[class*='language-'] *::-moz-selection),
:where(:root:not(.dark) pre[class*='language-'] *::-moz-selection) {
  background: hsl(230, 1%, 90%);
  color: inherit;
}

:where(:root:not(.dark) code[class*='language-']::selection),
:where(:root:not(.dark) code[class*='language-'] *::selection),
:where(:root:not(.dark) pre[class*='language-'] *::selection) {
  background: hsl(230, 1%, 90%);
  color: inherit;
}

/* Code blocks */
:where(:root:not(.dark) pre[class*='language-']) {
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
  border-radius: 0.3em;
}

/* Inline code */
:where(:root:not(.dark) :not(pre) > code[class*='language-']) {
  padding: 0.2em 0.3em;
  border-radius: 0.3em;
  white-space: normal;
}

:where(:root:not(.dark) .token.comment),
:where(:root:not(.dark) .token.prolog),
:where(:root:not(.dark) .token.cdata) {
  color: hsl(230, 4%, 64%);
}

:where(:root:not(.dark) .token.doctype),
:where(:root:not(.dark) .token.punctuation),
:where(:root:not(.dark) .token.entity) {
  color: hsl(230, 8%, 24%);
}

:where(:root:not(.dark) .token.attr-name),
:where(:root:not(.dark) .token.class-name),
:where(:root:not(.dark) .token.boolean),
:where(:root:not(.dark) .token.constant),
:where(:root:not(.dark) .token.number),
:where(:root:not(.dark) .token.atrule) {
  color: hsl(35, 99%, 36%);
}

:where(:root:not(.dark) .token.keyword) {
  color: hsl(301, 63%, 40%);
}

:where(:root:not(.dark) .token.property),
:where(:root:not(.dark) .token.tag),
:where(:root:not(.dark) .token.symbol),
:where(:root:not(.dark) .token.deleted),
:where(:root:not(.dark) .token.important) {
  color: hsl(5, 74%, 59%);
}

:where(:root:not(.dark) .token.selector),
:where(:root:not(.dark) .token.string),
:where(:root:not(.dark) .token.char),
:where(:root:not(.dark) .token.builtin),
:where(:root:not(.dark) .token.inserted),
:where(:root:not(.dark) .token.regex),
:where(:root:not(.dark) .token.attr-value),
:where(:root:not(.dark) .token.attr-value > .token.punctuation) {
  color: hsl(119, 34%, 47%);
}

:where(:root:not(.dark) .token.variable),
:where(:root:not(.dark) .token.operator),
:where(:root:not(.dark) .token.function) {
  color: hsl(221, 87%, 60%);
}

:where(:root:not(.dark) .token.url) {
  color: hsl(198, 99%, 37%);
}

/* HTML overrides */
:where(:root:not(.dark) .token.attr-value > .token.punctuation.attr-equals),
:where(:root:not(.dark) .token.special-attr > .token.attr-value > .token.value.css) {
  color: hsl(230, 8%, 24%);
}

/* CSS overrides */
:where(:root:not(.dark) .language-css .token.selector) {
  color: hsl(5, 74%, 59%);
}

:where(:root:not(.dark) .language-css .token.property) {
  color: hsl(230, 8%, 24%);
}

:where(:root:not(.dark) .language-css .token.function),
:where(:root:not(.dark) .language-css .token.url > .token.function) {
  color: hsl(198, 99%, 37%);
}

:where(:root:not(.dark) .language-css .token.url > .token.string.url) {
  color: hsl(119, 34%, 47%);
}

:where(:root:not(.dark) .language-css .token.important),
:where(:root:not(.dark) .language-css .token.atrule .token.rule) {
  color: hsl(301, 63%, 40%);
}

/* JS overrides */
:where(:root:not(.dark) .language-javascript .token.operator) {
  color: hsl(301, 63%, 40%);
}

:where(
    :root:not(.dark)
      .language-javascript
      .token.template-string
      > .token.interpolation
      > .token.interpolation-punctuation.punctuation
  ) {
  color: hsl(344, 84%, 43%);
}

/* JSON overrides */
:where(:root:not(.dark) .language-json .token.operator) {
  color: hsl(230, 8%, 24%);
}

:where(:root:not(.dark) .language-json .token.null.keyword) {
  color: hsl(35, 99%, 36%);
}

/* MD overrides */
:where(:root:not(.dark) .language-markdown .token.url),
:where(:root:not(.dark) .language-markdown .token.url > .token.operator),
:where(:root:not(.dark) .language-markdown .token.url-reference.url > .token.string) {
  color: hsl(230, 8%, 24%);
}

:where(:root:not(.dark) .language-markdown .token.url > .token.content) {
  color: hsl(221, 87%, 60%);
}

:where(:root:not(.dark) .language-markdown .token.url > .token.url),
:where(:root:not(.dark) .language-markdown .token.url-reference.url) {
  color: hsl(198, 99%, 37%);
}

:where(:root:not(.dark) .language-markdown .token.blockquote.punctuation),
:where(:root:not(.dark) .language-markdown .token.hr.punctuation) {
  color: hsl(230, 4%, 64%);
  font-style: italic;
}

:where(:root:not(.dark) .language-markdown .token.code-snippet) {
  color: hsl(119, 34%, 47%);
}

:where(:root:not(.dark) .language-markdown .token.bold .token.content) {
  color: hsl(35, 99%, 36%);
}

:where(:root:not(.dark) .language-markdown .token.italic .token.content) {
  color: hsl(301, 63%, 40%);
}

:where(:root:not(.dark) .language-markdown .token.strike .token.content),
:where(:root:not(.dark) .language-markdown .token.strike .token.punctuation),
:where(:root:not(.dark) .language-markdown .token.list.punctuation),
:where(:root:not(.dark) .language-markdown .token.title.important > .token.punctuation) {
  color: hsl(5, 74%, 59%);
}

/* General */
:where(:root:not(.dark) .token.bold) {
  font-weight: bold;
}

:where(:root:not(.dark) .token.comment),
:where(:root:not(.dark) .token.italic) {
  font-style: italic;
}

:where(:root:not(.dark) .token.entity) {
  cursor: help;
}

:where(:root:not(.dark) .token.namespace) {
  opacity: 0.8;
}

/* Plugin overrides */
/* Selectors should have higher specificity than those in the plugins' default stylesheets */

/* Show Invisibles plugin overrides */
:where(:root:not(.dark) .token.token.tab:not(:empty):before),
:where(:root:not(.dark) .token.token.cr:before),
:where(:root:not(.dark) .token.token.lf:before),
:where(:root:not(.dark) .token.token.space:before) {
  color: hsla(230, 8%, 24%, 0.2);
}

/* Toolbar plugin overrides */
/* Space out all buttons and move them away from the right edge of the code block */
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item) {
  margin-right: 0.4em;
}

/* Styling the buttons */
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > button),
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > a),
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > span) {
  background: hsl(230, 1%, 90%);
  color: hsl(230, 6%, 44%);
  padding: 0.1em 0.4em;
  border-radius: 0.3em;
}

:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover),
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus),
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover),
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus),
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover),
:where(:root:not(.dark) div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus) {
  background: hsl(230, 1%, 78%); /* custom: darken(--syntax-bg, 20%) */
  color: hsl(230, 8%, 24%);
}

/* Line Highlight plugin overrides */
/* The highlighted line itself */
:where(:root:not(.dark) line-highlight.line-highlight) {
  background: hsla(230, 8%, 24%, 0.05);
}

/* Default line numbers in Line Highlight plugin */
:where(:root:not(.dark) .line-highlight.line-highlight:befor)e,
:where(:root:not(.dark) .line-highlight.line-highlight[data-end]:after) {
  background: hsl(230, 1%, 90%);
  color: hsl(230, 8%, 24%);
  padding: 0.1em 0.6em;
  border-radius: 0.3em;
  box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */
}

/* Hovering over a linkable line number (in the gutter area) */
/* Requires Line Numbers plugin as well */
:where(
    :root:not(.dark)
      pre[id].linkable-line-numbers.linkable-line-numbers
      span.line-numbers-rows
      > span:hover:before
  ) {
  background-color: hsla(230, 8%, 24%, 0.05);
}

/* Line Numbers and Command Line plugins overrides */
/* Line separating gutter from coding area */
:where(:root:not(.dark) .line-numbers.line-numbers .line-numbers-row)s,
:where(:root:not(.dark) .command-line .command-line-prompt) {
  border-right-color: hsla(230, 8%, 24%, 0.2);
}

/* Stuff in the gutter */
:where(:root:not(.dark) .line-numbers .line-numbers-rows > span:befor)e,
:where(:root:not(.dark) .command-line .command-line-prompt > span:before) {
  color: hsl(230, 1%, 62%);
}

/* Match Braces plugin overrides */
/* Note: Outline colour is inherited from the braces */
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-1),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-5),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-9) {
  color: hsl(5, 74%, 59%);
}

:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-2),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-6),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-10) {
  color: hsl(119, 34%, 47%);
}

:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-3),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-7),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-11) {
  color: hsl(221, 87%, 60%);
}

:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-4),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-8),
:where(:root:not(.dark) .rainbow-braces .token.token.punctuation.brace-level-12) {
  color: hsl(301, 63%, 40%);
}

/* Diff Highlight plugin overrides */
/* Taken from https://github.com/atom/github/blob/master/styles/variables.less */
:where(:root:not(.dark) pre.diff-highlight > code .token.token.deleted:not(.prefix)),
:where(:root:not(.dark) pre > code.diff-highlight .token.token.deleted:not(.prefix)) {
  background-color: hsla(353, 100%, 66%, 0.15);
}

:where(
    :root:not(.dark) pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection
  ),
:where(
    :root:not(.dark) pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection
  ),
:where(
    :root:not(.dark) pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection
  ),
:where(
    :root:not(.dark) pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection
  ) {
  background-color: hsla(353, 95%, 66%, 0.25);
}

:where(:root:not(.dark) pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection),
:where(:root:not(.dark) pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection),
:where(:root:not(.dark) pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection),
:where(:root:not(.dark) pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection) {
  background-color: hsla(353, 95%, 66%, 0.25);
}

:where(:root:not(.dark) pre.diff-highlight > code .token.token.inserted:not(.prefix)),
:where(:root:not(.dark) pre > code.diff-highlight .token.token.inserted:not(.prefix)) {
  background-color: hsla(137, 100%, 55%, 0.15);
}

:where(
    :root:not(.dark) pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection
  ),
:where(
    :root:not(.dark) pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection
  ),
:where(
    :root:not(.dark) pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection
  ),
:where(
    :root:not(.dark) pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection
  ) {
  background-color: hsla(135, 73%, 55%, 0.25);
}

:where(:root:not(.dark) pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection),
:where(:root:not(.dark) pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection),
:where(:root:not(.dark) pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection),
:where(:root:not(.dark) pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection) {
  background-color: hsla(135, 73%, 55%, 0.25);
}

/* Previewers plugin overrides */
/* Based on https://github.com/atom-community/atom-ide-datatip/blob/master/styles/atom-ide-datatips.less and https://github.com/atom/atom/blob/master/packages/one-light-ui */
/* Border around popup */
:where(:root:not(.dark) .prism-previewer.prism-previewer:befor)e,
:where(:root:not(.dark) .prism-previewer-gradient.prism-previewer-gradient div) {
  border-color: hsl(0, 0, 95%);
}

/* Angle and time should remain as circles and are hence not included */
:where(:root:not(.dark) .prism-previewer-color.prism-previewer-color:befor)e,
:where(:root:not(.dark) .prism-previewer-gradient.prism-previewer-gradient di)v,
:where(:root:not(.dark) .prism-previewer-easing.prism-previewer-easing:before) {
  border-radius: 0.3em;
}

/* Triangles pointing to the code */
:where(:root:not(.dark) .prism-previewer.prism-previewer:after) {
  border-top-color: hsl(0, 0, 95%);
}

:where(:root:not(.dark) .prism-previewer-flipped.prism-previewer-flipped.after) {
  border-bottom-color: hsl(0, 0, 95%);
}

/* Background colour within the popup */
:where(:root:not(.dark) .prism-previewer-angle.prism-previewer-angle:befor)e,
:where(:root:not(.dark) .prism-previewer-time.prism-previewer-time:befor)e,
:where(:root:not(.dark) .prism-previewer-easing.prism-previewer-easing) {
  background: hsl(0, 0%, 100%);
}

/* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */
/* For time, this is the alternate colour */
:where(:root:not(.dark) .prism-previewer-angle.prism-previewer-angle circl)e,
:where(:root:not(.dark) .prism-previewer-time.prism-previewer-time circle) {
  stroke: hsl(230, 8%, 24%);
  stroke-opacity: 1;
}

/* Stroke colours of the handle, direction point, and vector itself */
:where(:root:not(.dark) .prism-previewer-easing.prism-previewer-easing circl)e,
:where(:root:not(.dark) .prism-previewer-easing.prism-previewer-easing pat)h,
:where(:root:not(.dark) .prism-previewer-easing.prism-previewer-easing line) {
  stroke: hsl(230, 8%, 24%);
}

/* Fill colour of the handle */
:where(:root:not(.dark) .prism-previewer-easing.prism-previewer-easing circle) {
  fill: transparent;
}
