/* Éditeur de texte enrichi — fichier séparé de admin.css */

.rich-editor {
  border: 1.5px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--admin-shadow);
}

.rich-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--admin-border);
  background: linear-gradient(180deg, #fffdf9 0%, #fff9f1 100%);
}

.rich-editor__group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.rich-editor__group + .rich-editor__group {
  padding-left: 0.85rem;
  border-left: 1px solid var(--admin-border);
}

.rich-editor__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  margin-right: 0.15rem;
}

.rich-editor__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  border: 1.5px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--admin-heading);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.rich-editor__btn:hover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
  color: var(--admin-heading);
}

.rich-editor__btn.is-active {
  border-color: var(--admin-accent);
  background: var(--admin-accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(243, 189, 12, 0.28);
}

.rich-editor__btn.is-active:hover {
  background: var(--admin-accent-hover);
  border-color: var(--admin-accent-hover);
  color: #ffffff;
}

.rich-editor__btn--text {
  min-width: 0;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.rich-editor__u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-editor__swatches {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.rich-editor__swatch {
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 2px solid rgba(52, 58, 64, 0.12);
  border-radius: 999px;
  background: var(--swatch, #343a40);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.rich-editor__swatch:hover {
  transform: scale(1.08);
  border-color: var(--admin-accent);
  box-shadow: 0 2px 8px rgba(52, 58, 64, 0.12);
}

.rich-editor__swatch:focus-visible {
  outline: 2px solid var(--admin-accent);
  outline-offset: 2px;
}

.rich-editor__swatch.is-default {
  background: #ffffff;
  border-color: var(--admin-border);
}

.rich-editor__swatch-reset {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--admin-heading);
  line-height: 1;
}

.rich-editor__sizes {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.rich-editor__size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid var(--admin-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--admin-heading);
  font-family: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.rich-editor__size:hover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.rich-editor__size:focus-visible {
  outline: 2px solid rgba(243, 189, 12, 0.45);
  outline-offset: 1px;
}

.rich-editor__body {
  min-height: 110px;
  padding: 0.85rem 1rem;
  line-height: 1.7;
  color: var(--admin-heading);
  outline: none;
  background: #ffffff;
}

.rich-editor__body:focus {
  box-shadow: inset 0 0 0 2px rgba(243, 189, 12, 0.28);
}

.rich-editor__hint {
  margin: 0;
  padding: 0.45rem 1rem 0.65rem;
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  background: #ffffff;
  border-top: 1px dashed var(--admin-border);
}

#btn-undo:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.custom-icons-editor {
  display: grid;
  gap: 0.65rem;
}

.custom-icon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg);
}

.custom-icon-row__img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.custom-icon-row input[type="text"] {
  flex: 1 1 180px;
}

.feature-editor + .feature-editor,
.engagement-editor + .engagement-editor {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--admin-border);
}

@media (max-width: 640px) {
  .rich-editor__group + .rich-editor__group {
    padding-left: 0;
    border-left: none;
  }

  .rich-editor__toolbar {
    gap: 0.55rem;
  }
}
