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

.docs-home {
  code.prism-code {
    font-size: inherit;
  }

  pre.prism-code {
    display: flex;
    flex-direction: column;
  }
}

code[class*='language-'],
pre[class*='language-'] {
  background: var(--amplify-colors-background-secondary);
  color: var(--amplify-colors-font-secondary);
  padding: 0;
}

/* Selection */
code[class*='language-']::-moz-selection,
code[class*='language-'] *::-moz-selection,
pre[class*='language-'] *::-moz-selection {
  background: var(--amplify-colors-overlay-10);
  color: inherit;
}

code[class*='language-']::selection,
code[class*='language-'] *::selection,
pre[class*='language-'] *::selection {
  background: var(--amplify-colors-overlay-10);
  color: inherit;
}

/* Code blocks */
pre[class*='language-'] {
  padding: var(--amplify-space-medium);
  overflow: auto;
  border-radius: 0;
  // 👇 this is important to get line highlights working when there is horizontal scroll
  display: flex;
  text-size-adjust: 100%;
}

// 👇 this is also important for the above reason
code[class*='language-'] {
  flex-grow: 2;
}

pre.language-shell code.language-shell::before {
  content: '$ ';
}
.language-shell {
  .token.function {
    color: inherit;
  }
}

section > pre[class*='language-'] {
  margin-bottom: var(--amplify-space-medium);
}

.token.keyword,
.token.module {
  color: var(--amplify-colors-purple-80);
}

.token.comment,
.token.prolog,
.token.cdata {
  color: var(--amplify-colors-font-tertiary);
}

// .token.keyword,
.token.imports {
  color: var(--amplify-colors-teal-80);
}

.token.property,
.token.tag,
.token.symbol,
.token.deleted,
.token.important {
  color: var(--amplify-colors-red-80);
}

.token.selector,
.token.string,
.token.char,
.token.builtin,
.token.inserted,
.token.regex,
.token.attr-value,
.token.attr-value > .token.punctuation {
  color: var(--amplify-colors-green-80);
}

.token.variable,
.token.function {
  color: var(--amplify-colors-pink-80);
}

.token.operator {
  color: var(--amplify-colors-green-80);
}

.token.url {
  color: var(--amplify-colors-pink-80);
}

.token.maybe-class-name {
  color: var(--amplify-colors-pink-80);
}

/* HTML overrides */
.token.attr-value > .token.punctuation.attr-equals,
.token.special-attr > .token.attr-value > .token.value.css {
  color: var(--amplify-colors-teal-80);
}

/* CSS overrides */
.language-css {
  & .token.selector {
    color: var(--amplify-colors-purple-80);
  }

  & .token.property {
    color: var(--amplify-colors-teal-80);
  }

  & .token.function,
  & .token.url > .token.function {
    color: var(--amplify-colors-teal-80);
  }

  & .token.url > .token.string.url {
    color: var(--amplify-colors-green-80);
  }

  & .token.important,
  & .token.atrule .token.rule {
    color: var(--amplify-colors-pink-80);
  }
}

.language-javascript
  .token.template-string
  > .token.interpolation
  > .token.interpolation-punctuation.punctuation {
  color: var(--amplify-colors-red-80);
}

/* JSON overrides */
.language-json .token.operator {
  color: var(--amplify-colors-font-secondary);
}

.language-json .token.null.keyword {
  color: var(--amplify-colors-orange-80);
}

/* MD overrides */
.language-markdown .token.url,
.language-markdown .token.url > .token.operator,
.language-markdown .token.url-reference.url > .token.string {
  color: var(--amplify-colors-font-secondary);
}

.language-markdown .token.url > .token.content {
  color: var(--amplify-colors-blue-80);
}

.language-markdown .token.url > .token.url,
.language-markdown .token.url-reference.url {
  color: var(--amplify-colors-teal-90);
}

.language-markdown .token.blockquote.punctuation,
.language-markdown .token.hr.punctuation {
  color: var(--amplify-colors-font-secondary);
  font-style: italic;
}

.language-markdown .token.code-snippet {
  color: var(--amplify-colors-green-80);
}

.language-markdown .token.bold .token.content {
  color: var(--amplify-colors-orange-80);
}

.language-markdown .token.italic .token.content {
  color: var(--amplify-colors-pink-80);
}

.language-markdown .token.strike .token.content,
.language-markdown .token.strike .token.punctuation,
.language-markdown .token.list.punctuation,
.language-markdown .token.title.important > .token.punctuation {
  color: var(--amplify-colors-red-90);
}

/* General */
.token.bold {
  font-weight: bold;
}

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

.token.entity {
  cursor: help;
}

.token.namespace {
  opacity: 0.8;
}

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

/* Show Invisibles plugin overrides */
.token.token.tab:not(:empty):before,
.token.token.cr:before,
.token.token.lf:before,
.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 */
div.code-toolbar > .toolbar.toolbar > .toolbar-item {
  margin-right: 0.4em;
}

/* Styling the buttons */
div.code-toolbar > .toolbar.toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > a,
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;
}

div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus,
div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover,
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 */
.line-highlight.line-highlight {
  background: hsla(230, 8%, 24%, 0.05);
}

/* Default line numbers in Line Highlight plugin */
.line-highlight.line-highlight:before,
.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 */
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 */
.line-numbers.line-numbers .line-numbers-rows,
.command-line .command-line-prompt {
  border-right-color: hsla(230, 8%, 24%, 0.2);
}

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

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

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

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

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

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

pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection,
pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection,
pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection,
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 */
.prism-previewer.prism-previewer:before,
.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 */
.prism-previewer-color.prism-previewer-color:before,
.prism-previewer-gradient.prism-previewer-gradient div,
.prism-previewer-easing.prism-previewer-easing:before {
  border-radius: 0.3em;
}

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

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

/* Background colour within the popup */
.prism-previewer-angle.prism-previewer-angle:before,
.prism-previewer-time.prism-previewer-time:before,
.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 */
.prism-previewer-angle.prism-previewer-angle circle,
.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 */
.prism-previewer-easing.prism-previewer-easing circle,
.prism-previewer-easing.prism-previewer-easing path,
.prism-previewer-easing.prism-previewer-easing line {
  stroke: hsl(230, 8%, 24%);
}

/* Fill colour of the handle */
.prism-previewer-easing.prism-previewer-easing circle {
  fill: transparent;
}

.token.doctype,
.token.punctuation,
.token.entity {
  color: var(--amplify-colors-font-secondary);
}

.token.class-name {
  color: var(--amplify-colors-pink-80);
}

.token.boolean,
.token.constant,
.token.number,
.token.atrule,
.token.unit {
  color: var(--amplify-colors-blue-80);
}

.token.attr-name {
  color: var(--amplify-colors-blue-80);
}

.token.boolean {
  color: var(--amplify-colors-teal-80);
}

.token.color {
  color: var(--amplify-colors-teal-80);
}

.sp-tab-button[data-active='true'] {
  border-bottom-width: 2px;
}

.sp-tabs {
  border-color: var(--amplify-colors-border-secondary);
}

.sp-code-editor {
  background: var(--amplify-colors-background-primary);
}

.cm-activeLine.cm-line {
  background-color: var(--amplify-colors-background-secondary);
}

.sp-layout {
  border: none;
}

.cm-editor {
  background-color: var(--amplify-colors-background-primary);
}

.sp-code-editor .cm-gutters {
  background-color: var(--amplify-colors-background-primary);
  color: var(--amplify-colors-font-secondary);
}

.mdx-marker {
  margin-left: calc(var(--amplify-space-medium) * -1);
  margin-right: calc(var(--amplify-space-medium) * -1);
  padding-left: var(--amplify-space-medium);
  background-color: hsla(190, 95%, 50%, 0.125);
}

.snack-player {
  overflow: hidden;
  background: var(--amplify-colors-background-secondary);
  border: 1px solid var(--amplify-colors-border-secondary);
  border-radius: var(--amplify-radii-small);
  height: 600px;
  width: 100%;
}
