/*
 * Lexxy theme. Served raw by Propshaft (not processed by Tailwind), so plain CSS only.
 *
 * Lexxy's own stylesheets go into Tailwind's base layer (as fizzy does), so preflight
 * can't strip them and Tailwind utilities plus the components layer below override
 * them without specificity fights or !important.
 */
@import url("/assets/lexxy-content-5b3c1485.css") layer(base);
@import url("/assets/lexxy-editor-f9121f41.css") layer(base);

/* daisyUI sets its tokens on <html data-theme>, so mapping on :root follows the active
 * theme everywhere, including the prompt menu and dialogs Lexxy renders outside the editor. */
:root {
  --lexxy-color-canvas: var(--color-base-100);
  --lexxy-color-ink: var(--color-base-content);
  --lexxy-color-ink-medium: color-mix(in oklch, var(--color-base-content) 65%, var(--color-base-100));
  --lexxy-color-ink-light: color-mix(in oklch, var(--color-base-content) 50%, var(--color-base-100));
  --lexxy-color-ink-lighter: color-mix(in oklch, var(--color-base-content) 35%, var(--color-base-100));
  --lexxy-color-ink-lightest: color-mix(in oklch, var(--color-base-content) 15%, var(--color-base-100));
  --lexxy-color-ink-inverted: var(--color-base-100);

  /* oklab, not oklch: base-100 carries an explicit 0° hue, so an oklch mix swings blue through magenta. */
  --lexxy-color-accent-dark: var(--color-primary);
  --lexxy-color-accent-medium: color-mix(in oklab, var(--color-primary) 60%, var(--color-base-100));
  --lexxy-color-accent-light: color-mix(in oklab, var(--color-primary) 30%, var(--color-base-100));
  --lexxy-color-accent-lightest: color-mix(in oklab, var(--color-primary) 20%, var(--color-base-100));
  --lexxy-color-selected-dark: var(--color-primary);
  --lexxy-color-link: var(--color-primary);

  --lexxy-content-margin: 0.5em;
  --lexxy-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
}

/* Keyed to the theme picker, not prefers-color-scheme: users can choose a theme that differs from their OS. */
[data-theme='slate-dark'] {
  --lexxy-shadow: 0 2px 8px rgb(0 0 0 / 0.4);

  /* Lexxy's default token colors are for light backgrounds; punctuation is near-black. */
  --lexxy-color-code-token-att: #ff7b72;
  --lexxy-color-code-token-comment: #8b949e;
  --lexxy-color-code-token-function: #d2a8ff;
  --lexxy-color-code-token-operator: #ff7b72;
  --lexxy-color-code-token-property: #79c0ff;
  --lexxy-color-code-token-punctuation: #c9d1d9;
  --lexxy-color-code-token-selector: #7ee787;
  --lexxy-color-code-token-variable: #ffa657;

  --highlight-1: rgb(227, 210, 90);
  --highlight-2: rgb(255, 165, 60);
  --highlight-3: rgb(255, 100, 100);
  --highlight-4: rgb(255, 120, 210);
  --highlight-5: rgb(190, 140, 255);
  --highlight-6: rgb(100, 180, 255);
  --highlight-7: rgb(90, 220, 80);
  --highlight-8: rgb(220, 160, 100);
  --highlight-9: rgb(180, 180, 180);

  --highlight-bg-1: rgba(229, 223, 6, 0.25);
  --highlight-bg-2: rgba(255, 185, 87, 0.25);
  --highlight-bg-3: rgba(255, 118, 118, 0.25);
  --highlight-bg-4: rgba(248, 137, 216, 0.25);
  --highlight-bg-5: rgba(190, 165, 255, 0.25);
  --highlight-bg-6: rgba(124, 192, 252, 0.25);
  --highlight-bg-7: rgba(140, 255, 129, 0.25);
  --highlight-bg-8: rgba(221, 170, 123, 0.25);
  --highlight-bg-9: rgba(200, 200, 200, 0.25);
}

@layer components {
  /* Lexxy indents lists by 1.5× the content margin; at our tighter margin that clips "10." markers. */
  .lexxy-content :is(ol, ul):not(.lexxy-prompt-menu) {
    margin-inline-start: 1.5em;
  }

  .lexxy-content ul ul {
    list-style-type: circle;
  }

  .lexxy-content ul ul ul {
    list-style-type: square;
  }

  /* Truncate standalone links (sole child of a paragraph) so long URLs don't blow out
   * the layout, but leave inline links in prose wrapping normally. */
  .lexxy-content p > a:only-child {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
}
