/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Hide default trix toolbar visually but allow interaction via JS */
trix-toolbar {
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* 
 * Fallback styles for the custom rich text editor.
 * These ensure the editor looks perfect even if the Tailwind watcher
 * (bin/dev) is not running to compile the new classes.
 */

trix-editor {
  display: block !important;
  width: 100% !important;
  min-height: 250px !important;
  padding: 1rem 1.25rem !important;
  border: none !important;
  outline: none !important;
}

trix-editor:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Restore list styles that Tailwind CSS resets */
.trix-content ul {
  list-style-type: disc !important;
  padding-left: 1.5rem !important;
}

.trix-content ol {
  list-style-type: decimal !important;
  padding-left: 1.5rem !important;
}



/* Fallback for the custom toolbar wrapper */
[data-controller="rich-text"] > .flex {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  padding: 0.5rem !important;
  border-bottom: 1px solid #e5e7eb !important;
  background-color: #f9fafb !important;
  flex-wrap: wrap !important;
}

/* Fallback for the custom toolbar buttons */
[data-controller="rich-text"] > .flex > button {
  padding: 0.375rem !important;
  color: #6b7280 !important;
  border-radius: 0.375rem !important;
  transition: all 150ms ease !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
}

[data-controller="rich-text"] > .flex > button:hover {
  background-color: #f3f4f6 !important;
  color: #374151 !important;
}
