/*
 * Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
 * the trix-editor content (whether displayed or under editing). Feel free to incorporate this
 * inclusion directly in any other asset bundle and remove this file.
 *
 *= require trix
*/

/* Tailwind conflicts with Trix styles */
trix-editor {
  width: 100%;
  border: 1px solid var(--color-gray-300);;
  border-radius: 5px;
  padding: 12px;
}

trix-editor h1 {
  font-size: 1.25rem !important;
  line-height: 1.25rem !important;
  margin-bottom: 1rem;
  font-weight: 600;
}

trix-editor a:not(.no-underline) {
  text-decoration: underline;
}

trix-editor a:visited {
  color: green;
}

trix-editor ul,
trix-editor ol {
  padding-left: 1.5rem !important;
  margin-bottom: 1rem !important;
}

trix-editor ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
}

trix-editor ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
}

trix-editor li {
  display: list-item !important;
  margin-bottom: 0.25rem !important;
}

/* Ensure bullets show in displayed content as well - override Tailwind resets */
.trix-content ul,
.trix-content ol {
  padding-top: 0.25rem !important;
  padding-left: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.trix-content ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
}

.trix-content ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
}

.trix-content li {
  margin-bottom: 0.25rem !important;
  display: list-item !important;
}

/* Specific override for nested lists */
.trix-content ul ul,
.trix-content ol ol,
.trix-content ul ol,
.trix-content ol ul {
  margin-bottom: 0.5rem !important;
  margin-top: 0.5rem !important;
}

trix-editor pre {
  display: inline-block;
  width: 100%;
  vertical-align: top;
  font-family: monospace;
  font-size: 1.5em;
  padding: 0.5em;
  white-space: pre;
  background-color: #eee;
  overflow-x: auto;
}

trix-editor blockquote {
  border: 0 solid #ccc;
  border-left-width: 0.3em;
  margin-left: 0.3em;
  padding-left: 0.6em;
}

trix-toolbar button {
  border: 1px solid #ddd;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  background-color: #eaeaea;
}

trix-toolbar {
  margin-bottom: 7px;
}
trix-toolbar button:hover {
  cursor: pointer;
}
/*
 * We need to override trix.css’s image gallery styles to accommodate the
 * <action-text-attachment> element we wrap around attachments. Otherwise,
 * images in galleries will be squished by the max-width: 33%; rule.
*/
.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.trix-content
  .attachment-gallery.attachment-gallery--2
  > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
.trix-content
  .attachment-gallery.attachment-gallery--4
  > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

.trix-content action-text-attachment .attachment {
  padding: 0 !important;
  max-width: 100% !important;
}
