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

/*
 * Dark mode for the Trix editor. Action Text ships a light-only stylesheet
 * (actiontext.css) whose toolbar icons are black SVG data URIs, so they have to
 * be inverted rather than recoloured. This file is loaded after actiontext.css
 * (alphabetical order in the :app bundle), so these rules win on source order.
 */
@media (prefers-color-scheme: dark) {
  trix-editor {
    background-color: #111827;
    color: #f3f4f6;
    border-color: #374151;
  }

  trix-editor:empty:not(:focus)::before {
    color: #9ca3af;
  }

  trix-toolbar .trix-button {
    background-color: transparent;
    color: #e5e7eb;
    border-bottom-color: #374151;
  }

  trix-toolbar .trix-button:not(:first-child) {
    border-left-color: #374151;
  }

  trix-toolbar .trix-button.trix-active {
    background-color: #1f2937;
    color: #f9fafb;
  }

  trix-toolbar .trix-button--icon::before {
    filter: invert(1);
  }

  trix-toolbar .trix-dialog {
    background-color: #111827;
    color: #f3f4f6;
    border-color: #374151;
    box-shadow: none;
  }

  trix-toolbar .trix-input--dialog {
    background-color: #1f2937;
    color: #f3f4f6;
    border-color: #4b5563;
  }
}
