/* Cosmos.Common.AspNetCore.Blazor.RichTextEdit — editor + viewer styles.

   Two consumers:
     1. The Toast UI Editor inside <RichTextEdit> — overrides Toast UI defaults
        so the editor inherits the host application's typography.
     2. The read-only <RichTextView> renderer — mirrors editor typography so the
        view and edit experience are visually identical. */

/* ------------------------------------------------------------------------
   1. Editor — content area inherits host typography
   ------------------------------------------------------------------------ */
.toastui-editor-contents,
.toastui-editor-contents p,
.toastui-editor-contents h1,
.toastui-editor-contents h2,
.toastui-editor-contents h3,
.toastui-editor-contents h4,
.toastui-editor-contents ul,
.toastui-editor-contents ol,
.toastui-editor-contents li,
.toastui-editor-contents blockquote {
  font-family: inherit;
  font-size:   inherit;
  line-height: inherit;
  color:       inherit;
}

.toastui-editor-contents h1 { font-size: 2.00em; }
.toastui-editor-contents h2 { font-size: 1.50em; }
.toastui-editor-contents h3 { font-size: 1.17em; }

.toastui-editor-contents code,
.toastui-editor-contents pre,
.toastui-editor-contents pre code {
  font-family: var(--bs-font-monospace, ui-monospace, "JetBrains Mono",
               Consolas, Menlo, monospace);
  font-size: 0.92em;
}

.toastui-editor-contents img {
  max-width: 100%;
  height: auto;
}

.toastui-editor-md-container .ProseMirror,
.toastui-editor-md-container .CodeMirror {
  font-family: var(--bs-font-monospace, ui-monospace, Consolas, Menlo, monospace);
}

/* Disabled-mode hint. Toast UI 3.x has no first-class disable; we toggle a class
   on the host element and set contenteditable=false on the inner ProseMirror. */
.rich-text-edit-disabled {
  opacity: 0.85;
}
.rich-text-edit-disabled .toastui-editor-toolbar {
  pointer-events: none;
  opacity: 0.5;
}

/* ------------------------------------------------------------------------
   2. RichTextView — read-only renderer used by badges, lists, public views
   ------------------------------------------------------------------------ */
.rich-text-view {
  font-family: inherit;
  font-size:   inherit;
  line-height: inherit;
  color:       inherit;
}

.rich-text-view h1 { font-size: 2.00em; }
.rich-text-view h2 { font-size: 1.50em; }
.rich-text-view h3 { font-size: 1.17em; }
.rich-text-view p  { margin: 0 0 0.5rem 0; }
.rich-text-view ul,
.rich-text-view ol { margin: 0 0 0.5rem 1.25rem; padding: 0; }

.rich-text-view code,
.rich-text-view pre,
.rich-text-view pre code {
  font-family: var(--bs-font-monospace, ui-monospace, "JetBrains Mono",
               Consolas, Menlo, monospace);
  font-size: 0.92em;
}

.rich-text-view img { max-width: 100%; height: auto; }

.rich-text-view table { border-collapse: collapse; margin: 0 0 0.5rem 0; }
.rich-text-view table td,
.rich-text-view table th {
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0.25rem 0.5rem;
}
