/* Lexxy CSS overrides to restore styles that Tailwind CSS reset removes */

/* Restore list styles within Lexxy content */
:where(.lexxy-content) {
  ul {
    list-style-type: disc;
    padding-left: 1.5rem;
  }

  ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
  }

  li {
    display: list-item;
    margin-bottom: 0.25rem;
  }

  /* Nested lists */
  ul ul {
    list-style-type: circle;
    margin-top: 0.25rem;
  }

  ul ul ul {
    list-style-type: square;
  }

  ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.25rem;
  }

  ol ol ol {
    list-style-type: lower-roman;
  }

  /* Definition lists */
  dl {
    margin-bottom: var(--lexxy-content-margin);
  }

  dt {
    font-weight: bold;
    margin-top: 0.5rem;
  }

  dd {
    margin-left: 1.5rem;
    margin-bottom: 0.25rem;
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: var(--lexxy-content-margin);
  }

  th,
  td {
    border: 1px solid var(--lexxy-color-ink-lighter);
    padding: 0.5rem;
    text-align: left;
  }

  th {
    background-color: var(--lexxy-color-ink-lightest);
    font-weight: bold;
  }

  /* Links */
  a {
    color: var(--lexxy-color-accent, #0066cc);
    text-decoration: underline;
  }

  a:hover {
    text-decoration: none;
  }

  /* Strong and emphasis */
  strong,
  b {
    font-weight: bold;
  }

  em,
  i {
    font-style: italic;
  }

  /* Horizontal rules */
  hr {
    border: none;
    border-top: 1px solid var(--lexxy-color-ink-lighter);
    margin: var(--lexxy-content-margin) 0;
  }

  /* Subscript and superscript */
  sub,
  sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }

  sup {
    top: -0.5em;
  }

  sub {
    bottom: -0.25em;
  }

  /* Mark/highlight */
  mark {
    background-color: yellow;
    color: black;
    padding: 0.1em 0.2em;
  }

  /* Small text */
  small {
    font-size: 0.875em;
  }

  /* Address */
  address {
    font-style: italic;
    margin-bottom: var(--lexxy-content-margin);
  }

  /* Abbreviations */
  abbr[title] {
    border-bottom: 1px dotted;
    cursor: help;
    text-decoration: none;
  }

  /* Keyboard input */
  kbd {
    background-color: var(--lexxy-color-ink-lightest);
    border: 1px solid var(--lexxy-color-ink-lighter);
    border-radius: 3px;
    font-family: var(--lexxy-font-mono);
    font-size: 0.9em;
    padding: 0.1em 0.3em;
  }

  /* Sample output */
  samp {
    font-family: var(--lexxy-font-mono);
    font-size: 0.9em;
  }

  /* Variable */
  var {
    font-style: italic;
  }
}

/* Ensure Lexxy editor content also gets these styles */
:where(.lexxy-editor .lexxy-content) {
  ul {
    list-style-type: disc;
    padding-left: 1.5rem;
  }

  ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
  }

  li {
    display: list-item;
    margin-bottom: 0.25rem;
  }
}
