/* Rich text field (decisions 273, 281): the Tiptap editor in the v3 field look.
   Macro rich() in core/event/_event_fields.html, behaviour [data-ec-rich] in
   js/ec-behaviors.js. Tiptap runs with injectCSS off, so the few ProseMirror
   rules it needs are here too. Role tokens only. */

.lg-rich .lg-field__label { margin: 0; }   /* a <p>: no <input> to label */
.lg-rich__box {
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}
.lg-rich__box:focus-within { outline: var(--focus-ring) solid var(--focus); outline-offset: 2px; }

.lg-rich__bar {
  display: flex; flex-wrap: wrap; gap: var(--space-1);
  padding: var(--space-1);
  border-bottom: 1px solid var(--border);
}
.lg-rich__bar[hidden] { display: none; }
.lg-rich__tool {
  display: inline-grid; place-items: center;
  min-width: 2.75rem; min-height: 2.75rem;   /* 44px touch target */
  border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--text);
  cursor: pointer; touch-action: manipulation;
}
.lg-rich__tool:hover { background: var(--neutral-tint); }
.lg-rich__tool[aria-pressed="true"] { background: var(--primary-tint); color: var(--primary-ink); }
.lg-rich__tool:focus-visible { outline: var(--focus-ring) solid var(--focus); outline-offset: -2px; }

.lg-rich__editor { padding: var(--space-2) var(--space-3); }
.lg-rich__pm:focus, .lg-rich__pm:focus-visible { outline: none; }   /* the box shows the ring */
.lg-rich__pm { min-height: 8rem; font-size: var(--size-body); line-height: var(--leading-body); }
.lg-rich__pm > * + * { margin-top: var(--space-2); }
.lg-rich__pm ul, .lg-rich__pm ol { padding-inline-start: var(--space-5); }
.lg-rich__pm a { color: var(--primary); text-decoration: underline; }
@media (max-width: 39.99em) { .lg-rich__pm { font-size: 1rem; } }   /* no iOS zoom on focus */

/* ProseMirror basics (what Tiptap's injected CSS would add; .lg-rich__pm is the
   ProseMirror element; gap cursor and drop cursor are off). */
.lg-rich__pm { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces;
  font-variant-ligatures: none; font-feature-settings: "liga" 0; }
.lg-rich__pm [contenteditable="false"] { white-space: normal; }
.lg-rich__pm img[class~="ProseMirror-separator"] { display: inline; border: none; margin: 0; }
