/* Custom styles for Action Text content */
.trix-content {
  line-height: 1.8 !important;
  color: #374151;
}

/* Ensure proper line height and spacing for all divs in trix content */
.trix-content div {
  line-height: 1.8 !important;
  margin-bottom: 0.25rem !important;
}

/* Add spacing between paragraphs */
.trix-content div + div {
  margin-top: 0.5rem !important;
}

/* Handle line breaks with pseudo-element for visual spacing */
.trix-content br {
  display: block !important;
  content: "" !important;
  height: 0.75rem !important;
}

/* Ensure empty divs (line breaks) have minimum height */
.trix-content div:empty {
  min-height: 1.5rem !important;
}

/* Links in trix content */
.trix-content a {
  color: #3b82f6 !important;
  text-decoration: none !important;
}

.trix-content a:hover {
  color: #2563eb !important;
  text-decoration: underline !important;
}

/* Paragraphs within trix content */
.trix-content p {
  line-height: 1.8 !important;
  margin-bottom: 1rem !important;
}

.trix-content h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.trix-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.trix-content p {
  margin-bottom: 1rem;
}

.trix-content ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.trix-content ol {
  list-style-type: decimal;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.trix-content blockquote {
  border-left: 4px solid #d1d5db;
  padding-left: 1rem;
  font-style: italic;
  margin-bottom: 1rem;
}

.trix-content pre {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.trix-content code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.125rem;
  font-size: 0.875rem;
}

/* Ensure the editor appears with proper height */
trix-editor {
  min-height: 120px !important;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.75rem;
  line-height: 1.8 !important;
}

/* Ensure proper line height and spacing in editor */
trix-editor div {
  line-height: 1.8 !important;
  margin-bottom: 0.25rem !important;
}

trix-editor div + div {
  margin-top: 0.5rem !important;
}

/* Handle line breaks in editor */
trix-editor br {
  display: block !important;
  content: "" !important;
  height: 0.75rem !important;
}

trix-editor div:empty {
  min-height: 1.5rem !important;
}

/* Links in editor */
trix-editor a {
  color: #3b82f6 !important;
  text-decoration: none !important;
}

trix-editor a:hover {
  color: #2563eb !important;
  text-decoration: underline !important;
}

trix-editor p {
  line-height: 1.8 !important;
  margin-bottom: 1rem !important;
}

/* Ensure formatting is visible inside the editor */
trix-editor strong {
  font-weight: bold;
}

trix-editor em {
  font-style: italic;
}

trix-editor ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

trix-editor ol {
  list-style-type: decimal;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

/* Make sure toolbar appears */
trix-toolbar {
  border: 1px solid #d1d5db;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
  background: #f9fafb;
}

/* Fix toolbar button visibility */
trix-toolbar .trix-button {
  font-size: 12px;
  padding: 0.5rem;
}

/* Embed styles */
.embed-container {
  margin: 1rem 0;
  max-width: 100%;
}

.embed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background-color: #f8fafc;
  border-radius: 0.5rem 0.5rem 0 0;
  border: 1px solid #e2e8f0;
  border-bottom: none;
}

.embed-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.twitter-embed-placeholder {
  min-height: 200px;
  border-radius: 0 0 0.5rem 0.5rem;
}

.note-embed-container {
  border-radius: 0 0 0.5rem 0.5rem;
  overflow: hidden;
}

.note-embed-container iframe {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 0 0 0.5rem 0.5rem;
}

.wordpress-embed-container {
  border-radius: 0 0 0.5rem 0.5rem;
  overflow: hidden;
  min-height: 120px;
}

.wordpress-embed-container iframe {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 0 0 0.5rem 0.5rem;
}

/* Responsive video container */
.embed-container iframe {
  border-radius: 0 0 0.5rem 0.5rem;
}

/* Make embeds responsive in mobile */
@media (max-width: 640px) {
  .embed-container {
    margin: 0.75rem 0;
  }
  
  .embed-header {
    padding: 0.375rem;
  }
  
  .embed-label {
    font-size: 0.75rem;
  }
}