.orgmode-view {
  font-size: var(--font-text-size);
}
.orgmode-view div.cm-line {
  font-family: var(--font-text);
}

.cm-line:has(.org-heading) {
  font-size: 1.05em;
}

.cm-line:has(.org-planning),
.cm-line:has(.org-propertydrawer) {
  font-size: 0.95em;
}

.theme-dark .org-heading,
.theme-dark .cm-line:has(.org-heading) > .org-section {
  color: #2fbd23;
}

.theme-dark .org-planning {
  color: #bb8210;
}

.theme-dark .org-propertydrawer {
  color: #aa944f;
}

.theme-dark .org-section {
  color: #b9cddb;
}

.theme-dark .org-comment {
  color: #a68fa7;
}

.theme-dark .org-keyword {
  color: #bb0f0f;
}

.theme-dark .org-priority {
  color: #058fc7;
}

.theme-dark .org-tags {
  color: #02ffc7;
}

.theme-dark .org-text-bold {
  font-weight: 600;
}
.theme-dark .org-text-italic {
  font-style: italic;
}
.theme-dark .org-text-underline {
  text-decoration: underline;
}
.theme-dark .org-text-verbatim {
  background-color: black;
}
.theme-dark .org-text-code {
  background-color: black;
}
.theme-dark .org-text-strikethrough {
  text-decoration: line-through;
}






.theme-light .org-heading,
.theme-light .cm-line:has(.org-heading) > .org-section {
  color: #2f8925;
}

.theme-light .org-planning {
  color: #895f0a;
}

.theme-light .org-propertydrawer {
  color: #705f2c;
}

.theme-light .org-section {
  color: rgb(58, 69, 74);
}

.theme-light .org-comment {
  color: #a68fa7;
}

.theme-light .org-keyword {
  color: #931212;
}

.theme-light .org-priority {
  color: #197aa0;
}

.theme-light .org-tags {
  color: #1d9077;
}

.theme-light .org-text-bold {
  font-weight: 600;
}
.theme-light .org-text-italic {
  font-style: italic;
}
.theme-light .org-text-underline {
  text-decoration: underline;
}
.theme-light .org-text-verbatim {
  background-color: white;
}
.theme-light .org-text-code {
  background-color: white;
}
.theme-light .org-text-strikethrough {
  text-decoration: line-through;
}


.orgmode-view .cm-vimMode .cm-line ::selection {
  background-color: var(--text-selection) !important;
}
.orgmode-view .cm-line.cm-line {
  caret-color: var(--caret-color) !important;
}

.theme-dark .orgmode-view .cm-fat-cursor {
  background-color: var(--text-accent) !important;
}
.theme-dark .orgmode-view:not(.cm-focused) .cm-fat-cursor {
  background-color: unset !important;
  outline-color: var(--text-accent) !important;
}
.theme-dark .orgmode-view .cm-selectionBackground {
  background-color: var(--text-selection) !important;
}
.theme-dark .cm-editor .cm-cursor {
  border-left-color: white; /* caret-color */
}

.theme-light .orgmode-view .cm-fat-cursor {
  background-color: var(--text-accent) !important;
}
.theme-light .orgmode-view:not(.cm-focused) .cm-fat-cursor {
  background-color: unset !important;
  outline-color: var(--text-accent) !important;
}
.theme-light .orgmode-view .cm-selectionBackground {
  background-color: var(--text-selection) !important;
}
.theme-light .cm-editor .cm-cursor {
  border-left-color: black; /* caret-color */
}

.orgmode-view.cm-focused {
  outline: unset;
}

.orgmode-view .cm-foldPlaceholder {
  color: var(--text-faint);
  background-color: transparent;
  border: none;
  margin-left: 8px;
  user-select: none;
}

.orgmode-view .org-link,
.orgmode-view .org-link .org-section {
  color: var(--link-color);
}

.theme-dark .orgmode-view .org-block {
  background-color: var(--code-background);
  font-family: var(--font-monospace);
}

.theme-light .orgmode-view .org-block {
  background-color: var(--code-background);
  font-family: var(--font-monospace);
}

.orgmode-view .org-block-header {
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  padding: var(--size-4-1) var(--size-4-2);
  position: relative;
  top: -0.2em;
}

/*
 * Adapt @codemirror/autocomplete CSS to obsidian style
 */
.orgmode-view .cm-tooltip {
  background-color: var(--background-primary);
}
.orgmode-view .cm-tooltip.cm-tooltip-autocomplete > ul {
  font-family: unset; /* no monospace */
}
.orgmode-view .cm-tooltip.cm-tooltip-autocomplete > ul > li {
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  font-size: var(--font-ui-medium);
  margin-bottom: 0.4em;
}
.orgmode-view .cm-tooltip-autocomplete ul li[aria-selected] {
  background-color: var(--background-modifier-hover);
  color: var(--text-normal);
}
.orgmode-view .cm-completionDetail {
  display: block;
  margin-left: 1.4em; /* align with the width of .cm-completionIcon */
  color: var(--text-muted);
  font-size: 0.8em;
  font-style: unset; /* no italic */
}
