/* Rich-text fields (templates/org/_richtext.html, static/modules/richtext.js) and rich text shown on pages. */
.rt-box { border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); }
.rt-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.rt-tb { min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2);
  font: 600 14px/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rt-tb:hover { background: var(--surface-3); color: var(--text); }
.rt-tb[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.rt-tb:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.rt-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rt-editor { min-height: 9em; max-height: 60vh; overflow-y: auto; padding: var(--s3); outline: none; color: var(--text);
  overflow-wrap: anywhere; }
.rt-editor.is-empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; display: block; }
.rt-editor.is-empty > p:first-child, .rt-editor.is-empty > br:first-child { display: none; }
.rt-field.rt-on .rt-hint-plain { display: none; }

/* rich text as shown (and inside the editor) */
.rich-text, .rt-editor { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.rich-text > :first-child, .rt-editor > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text p, .rich-text ul, .rich-text ol, .rich-text blockquote, .rich-text pre,
.rt-editor p, .rt-editor ul, .rt-editor ol, .rt-editor blockquote, .rt-editor pre { margin: 0 0 .65em; }
.rich-text h2, .rt-editor h2 { font: 650 18px/1.35 var(--font-display); margin: .9em 0 .35em; }
.rich-text h3, .rt-editor h3 { font: 650 16px/1.4 var(--font-display); margin: .8em 0 .3em; }
.rich-text h4, .rt-editor h4 { font: 650 15px/1.4 var(--font); margin: .7em 0 .3em; color: var(--text-2); }
.rich-text ul, .rich-text ol, .rt-editor ul, .rt-editor ol { padding-left: 1.4em; }
.rich-text li, .rt-editor li { margin: .1em 0; }
.rich-text blockquote, .rt-editor blockquote { border-left: 3px solid var(--lavender, var(--accent)); padding: .1em 0 .1em .9em; color: var(--text-2); }
.rich-text pre, .rt-editor pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s2);
  white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 var(--font-mono); }
.rich-text code, .rt-editor code { font: .9em var(--font-mono); background: var(--surface-3); padding: .1em .3em; border-radius: 4px; }
.rich-text a, .rt-editor a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.rich-text hr { border: 0; border-top: 1px solid var(--border-strong); margin: 1em 0; }
