/* da_cms.manual_cms — Tiptap markdown editor styles.
 *
 * Hand-written, not generated. Loaded by the TiptapMarkdownWidget Media class
 * in the admin and by the public document template at the visitor URL. The
 * `.tiptap-readonly-editor` modifier suppresses editor chrome (toolbar, focus
 * indicators) so the same bundle can serve as the public renderer with no
 * second stylesheet.
 */

.tiptap-markdown-widget {
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tiptap-markdown-widget .tiptap-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #e6e6e6;
  background: #f6f6f6;
  position: sticky;
  top: 70px;
  z-index: 50;
}

.tiptap-toolbar-btn {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.tiptap-toolbar-btn:hover {
  background: #e8e8e8;
  border-color: #bbb;
}

.tiptap-toolbar-btn.is-active {
  background: #2e77d0;
  color: #fff;
  border-color: #2566b8;
}

.tiptap-toolbar-separator {
  display: inline-block;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: #d0d0d0;
}

.tiptap-markdown-widget .tiptap-editor-container {
  min-height: 240px;
  padding: 12px 16px;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror {
  outline: none;
  min-height: 220px;
  font-size: 15px;
  line-height: 1.55;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror p {
  margin: 0 0 0.75em 0;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror h1,
.tiptap-markdown-widget .tiptap-editor-container .ProseMirror h2,
.tiptap-markdown-widget .tiptap-editor-container .ProseMirror h3 {
  margin: 1em 0 0.4em 0;
  font-weight: 600;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror h1 {
  background: var(--w-color-primary, #2e1f5e);
  color: #ffffff;
  padding: 0.3em 0.5em;
  border-radius: 3px;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror code {
  background: #f1f1f1;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.92em;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror pre {
  background: #1e1e1e;
  color: #f4f4f4;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror table {
  border-collapse: collapse;
  margin: 1em 0;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror th,
.tiptap-markdown-widget .tiptap-editor-container .ProseMirror td {
  border: 1px solid #cccccc;
  padding: 6px 10px;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror blockquote {
  border-left: 4px solid #d9d9d9;
  margin: 1em 0;
  padding: 0.2em 1em;
  color: #555555;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror ul,
.tiptap-markdown-widget .tiptap-editor-container .ProseMirror ol {
  padding-left: 1.5em;
  margin: 0.5em 0 0.75em;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror ul {
  list-style: disc outside;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror ol {
  list-style: decimal outside;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror ul > li {
  list-style-type: disc;
  margin: 0.15em 0;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror ol > li {
  list-style-type: decimal;
  margin: 0.15em 0;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror li > p {
  margin: 0;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror a {
  color: #2e77d0;
  text-decoration: underline;
  cursor: pointer;
}

.tiptap-markdown-widget .tiptap-editor-container .ProseMirror .selectedCell {
  background: #d7e8fc;
}

/* Read-only viewer mode (admin document_view, admin preview, public page).
 * The toolbar is hidden and the editor frame loses its border so the body
 * blends into the surrounding page chrome. */
.tiptap-readonly-editor {
  border: none;
  background: transparent;
}

.tiptap-readonly-editor .tiptap-toolbar {
  display: none;
}

.tiptap-readonly-editor .tiptap-editor-container {
  padding: 0;
  min-height: 0;
}

.tiptap-readonly-editor .ProseMirror {
  min-height: 0;
}
