/*
 * Styles for ActionText rich text content display.
 * The .trix-content class is used for backward compatibility with existing content.
 */

/*
 * Override default image gallery styles to accommodate the
 * <action-text-attachment> element we wrap around attachments.
 */
.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;
}

/* Tailwind resets list style, so add it back for actiontext */
.trix-content ul {
  list-style: disc;
  padding-left: 12px;
}

.trix-content ol {
  list-style: decimal;
  padding-left: 12px;
}

.trix-content a {
  color: #3b82f6;
  text-decoration: underline;
}

.dark .trix-content a {
  color: #60a5fa;
}

.trix-content strong,
.trix-content b {
  color: #111827;
}

.dark .trix-content strong,
.dark .trix-content b {
  color: #f3f4f6;
}

.trix-content h1,
.trix-content h2,
.trix-content h3,
.trix-content h4,
.trix-content h5,
.trix-content h6 {
  color: #111827;
}

.dark .trix-content h1,
.dark .trix-content h2,
.dark .trix-content h3,
.dark .trix-content h4,
.dark .trix-content h5,
.dark .trix-content h6 {
  color: #f9fafb;
}

.trix-content {
  color: #374151;
}

.dark .trix-content {
  color: #d1d5db;
}

/* Comment thread connecting lines */
.comment-thread {
  position: relative;
}

.comment-thread > div {
  position: relative;
}

.comment-thread > div::before {
  content: '';
  position: absolute;
  left: -28px;
  top: -16px;
  width: 28px;
  height: 32px;
  border-left: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-bottom-left-radius: 12px;
}

.dark .comment-thread > div::before {
  border-color: #374151;
}

.comment-thread > div:first-child::before {
  top: -68px;
  height: 84px;
}

.comment-thread > div:not(:last-child)::after {
  content: '';
  position: absolute;
  left: -28px;
  top: 32px;
  bottom: -16px;
  width: 1px;
  background-color: #e5e7eb;
}

.dark .comment-thread > div:not(:last-child)::after {
  background-color: #374151;
}
