/* Rich text editor (TipTap) — compact WYSIWYG */

.rte-editor {
  border: 1px solid #2a3544;
  border-radius: 8px;
  overflow: hidden;
  background: #1a222d;
}

.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #2a3544;
  background: #121820;
}

.rte-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #e8edf4;
  font-size: 12px;
  font-family: system-ui, sans-serif;
  cursor: pointer;
}

.rte-btn:hover {
  background: #1a222d;
  border-color: #2a3544;
}

.rte-btn-active {
  background: rgba(201, 162, 39, 0.2);
  border-color: #c9a227;
  color: #c9a227;
}

.rte-divider {
  width: 1px;
  height: 20px;
  background: #2a3544;
  margin: 0 2px;
}

.rte-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #2a3544;
}

.rte-gallery-thumb {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #121820;
}

.rte-gallery-thumb:hover {
  border-color: #c9a227;
}

.rte-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rte-content {
  padding: 12px 14px;
  color: #e8edf4;
  font-size: 14px;
  line-height: 1.65;
  outline: none;
}

.rte-content p {
  margin: 0 0 0.75rem;
}

.rte-content p.is-editor-empty:first-child::before {
  color: #9aa8b8;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

.rte-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.rte-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.75rem 0 0.4rem;
}

.rte-content ul,
.rte-content ol {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
}

.rte-content li {
  margin-bottom: 0.25rem;
}

.rte-content a {
  color: #c9a227;
  text-decoration: underline;
}

.rte-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 0.5rem 0;
}

.cms-document-editor .rte-editor {
  margin-bottom: 8px;
}

.cms-document-editor {
  width: min(520px, calc(100vw - 48px));
}
