/*
 * 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.
 */

/* Trix editor wrapper styling */
.trix-content-wrapper {
  overflow: visible;
  display: flex;
  flex-direction: column;
  background: white;
}

.trix-content-wrapper trix-toolbar {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.625rem 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.375rem 0.375rem 0 0;
  flex-shrink: 0;
}

.trix-content-wrapper trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-start;
  overflow: visible !important;
}

.trix-content-wrapper trix-toolbar .trix-button-group {
  display: flex;
  margin-bottom: 0;
  border: none;
  border-radius: 0.375rem;
  overflow: hidden;
}

.trix-content-wrapper trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 0.375rem;
}

.trix-content-wrapper trix-toolbar .trix-button {
  border: 1px solid #d1d5db;
  border-radius: 0;
  background-color: white;
  padding: 0.375rem;
  width: 2rem;
  height: 2rem;
}

.trix-content-wrapper trix-toolbar .trix-button:first-child {
  border-radius: 0.25rem 0 0 0.25rem;
}

.trix-content-wrapper trix-toolbar .trix-button:last-child {
  border-radius: 0 0.25rem 0.25rem 0;
}

.trix-content-wrapper trix-toolbar .trix-button:not(:first-child) {
  border-left: none;
}

.trix-content-wrapper trix-toolbar .trix-button:hover {
  background-color: #f3f4f6;
}

.trix-content-wrapper trix-toolbar .trix-button.trix-active {
  background-color: #dbeafe;
  border-color: #3b82f6;
}

.trix-content-wrapper trix-editor {
  border: none;
  padding: 1rem;
  min-height: 160px;
  flex: 1;
  overflow-y: auto;
}

.trix-content-wrapper trix-editor:focus {
  outline: none;
}

/* Hide spacer */
.trix-content-wrapper trix-toolbar .trix-button-group-spacer {
  display: none;
}

/* Position dialogs correctly */
.trix-content-wrapper trix-toolbar .trix-dialogs {
  position: relative;
  z-index: 10;
}

.trix-content-wrapper trix-toolbar .trix-dialog {
  position: absolute;
  top: 100%;
  margin-top: 0.5rem;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
}

/* Wikilink dropdown positioning */
.wikilink-dropdown {
  min-width: 200px;
}
