/* monokai pro theme port for obsidian */

.theme-light,
.theme-dark {
  --background-primary: #2d2a2e;
  --background-primary-alt: #232024;
  --background-secondary: #221f22;
  --background-secondary-alt: #19181a;
  --background-accent: #000;
  --background-modifier-border: #5b595c;
  --background-modifier-form-field: rgba(0, 0, 0, 0.5);
  --background-modifier-form-field-highlighted: rgba(0, 0, 0, 0.3);
  --background-modifier-box-shadow: rgba(0, 0, 0, 0.3);
  --background-modifier-success: #87d142;
  --background-modifier-error: #d14242;
  --background-modifier-error-rgb: 209, 66, 66;
  --background-modifier-error-hover: #d64a4a;
  --background-modifier-cover: rgba(0, 0, 0, 0.7);

  --text-accent: #ffdd75;
  --text-accent-hover: #ffe69d;
  --text-normal: #fcfcfa;
  --text-muted: #c5c5c5;
  --text-faint: #5b595c;
  --text-error: #ff6188;
  --text-error-hover: #ff619e;
  --text-highlight-bg: #676566;
  --text-selection: #676566;
  --text-on-accent: #19181a;

  --interactive-normal: #403e41;
  --interactive-hover: #48484a;
  --interactive-accent: #ffd866;
  --interactive-accent-rgb: 255, 216, 102;
  --interactive-accent-hover: #dfbe50;

  --scrollbar-active-thumb-bg: #676566;
  --scrollbar-bg: #232024;
  --scrollbar-thumb-bg: #5b595c;

  --panel-border-color: #19181a;

  --gray-1: #727072;
  --gray-2: #939293;
  --red: #ff6188;
  --orange: #fc9867;
  --yellow: #ffd866;
  --green: #a9dc76;
  --blue: #78dce8;
  --purple: #ab9df2;
}

body {
  -webkit-font-smoothing: auto;
}

.titlebar {
  background-color: var(--background-secondary-alt);
}

.titlebar-inner {
  color: var(--text-normal);
}

.tooltip {
  background-color: var(--background-secondary-alt);
  color: var(--text-muted);
}

.tooltip:not(.mod-right):not(.mod-left):not(.mod-top) .tooltip-arrow {
  border-bottom-color: var(--background-secondary-alt) !important;
}

.mod-right .tooltip-arrow {
  border-right-color: var(--background-secondary-alt) !important;
}

.mod-left .tooltip-arrow {
  border-left-color: var(--background-secondary-alt) !important;
}

.mod-top .tooltip-arrow {
  border-top-color: var(--background-secondary-alt) !important;
}

.dropdown {
  cursor: pointer;
  background-image: url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234c78cc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E);
}

.dropdown:hover {
  background-color: var(--background-modifier-form-field);
}

.search-result-file-title {
  color: var(--text-normal);
}

.search-result-file-title:hover {
  color: var(--yellow) !important;
}

li {
  padding-top: 0.5px;
  padding-bottom: 0.5px;
}

a.tag,
a.tag:hover {
  color: var(--green);
  background-color: var(--background-primary-alt);
  padding: 2px 4px;
  border-radius: 4px;
}

.tag-container .tag-pane-tag {
  padding-left: 10px;
}

.tag-container .tag-pane-tag:hover {
  color: var(--green);
}

.tag-pane-tag:hover .tag-pane-tag-count {
  background-color: var(--green);
}

.markdown-preview-view .task-list-item-checkbox {
  -webkit-appearance: none;
  box-sizing: border-box;
  border: 1px solid var(--text-muted);
  border-radius: 2px;
  position: relative;
  width: 1.3em;
  height: 1.3em;
  margin: 0;
  filter: none;
  outline: none;
  margin-right: 4px;
  margin-bottom: 2px;
  cursor: pointer;
  vertical-align: baseline;
}

.markdown-preview-view .task-list-item-checkbox:checked {
  border: none;
  background-color: var(--interactive-accent);
}

.markdown-preview-view .task-list-item-checkbox:checked::before {
  content: ' ';
  position: absolute;
  background-color: white;
  left: 2px;
  top: 2px;
  right: 2px;
  bottom: 2px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpolygon points='5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039'%3E%3C/polygon%3E%3C/svg%3E");
}

.markdown-preview-view .task-list-item.is-checked a {
  filter: saturate(0.8) brightness(0.7);
}

.cm-formatting-task {
  font-family: var(--font-monospace);
}

.nav-file-title,
.nav-folder-title {
  width: 100%;
  cursor: default;
  display: flex;
  align-items: baseline;
  flex-direction: row;
  --text-normal: var(--text-muted);
}

.nav-file-title {
  padding: 0.2em 10px;
}

body:not(.is-grabbing) .nav-file .nav-file-title:hover:not(.is-active),
body:not(.is-grabbing) .nav-folder .nav-folder-title:hover:not(.is-active) {
  --background-secondary-alt: transparent;
}

.nav-file .is-active {
  background-color: var(--background-secondary-alt);
  --text-normal: var(--orange);
}

.nav-file:hover {
  background-color: var(--background-secondary-alt) !important;
}

.nav-file:hover .nav-file-title {
  cursor: pointer !important;
}

.nav-file-title-content,
.nav-folder-title-content {
  text-indent: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: block;
}

.markdown-preview-view.is-readable-line-width .markdown-preview-section,
.markdown-source-view.is-readable-line-width .CodeMirror {
  max-width: 900px !important;
  line-height: 26px;
}

blockquote {
  margin: 20px 0;
  border-radius: 4px !important;
}

body {
  --font-monospace: 'JetBrains Mono', 'Source Code Pro', 'Consolas', monospace;
}

mjx-container[jax='CHTML'] {
  text-align: left;
  outline: none;
}

.math-block {
  font-size: 1.25em;
}

.cm-s-obsidian pre.HyperMD-codeblock,
.cm-s-obsidian span.cm-inline-code,
.cm-s-obsidian
  span.cm-math:not(.cm-formatting-math-begin):not(.cm-formatting-math-end),
.markdown-preview-view code {
  /* fix `` tag color */
  color: #98c379;
}

.cm-s-obsidian span.cm-inline-code,
.cm-s-obsidian span.cm-math,
.cm-s-obsidian span.hmd-fold-math-placeholder {
  /* fix tag size */
  font-weight: 100;
  font-style: normal;
}

.markdown-preview-view code {
  vertical-align: 0;
  word-break: break-word;
}

.markdown-preview-section:not(:first-child) h1,
.markdown-preview-section:not(:first-child) h2,
.markdown-preview-section:not(:first-child) h3,
.markdown-preview-section:not(:first-child) h4,
.markdown-preview-section:not(:first-child) h5,
.markdown-preview-section:not(:first-child) h6 {
  margin-top: 40px !important;
}

.markdown-preview-section h1,
.markdown-preview-section h2,
.markdown-preview-section h3,
.markdown-preview-section h4,
.markdown-preview-section h5,
.markdown-preview-section h6 {
  margin-top: 1.25em;
  line-height: 1.2;
}

.workspace-leaf.mod-active .view-header {
  border-bottom: 2px solid var(--orange);
}

.view-header-title {
  color: var(--orange) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
.view-header-title {
  font-weight: 600;
}

.workspace
  > .workspace-split
  > .workspace-leaf:first-of-type:last-of-type
  .view-header {
  border: none;
}

.status-bar,
.side-dock.mod-right,
.side-dock.mod-left {
  border-color: var(--panel-border-color);
  border-width: 1px;
}

.status-bar {
  --bar-vertical-padding: 4px;
  --bar-height: calc(22px + (var(--bar-vertical-padding) * 2));
  line-height: 20px;
  padding: 0 20px;
  height: var(--bar-height);
  max-height: var(--bar-height);
  min-height: var(--bar-height);
  overflow: hidden;
}

.status-bar-item {
  margin: auto 0;
}

.status-bar-item > * {
  padding-top: var(--bar-vertical-padding) !important;
  padding-bottom: var(--bar-vertical-padding) !important;
}

.side-dock-plugin-panel-inner {
  padding-left: 6px;
}

a,
.markdown-preview-view .internal-link {
  text-decoration: none;
}

a:hover,
.markdown-preview-view .internal-link:hover {
  text-decoration: underline;
}

.theme-dark :not(pre) > code[class*='language-'],
.theme-dark pre[class*='language-'] {
  background: var(--background-primary-alt);
}

.theme-light :not(pre) > code[class*='language-'],
.theme-light pre[class*='language-'] {
  background: var(--background-primary);
  box-shadow: inset 0 0 0 1px var(--background-primary-alt);
  border-radius: 4px;
}

.markdown-embed:not(.hover-popover .markdown-embed),
.file-embed {
  margin: 0;
  border-radius: 4px;
  margin: 0 !important;
  margin-inline-start: 30px !important;
  margin-inline-end: 30px !important;
}

.markdown-embed {
  border: 1px solid var(--background-modifier-border);
  border-left-width: 5px;
}

.markdown-embed .markdown-preview-view {
  padding: 0 20px;
}

.markdown-embed-link,
.file-embed-link {
  left: 8px;
  right: unset;
}

.theme-light .token.operator,
.theme-light .token.entity,
.theme-light .token.url,
.theme-light .language-css .token.string,
.theme-light .style .token.string {
  background: transparent;
}

/* Source: https://github.com/AGMStudio/prism-theme-one-dark */

code[class*='language-'],
pre[class*='language-'] {
  text-align: left !important;
  white-space: pre !important;
  word-spacing: normal !important;
  word-break: normal !important;
  word-wrap: normal !important;
  line-height: 1.5 !important;
  -moz-tab-size: 4 !important;
  -o-tab-size: 4 !important;
  tab-size: 4 !important;
  -webkit-hyphens: none !important;
  -moz-hyphens: none !important;
  -ms-hyphens: none !important;
  hyphens: none !important;
}

/* Code blocks */

pre[class*='language-'] {
  padding: 1em !important;
  margin: 0.5em 0 !important;
  overflow: auto !important;
}

/* Inline code */

:not(pre) > code[class*='language-'] {
  padding: 0.1em !important;
  border-radius: 0.3em !important;
  white-space: normal !important;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--gray-1) !important;
}

.token.punctuation {
  color: var(--gray-2) !important;
}

.token.selector,
.token.tag {
  color: var(--red) !important;
}

.token.property,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.attr-name,
.token.deleted {
  color: var(--orange) !important;
}

.token.string,
.token.char,
.token.attr-value,
.token.builtin,
.token.inserted {
  color: var(--green) !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: var(--aqua) !important;
}

.token.atrule,
.token.keyword {
  color: var(--purple) !important;
}

.token.function,
.token.macro.property {
  color: var(--blue) !important;
}

.token.class-name {
  color: var(--yellow) !important;
}

.token.regex,
.token.important,
.token.variable {
  color: var(--purple) !important;
}

.token.important,
.token.bold {
  font-weight: bold !important;
}

.token.italic {
  font-style: italic !important;
}

.token.entity {
  cursor: help !important;
}

pre.line-numbers {
  position: relative !important;
  padding-left: 3.8em !important;
  counter-reset: linenumber !important;
}

pre.line-numbers > code {
  position: relative !important;
}

.line-numbers .line-numbers-rows {
  position: absolute !important;
  pointer-events: none !important;
  top: 0 !important;
  font-size: 100% !important;
  left: -3.8em !important;
  width: 3em !important;
  /* works for line-numbers below 1000 lines */
  letter-spacing: -1px !important;
  border-right: 0 !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

.line-numbers-rows > span {
  pointer-events: none !important;
  display: block !important;
  counter-increment: linenumber !important;
}

.line-numbers-rows > span:before {
  content: counter(linenumber) !important;
  color: var(--syntax-gray-1) !important;
  display: block !important;
  padding-right: 0.8em !important;
  text-align: right !important;
}

/* graph view coloring */
.graph-view.color-fill {
  color: var(--interactive-accent);
}

.graph-view.color-fill-focused,
.graph-view.color-fill-highlight {
  color: var(--orange) !important;
}

.graph-view.color-line-highlight {
  color: var(--text-muted);
}

.graph-view.color-fill-tag {
  color: var(--green) !important;
}
