/* Tiptap Editor Styling */

.tiptap {
  outline: none;
  min-height: 200px;
}

/* Size variants for tiptap editor */
.tiptap-size-small .tiptap,
[data-tiptap-editor].tiptap-size-small {
  min-height: 100px;
}

.tiptap-size-default .tiptap,
[data-tiptap-editor].tiptap-size-default {
  min-height: 200px;
}

.tiptap-size-large .tiptap,
[data-tiptap-editor].tiptap-size-large {
  min-height: 400px;
}

.tiptap p {
  margin: 1em 0;
}

.tiptap p:first-child {
  margin-top: 0;
}

.tiptap p:last-child {
  margin-bottom: 0;
}

.tiptap h1 {
  font-size: 2em;
  font-weight: bold;
  margin: 0.67em 0;
  line-height: 1.2;
}

.tiptap h2 {
  font-size: 1.5em;
  font-weight: bold;
  margin: 0.75em 0;
  line-height: 1.3;
}

.tiptap h3 {
  font-size: 1.25em;
  font-weight: bold;
  margin: 0.83em 0;
  line-height: 1.4;
}

.tiptap h4 {
  font-size: 1em;
  font-weight: bold;
  margin: 1em 0;
}

.tiptap h5 {
  font-size: 0.875em;
  font-weight: bold;
  margin: 1.17em 0;
}

.tiptap h6 {
  font-size: 0.75em;
  font-weight: bold;
  margin: 1.33em 0;
}

.tiptap ul,
.tiptap ol {
  padding-left: 2rem;
  margin: 1em 0;
  list-style-position: outside;
}

.tiptap ul {
  list-style-type: disc;
}

.tiptap ol {
  list-style-type: decimal;
}

.tiptap li {
  margin: 0.25em 0;
  display: list-item;
}

.tiptap li > p {
  margin: 0;
  display: inline;
}

.tiptap code {
  background-color: #f3f4f6;
  color: #1f2937;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.tiptap pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1em 0;
}

.tiptap pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 1em;
}

.tiptap blockquote {
  border-left: 3px solid #d1d5db;
  padding-left: 1rem;
  margin: 1em 0;
  font-style: italic;
  color: #6b7280;
}

.tiptap strong {
  font-weight: bold;
}

.tiptap em {
  font-style: italic;
}

.tiptap a {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

.tiptap a:hover {
  color: #1d4ed8;
}

.tiptap hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 2em 0;
}

/* Placeholder text */
.tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #9ca3af;
  pointer-events: none;
  height: 0;
}

/* Focus styles */
.tiptap:focus {
  outline: none;
}

/* Wrapper focus ring - match .form-control focus style */
[data-tiptap-wrapper] {
  transition: box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

[data-tiptap-wrapper]:focus-within {
  box-shadow: 0 0 0 1px var(--border-primary);
  border-color: var(--border-primary);
}

/* Remove toolbar bottom border - outer ring is sufficient */
[data-tiptap-toolbar] {
  border-bottom: none;
}
