/* ─── Trix Rich Text Editor Overlays (Tailwind theme) ─── */

/* Hide default Trix text labels — we use icons */
trix-toolbar .trix-button {
  font-size: 0;
  white-space: nowrap;
}
trix-toolbar .trix-button--icon {
  font-size: 0;
}
trix-toolbar .trix-button--icon::before {
  font-size: 0;
}

/* Compact toolbar */
trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem 0.5rem 0 0;
  background: #f9fafb;
}
trix-toolbar .trix-button-group {
  display: flex;
  gap: 0;
  border: none;
  margin: 0;
}
trix-toolbar .trix-button-group:not(:last-child) {
  margin-right: 6px;
}

trix-toolbar .trix-button {
  font-size: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  padding: 0;
  text-indent: -9999px;
  position: relative;
  margin: 0;
}
trix-toolbar .trix-button.trix-active {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}
trix-toolbar .trix-button:not(:disabled):hover {
  background: rgba(0, 0, 0, 0.05);
}
trix-toolbar .trix-button:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Icon background images (all trix icons) */
trix-toolbar .trix-button--icon::before {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  text-indent: 0;
  font-size: 0;
}

trix-toolbar .trix-button--icon-bold::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.522 19.242a.5.5 0 0 1-.5-.5V5.35a.5.5 0 0 1 .5-.5h5.783c1.347 0 2.46.345 3.24.982.783.64 1.216 1.562 1.216 2.683 0 1.13-.587 2.129-1.476 2.71a.35.35 0 0 0 .049.613c1.259.56 2.101 1.742 2.101 3.22 0 1.282-.483 2.334-1.363 3.063-.876.726-2.132 1.12-3.66 1.12h-5.89ZM9.27 7.347v3.362h1.97c.766 0 1.347-.17 1.733-.464.38-.291.587-.716.587-1.27 0-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0 5.606v3.791h2.389c.832 0 1.448-.177 1.853-.497.399-.315.614-.786.614-1.423 0-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-italic::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 5h6.5v2h-2.23l-2.31 10H13v2H6v-2h2.461l2.306-10H9V5Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-underline::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6 3v7.5A6.5 6.5 0 0 0 12.5 17H14v2H6v-2h6.5A4.5 4.5 0 0 1 8 11.5V3H6ZM4 21h16v2H4v-2Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-strike::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6 14.986c.088 2.647 2.246 4.258 5.635 4.258 3.496 0 5.713-1.728 5.713-4.463 0-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573 1.123 0 1.035-1.074 1.787-2.646 1.787-1.563 0-2.773-.762-2.91-1.924H6ZM6.432 10h3.763c-.632-.314-.914-.715-.914-1.273 0-1.045.977-1.739 2.432-1.739 1.475 0 2.52.723 2.617 1.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145 0-5.392 1.719-5.392 4.316 0 .363.04.703.12 1.02ZM4 11a1 1 0 1 0 0 2h15a1 1 0 1 0 0-2H4Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-link::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.948 5.258a4.337 4.337 0 0 0-6.108 0L11.217 6.87a.993.993 0 0 0 0 1.41c.392.39 1.027.39 1.418 0l1.623-1.613a2.323 2.323 0 0 1 3.271 0 2.29 2.29 0 0 1 0 3.251l-2.393 2.38a3.021 3.021 0 0 1-4.255 0l-.05-.049a1.007 1.007 0 0 0-1.418 0 .993.993 0 0 0 0 1.41l.05.049a5.036 5.036 0 0 0 7.091 0l2.394-2.38a4.275 4.275 0 0 0 0-6.072Zm-13.683 13.6a4.337 4.337 0 0 0 6.108 0l1.262-1.255a.993.993 0 0 0 0-1.41 1.007 1.007 0 0 0-1.418 0L9.954 17.45a2.323 2.323 0 0 1-3.27 0 2.29 2.29 0 0 1 0-3.251l2.344-2.331a2.579 2.579 0 0 1 3.631 0c.392.39 1.027.39 1.419 0a.993.993 0 0 0 0-1.41 4.593 4.593 0 0 0-6.468 0l-2.345 2.33a4.275 4.275 0 0 0 0 6.072Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-quote::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.581 8.471c.44-.5 1.056-.834 1.758-.995C8.074 7.17 9.201 7.822 10 8.752c1.354 1.578 1.33 3.555.394 5.277-.941 1.731-2.788 3.163-4.988 3.56a.622.622 0 0 1-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02 3.02 0 0 1-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419 0c.44-.5 1.055-.834 1.758-.995 1.734-.306 2.862.346 3.66 1.276 1.355 1.578 1.33 3.555.395 5.277-.941 1.731-2.789 3.163-4.988 3.56a.622.622 0 0 1-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02 3.02 0 0 1-1.672-2.701c0-.905.283-1.59.72-2.088Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-heading-1::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M21.5 7.5v-3h-12v3H14v13h3v-13h4.5ZM9 13.5h3.5v-3h-10v3H6v7h3v-7Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-code::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.293 11.293a1 1 0 0 0 0 1.414l4 4a1 1 0 1 0 1.414-1.414L5.414 12l3.293-3.293a1 1 0 0 0-1.414-1.414l-4 4Zm13.414 5.414 4-4a1 1 0 0 0 0-1.414l-4-4a1 1 0 1 0-1.414 1.414L18.586 12l-3.293 3.293a1 1 0 0 0 1.414 1.414Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-bullet-list::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5 7.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM8 6a1 1 0 0 1 1-1h11a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h11a1 1 0 1 0 0-2H9Zm0 6a1 1 0 1 0 0 2h11a1 1 0 1 0 0-2H9Zm-2.5-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM5 19.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-number-list::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3 4h2v4H4V5H3V4Zm5 2a1 1 0 0 1 1-1h11a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h11a1 1 0 1 0 0-2H9Zm0 6a1 1 0 1 0 0 2h11a1 1 0 1 0 0-2H9Zm-3.5-7H6v1l-1.5 2H6v1H3v-1l1.667-2H3v-1h2.5ZM3 17v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-undo::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3 14a1 1 0 0 0 1 1h6a1 1 0 1 0 0-2H6.257c2.247-2.764 5.151-3.668 7.579-3.264 2.589.432 4.739 2.356 5.174 5.405a1 1 0 0 0 1.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084 7.25 7.63 8.377 5 11.39V8a1 1 0 0 0-2 0v6Zm2-1Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-redo::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M21 14a1 1 0 0 1-1 1h-6a1 1 0 1 1 0-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739 2.356-5.174 5.405a1 1 0 0 1-1.98-.283c.564-3.95 3.415-6.526 6.826-7.095 3.08-.513 6.534.614 9.164 3.626V8a1 1 0 1 1 2 0v6Zm-2-1Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-decrease-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Zm4 5a1 1 0 1 0 0 2h9a1 1 0 1 0 0-2H9Zm-3 6a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2H6Zm-3.707-5.707a1 1 0 0 0 0 1.414l2 2a1 1 0 1 0 1.414-1.414L4.414 12l1.293-1.293a1 1 0 0 0-1.414-1.414l-2 2Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-increase-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M5 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Zm4 5a1 1 0 1 0 0 2h9a1 1 0 1 0 0-2H9Zm-3 6a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2H6Zm-2.293-2.293 2-2a1 1 0 0 0 0-1.414l-2-2a1 1 0 1 0-1.414 1.414L3.586 12l-1.293 1.293a1 1 0 1 0 1.414 1.414Z' fill='%23000'/%3E%3C/svg%3E");
}
trix-toolbar .trix-button--icon-attach::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 18V7.5c0-2.25 3-2.25 3 0V18c0 4.125-6 4.125-6 0V7.5c0-6.375 9-6.375 9 0V18' stroke='%23000' stroke-width='2' stroke-miterlimit='10' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Editor area */
trix-editor {
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 200px;
  max-height: 600px;
  outline: none;
  font-size: 0.875rem;
  line-height: 1.6;
}
trix-editor:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.5);
}
trix-editor[contenteditable="true"] {
  overflow-y: auto;
  resize: vertical;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Remove toolbar separator lines */
trix-toolbar .trix-button:not(:first-child) {
  border-left: none;
}
trix-toolbar .trix-button-group-spacer {
  display: none;
}
