/*
 * Lexxy + Tailwind v3 compatibility.
 * Tailwind preflight resets browser defaults which conflicts with
 * Lexxy's :where() selectors (zero specificity).
 */

lexxy-editor {
  display: block;
  min-height: 200px;
}

lexxy-editor .lexxy-editor__content {
  min-height: 160px;
  border-top: 1px solid var(--border-default, #d1d5dc);
}

lexxy-editor .lexxy-image-delete-button,
lexxy-editor [data-lexxy-image-remove],
lexxy-editor .ProseMirror .image-delete-button {
  display: none !important;
}

/* Toolbar buttons */
lexxy-editor button,
lexxy-editor summary {
  background: var(--lexxy-color-canvas, white);
  border: none;
  border-radius: var(--lexxy-radius, 4px);
  cursor: pointer;
  padding: 0;
}

lexxy-editor button:hover:not([aria-disabled="true"]),
lexxy-editor summary:hover:not([aria-disabled="true"]) {
  background: var(--lexxy-color-ink-lightest, #f3f4f6);
}

/* SVGs and images */
lexxy-editor img,
lexxy-editor svg {
  display: inline;
  vertical-align: middle;
}

/* Dropdown z-index */
lexxy-editor details[open] > *:not(summary) {
  z-index: 50;
}

/* Form inputs inside dropdowns */
/* Action Text rendered content */
.trix-content {
  font-size: inherit;
  line-height: inherit;
}

.trix-content strong,
.trix-content b {
  font-weight: bold;
}

.trix-content em,
.trix-content i {
  font-style: italic;
}

.trix-content s,
.trix-content del,
.trix-content .lexxy-content__strikethrough {
  text-decoration: line-through;
}

.trix-content u,
.trix-content .lexxy-content__underline {
  text-decoration: underline;
}

.trix-content h2 {
  font-size: 1.5em;
  font-weight: bold;
  margin: 0.5em 0;
}

.trix-content h3 {
  font-size: 1.25em;
  font-weight: bold;
  margin: 0.5em 0;
}

.trix-content h4 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0.5em 0;
}

.trix-content ul {
  list-style: disc;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.trix-content ol {
  list-style: decimal;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.trix-content blockquote {
  border-left: 3px solid var(--border-default, #d1d5dc);
  padding-left: 1em;
  margin: 0.5em 0;
  color: #6a7282;
}

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

.trix-content pre {
  background: #f3f4f6;
  padding: 0.75em 1em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  overflow-x: auto;
}

.trix-content code {
  background: #f3f4f6;
  padding: 0.15em 0.3em;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

lexxy-editor input {
  border: 1px solid var(--lexxy-color-ink-lighter, #d1d5dc);
  border-radius: var(--lexxy-radius, 4px);
  padding: 6px 10px;
  color: inherit;
  font-size: inherit;
}

/* Content area — undo Tailwind resets on formatted text */
lexxy-editor .lexxy-content__strikethrough {
  text-decoration: line-through;
}

lexxy-editor .lexxy-content__underline {
  text-decoration: underline;
}

lexxy-editor .lexxy-content__strikethrough.lexxy-content__underline {
  text-decoration: line-through underline;
}

lexxy-editor .lexxy-content__bold,
lexxy-editor strong,
lexxy-editor b {
  font-weight: bold;
}

lexxy-editor .lexxy-content__italic,
lexxy-editor em,
lexxy-editor i {
  font-style: italic;
}

lexxy-editor .lexxy-editor__content h2 {
  font-size: 1.5em;
  font-weight: bold;
  margin: 0.5em 0;
}

lexxy-editor .lexxy-editor__content h3 {
  font-size: 1.25em;
  font-weight: bold;
  margin: 0.5em 0;
}

lexxy-editor .lexxy-editor__content h4 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0.5em 0;
}

lexxy-editor .lexxy-editor__content ul {
  list-style: disc;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

lexxy-editor .lexxy-editor__content ol {
  list-style: decimal;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

lexxy-editor .lexxy-editor__content blockquote {
  border-left: 3px solid var(--lexxy-color-ink-lighter, #d1d5dc);
  padding-left: 1em;
  margin: 0.5em 0;
  color: var(--lexxy-color-ink-light, #6a7282);
}

lexxy-editor .lexxy-editor__content a {
  color: #2563eb;
  text-decoration: underline;
}

lexxy-editor .lexxy-editor__content pre {
  background: #f3f4f6;
  padding: 0.75em 1em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  overflow-x: auto;
}

lexxy-editor .lexxy-editor__content code {
  background: #f3f4f6;
  padding: 0.15em 0.3em;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}
