/*
 * A note's content (§8.4): headings, lists, checklists, tables, code, images,
 * recordings and embeds. Shared by the editor (with app.css) and the Super
 * Admin Note Viewer (§14.8), so a note reads the same in both.
 * Unstyled text takes the user's default font and size (§8.2) where it is set.
 */

/* It fills the editor's body, so a click below the text still edits; "Linked from" sits under it. */
.note-prose { flex: 1 0 auto; font-family: var(--note-font, inherit); font-size: var(--note-size, inherit); outline: none; tab-size: 4; }

/* Tabs and runs of spaces show as typed (§23 #112); the editor's own rule does this there. */
.note-prose:not(.ProseMirror) { white-space: pre-wrap; }

.note-prose > :first-child { margin-top: 0; }

.note-prose h1 { margin: 1.1em 0 .4em; font-size: 1.9em; line-height: 1.25; }

.note-prose h2 { margin: 1em 0 .4em; font-size: 1.5em; line-height: 1.3; }

.note-prose h3 { margin: 1em 0 .4em; font-size: 1.25em; line-height: 1.35; }

.note-prose h4 { margin: 1em 0 .3em; font-size: 1.1em; }

.note-prose h5 { margin: 1em 0 .3em; font-size: 1em; text-transform: uppercase; letter-spacing: .03em; }

.note-prose ul, .note-prose ol, .note-prose blockquote, .note-prose pre, .note-prose table { margin: 0 0 .75em; }

/* Enter starts a paragraph on the very next line (§8.1); a user can ask for a gap after each (§23 #97). */
.note-prose p { margin: 0; }

[data-paragraph-spacing] .note-prose p { margin: 0 0 .75em; }

.note-prose li > p { margin: 0; }

.note-prose ul, .note-prose ol { padding-left: 1.6em; }

.note-prose a { color: var(--accent-text); }

/* Note links and topic chips (§8.8, §8.9). */
.note-prose .note-link { padding: 0 2px; color: var(--accent-text); text-decoration: none; background: var(--list-selected); border-radius: 4px; cursor: pointer; }

.note-prose .note-link.is-unavailable { color: var(--text-muted); text-decoration: line-through; cursor: default; }

/* A chip is shown only while the note has the topic; otherwise it reads as plain #text. */
.note-prose .topic-mention.is-active { padding: 0 6px; color: var(--accent-text); font-weight: 600; background: var(--list-selected); border-radius: var(--radius-pill); }

.note-prose blockquote { margin-left: 4px; padding-left: 12px; color: var(--text-muted); border-left: 3px solid var(--border); }

.note-prose code { padding: 1px 4px; font-family: "Source Code Pro", "Courier New", monospace; font-size: .9em; background: var(--list-selected); border-radius: 4px; }

.note-prose pre { padding: 10px 12px; overflow-x: auto; background: var(--list-selected); border-radius: var(--radius); }

.note-prose pre code { padding: 0; background: none; }

.note-prose hr { margin: 1.25em 0; border: 0; border-top: 1px solid var(--border); }

/* Highlight colors are light in both themes, so the text on them stays dark. */
.note-prose mark { padding: 0 1px; color: #1f1f1f !important; border-radius: 2px; }

.note-prose ul[data-type="taskList"] { padding-left: 2px; list-style: none; }

/* The editor's task items carry data-checked but not data-type. */
.note-prose ul[data-type="taskList"] > li { display: flex; gap: 8px; align-items: flex-start; }

.note-prose ul[data-type="taskList"] > li > label { flex: none; margin-top: .3em; user-select: none; }

.note-prose ul[data-type="taskList"] > li > label input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }

.note-prose ul[data-type="taskList"] > li > div { flex: 1; min-width: 0; }

.note-prose ul[data-type="taskList"] > li[data-checked="true"] > div { color: var(--text-muted); text-decoration: line-through; }

.note-prose .tableWrapper { margin: 0 0 .75em; overflow-x: auto; }

.note-prose table { width: 100%; table-layout: fixed; border-collapse: collapse; }

.note-prose th, .note-prose td { position: relative; min-width: 60px; padding: 6px 8px; text-align: left; vertical-align: top; border: 1px solid var(--border); }

.note-prose th { font-weight: 600; background: var(--list-selected); }

.note-prose th > p, .note-prose td > p { margin: 0; }

.note-prose img, .note-prose video { display: block; max-width: 100%; height: auto; margin: 0 0 .75em; border-radius: 4px; }

.note-prose audio { display: block; width: 100%; max-width: 480px; margin: 0 0 .75em; }

/* Images (§8.5, P4.7): aligned left (default), center or right. */
.note-prose img[data-align="center"] { margin-right: auto; margin-left: auto; }

.note-prose img[data-align="right"] { margin-left: auto; }

.note-prose div[data-youtube-video], .note-prose div[data-vimeo-video] { margin: 0 0 .75em; }

.note-prose div[data-youtube-video] iframe, .note-prose div[data-vimeo-video] iframe { display: block; width: 100%; max-width: 640px; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; }

/* Code highlighting (lowlight / highlight.js classes), readable in both themes. */
.note-prose .hljs-comment, .note-prose .hljs-quote { color: var(--code-comment); font-style: italic; }

.note-prose .hljs-keyword, .note-prose .hljs-selector-tag, .note-prose .hljs-built_in, .note-prose .hljs-meta { color: var(--code-keyword); }

.note-prose .hljs-string, .note-prose .hljs-regexp, .note-prose .hljs-addition { color: var(--code-string); }

.note-prose .hljs-number, .note-prose .hljs-literal, .note-prose .hljs-attr, .note-prose .hljs-attribute { color: var(--code-number); }

.note-prose .hljs-title, .note-prose .hljs-section, .note-prose .hljs-name, .note-prose .hljs-selector-class { color: var(--code-title); }

.note-prose .hljs-variable, .note-prose .hljs-template-variable, .note-prose .hljs-tag, .note-prose .hljs-deletion { color: var(--code-variable); }
