/*
 * Lexxy Overrides for Tailwind CSS
 *
 * Lexxy uses :where(.lexxy-content) which has zero specificity.
 * Tailwind Preflight resets elements with normal specificity, overriding Lexxy.
 * These rules restore Lexxy styles with higher specificity.
 */

/* ==========================================================================
   Editor (Web Component + Class)
   ========================================================================== */

/* Headings */
lexxy-editor h1, .lexxy-editor h1 { font-size: 2rem; font-weight: bold; }
lexxy-editor h2, .lexxy-editor h2 { font-size: 1.5rem; font-weight: bold; }
lexxy-editor h3, .lexxy-editor h3 { font-size: 1.25rem; font-weight: bold; }
lexxy-editor h4, .lexxy-editor h4 { font-size: 1rem; font-weight: bold; }
lexxy-editor h5, .lexxy-editor h5 { font-size: 0.875rem; font-weight: bold; }
lexxy-editor h6, .lexxy-editor h6 { font-size: 0.75rem; font-weight: bold; }

/* Lists */
lexxy-editor ul, .lexxy-editor ul {
  list-style-type: disc;
  margin-inline-start: 1.5em;
}
lexxy-editor ol, .lexxy-editor ol {
  list-style-type: decimal;
  margin-inline-start: 1.5em;
}

/* Blockquote */
lexxy-editor blockquote, .lexxy-editor blockquote {
  border-inline-start: 0.25em solid var(--lexxy-color-ink-lighter, #d4d4d4);
  font-style: italic;
  padding: 0.5lh 2ch;
}

/* Table */
lexxy-editor table, .lexxy-editor table {
  border-collapse: collapse;
  border-spacing: 0;
}
lexxy-editor table th,
lexxy-editor table td,
.lexxy-editor table th,
.lexxy-editor table td {
  border: 1px solid var(--lexxy-color-ink-lighter, #d4d4d4);
  padding: 1ch;
  text-align: start;
}

/* Text decorations */
lexxy-editor s, .lexxy-editor s {
  text-decoration: line-through;
}
lexxy-editor .lexxy-content__strikethrough,
.lexxy-editor .lexxy-content__strikethrough {
  text-decoration: line-through;
}
lexxy-editor .lexxy-content__underline,
.lexxy-editor .lexxy-content__underline {
  text-decoration: underline;
}
lexxy-editor .lexxy-content__strikethrough.lexxy-content__underline,
.lexxy-editor .lexxy-content__strikethrough.lexxy-content__underline {
  text-decoration: line-through underline;
}

/* HR */
lexxy-editor hr, .lexxy-editor hr {
  border: 0;
  border-block-end: 1px solid currentColor;
  inline-size: 20%;
}

/* ==========================================================================
   Content Display
   ========================================================================== */

/* Headings */
.lexxy-content h1 { font-size: 2rem; font-weight: bold; }
.lexxy-content h2 { font-size: 1.5rem; font-weight: bold; }
.lexxy-content h3 { font-size: 1.25rem; font-weight: bold; }
.lexxy-content h4 { font-size: 1rem; font-weight: bold; }
.lexxy-content h5 { font-size: 0.875rem; font-weight: bold; }
.lexxy-content h6 { font-size: 0.75rem; font-weight: bold; }

/* Lists */
.lexxy-content ul {
  list-style-type: disc;
  margin-inline-start: 1.5em;
}
.lexxy-content ol {
  list-style-type: decimal;
  margin-inline-start: 1.5em;
}

/* Blockquote */
.lexxy-content blockquote {
  border-inline-start: 0.25em solid var(--lexxy-color-ink-lighter, #d4d4d4);
  font-style: italic;
  padding: 0.5lh 2ch;
}

/* Table */
.lexxy-content table {
  border-collapse: collapse;
  border-spacing: 0;
}
.lexxy-content table th,
.lexxy-content table td {
  border: 1px solid var(--lexxy-color-ink-lighter, #d4d4d4);
  padding: 1ch;
  text-align: start;
}
.lexxy-content table th.lexxy-content__table-cell--header,
.lexxy-content table td.lexxy-content__table-cell--header {
  background-color: var(--lexxy-color-table-header-bg);
  font-weight: bold;
}

/* Text decorations */
.lexxy-content s {
  text-decoration: line-through;
}
.lexxy-content .lexxy-content__strikethrough {
  text-decoration: line-through;
}
.lexxy-content .lexxy-content__underline {
  text-decoration: underline;
}
.lexxy-content .lexxy-content__strikethrough.lexxy-content__underline {
  text-decoration: line-through underline;
}

/* HR */
.lexxy-content hr {
  border: 0;
  border-block-end: 1px solid currentColor;
  inline-size: 20%;
}
