/* ══════════════════════════════════════════════════════════════════
   NEXETH — nx-rich-editor.css  v3
══════════════════════════════════════════════════════════════════ */

.nre-wrap {
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  margin-top: 4px;
}

/* ── Toolbar ─────────────────────────────────────────────────────── */
.nre-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nre-toolbar--mini { gap: 3px; padding: 4px 6px; }

.nre-group { display: flex; align-items: center; gap: 1px; }
.nre-sep   { display: block; width: 1px; height: 20px; background: #ddd; margin: 0 3px; flex-shrink: 0; }

.nre-toolbar button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 5px;
  border: 1px solid transparent; border-radius: 3px;
  background: transparent; color: #333;
  font-size: .72rem; font-family: inherit;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .1s, border-color .1s, color .1s;
  position: relative;
}
.nre-toolbar button:hover { background: #e8e8e8; border-color: #ccc; }
.nre-toolbar button.active,
.nre-toolbar button:active { background: #ff6b00; color: #fff; border-color: #e05500; }

.nre-toolbar select {
  height: 26px; padding: 0 4px;
  border: 1px solid #ccc; border-radius: 3px;
  background: #fff; color: #333; font-size: .68rem; cursor: pointer; max-width: 96px;
}
.nre-toolbar select:focus { outline: none; border-color: #ff6b00; }

.nre-label-badge {
  font-size: .60rem; color: #888; font-weight: 600;
  letter-spacing: .02em; padding: 0 2px 0 3px; user-select: none;
}

/* ── Color picker ────────────────────────────────────────────────── */
.nre-color-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.nre-color-icon  { font-size: .85rem; font-weight: 900; border-bottom: 3px solid currentColor; line-height: 1; }
.nre-color-icon--bg { border-bottom: none; background: currentColor; padding: 0 3px; border-radius: 2px; }

/* ── Editor area ─────────────────────────────────────────────────── */
.nre-editor {
  min-height: 120px; max-height: 520px; overflow-y: auto;
  padding: 14px 16px; outline: none; font-family: inherit;
  word-break: break-word;
  /* Full editor: same reading size as the site body */
  font-size: 1rem; line-height: 1.6; color: #111;
}
.nre-editor:focus { box-shadow: inset 0 0 0 2px rgba(255,107,0,.22); }

/* ── WYSIWYG Preview Classes — spiegeln die echten Website-Styles ──
   Jedes Feld bekommt exakt die CSS-Werte wie im finalen Rendering.  */

/* Headline (= .pb-text h2): clamp(2.4rem, 6vw, 7rem) skaliert auf Dialog */
.nre-editor--mini,
.nre-preview-headline {
  min-height: 52px; max-height: 320px;
  font-size: clamp(1.6rem, 5.5vw, 3.2rem);
  line-height: .92;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 10px 14px;
}

/* Kicker (= .pb-kicker): klein, gespaced, uppercase */
.nre-preview-kicker {
  min-height: 34px; max-height: 120px;
  font-size: .68rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  font-weight: 500;
  color: #ff6b00;
  padding: 8px 14px;
}

/* Eyebrow / Hero-Eyebrow */
.nre-preview-eyebrow {
  min-height: 34px; max-height: 120px;
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 8px 14px;
}

/* Subtitle / Beschreibung */
.nre-preview-subtitle {
  min-height: 52px; max-height: 200px;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.85;
  font-weight: 400;
  padding: 10px 14px;
}

/* Body text / Fließtext */
.nre-preview-body {
  min-height: 120px; max-height: 480px;
  font-size: clamp(.9rem, 1.2vw, 1.05rem);
  line-height: 1.75;
  font-weight: 400;
  padding: 14px 16px;
}

/* Titel (Hero-Titel = riesig) */
.nre-preview-hero-title {
  min-height: 60px; max-height: 360px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: .9;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.01em;
  padding: 10px 14px;
}

/* Headings in editor — match site proportions */
.nre-editor h1 { font-size: 2.4em;  line-height: 1.05; margin: .5em 0 .3em; font-weight: 800; }
.nre-editor h2 { font-size: 1.8em;  line-height: 1.1;  margin: .5em 0 .3em; font-weight: 700; }
.nre-editor h3 { font-size: 1.35em; line-height: 1.15; margin: .4em 0 .25em; font-weight: 600; }
.nre-editor h4 { font-size: 1.1em;  line-height: 1.2;  margin: .35em 0 .2em; font-weight: 700; }
.nre-editor p  { margin: 0 0 .7em; }
.nre-editor ul, .nre-editor ol { padding-left: 1.4em; margin: .5em 0; }
.nre-editor li { margin: .25em 0; }
.nre-editor a  { color: #ff6b00; text-decoration: underline; }
.nre-editor hr { border: none; border-top: 1px solid #ddd; margin: 1em 0; }
.nre-editor strong, .nre-editor b { font-weight: 700; }
.nre-editor em,     .nre-editor i { font-style: italic; }
.nre-editor u  { text-decoration: underline; }
.nre-editor s  { text-decoration: line-through; }

/* ── Emoji picker ────────────────────────────────────────────────── */
.nre-emoji-picker {
  position: absolute; z-index: 9999;
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 6px; display: flex; flex-wrap: wrap;
  width: 260px; max-height: 200px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); gap: 2px;
}
.nre-emoji-btn {
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: 4px; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nre-emoji-btn:hover { background: #f5f5f5; }

/* ══════════════════════════════════════════════════════════════════
   Dark mode — inside CMS dialogs (project + lore builder)
══════════════════════════════════════════════════════════════════ */
.pbx-dialog .nre-wrap,
.lbx-dialog .nre-wrap { border-color: #444; }

.pbx-dialog .nre-toolbar,
.lbx-dialog .nre-toolbar { background: #252525; border-bottom-color: #383838; }

.pbx-dialog .nre-toolbar button,
.lbx-dialog .nre-toolbar button { color: #ccc; }
.pbx-dialog .nre-toolbar button:hover,
.lbx-dialog .nre-toolbar button:hover { background: #333; border-color: #555; }
.pbx-dialog .nre-toolbar button.active,
.lbx-dialog .nre-toolbar button.active { background: #ff6b00; color: #fff; border-color: #e05500; }

.pbx-dialog .nre-toolbar select,
.lbx-dialog .nre-toolbar select { background: #333; color: #ddd; border-color: #555; }
.pbx-dialog .nre-sep,
.lbx-dialog .nre-sep { background: #444; }
.pbx-dialog .nre-label-badge,
.lbx-dialog .nre-label-badge { color: #666; }

/* Dark editor — text preview */
.pbx-dialog .nre-editor,
.lbx-dialog .nre-editor { background: #141414; color: #f0f0f0; }

/* Mini headline in dark dialog — identisch zur Website */
.pbx-dialog .nre-editor--mini,
.lbx-dialog .nre-editor--mini {
  background: #0a0a0a;
  color: #fff;
  font-family: var(--nx-headline-font, inherit);
}

.pbx-dialog .nre-editor h1, .pbx-dialog .nre-editor h2,
.pbx-dialog .nre-editor h3, .pbx-dialog .nre-editor h4,
.lbx-dialog .nre-editor h1, .lbx-dialog .nre-editor h2,
.lbx-dialog .nre-editor h3, .lbx-dialog .nre-editor h4 { color: #fff; }

.pbx-dialog .nre-editor a,
.lbx-dialog .nre-editor a { color: #ff8c40; }
