@import url("/assets/lexxy-overrides/lexxy-variables-bfbcf891.css");

.lexxy-content__table-cell--header p {
  font-weight: var(--font-weight--medium)
}

:where(lexxy-editor) {
  --lexxy-editor-padding: var(--input-padding);

  background-color: var(--lexxy-color-canvas);
  border: none;
  border-radius: 0;
  overflow: visible;
}

:where(.lexxy-editor__content) {
  padding: var(--lexxy-editor-padding);
  position: relative;

  table {
    border-block-start: var(--border--light);
  }

  .attachment-gallery {
    --lexxy-attachment-gallery-columns: 2;
  }
}

lexxy-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--color--bg-base);
}

:where(lexxy-toolbar) {
  --lexxy-toolbar-icon-size: 1rem;
  border-block-end: 1px solid var(--color--border-low-contrast);
  color: currentColor;
  display: flex;
  font-size: inherit;
  gap: var(--lexxy-toolbar-gap);
  max-inline-size: 100%;
  padding: 2px;
  position: relative;

  &[data-attachments="false"] button[name="upload"] {
    display: none;
  }
}

:where(.lexxy-editor--empty) {
  .lexxy-editor__content:not(:has(ul, ol))::before {
    inset-block-start: var(--lexxy-editor-padding);
    inset-inline-start: var(--lexxy-editor-padding);
  }
}

:where(lexxy-toolbar) > .lexxy-editor__toolbar-dropdown {
  flex: 0 0 var(--lexxy-toolbar-button-size);
}

:where(lexxy-toolbar) > .lexxy-editor__toolbar-button,
:where(lexxy-toolbar) > .lexxy-editor__toolbar-dropdown > summary.lexxy-editor__toolbar-button {
  aspect-ratio: 1;
  display: grid;
  block-size: var(--lexxy-toolbar-button-size);
  inline-size: var(--lexxy-toolbar-button-size);
  place-items: center;
  padding: 0;
}

:where(lexxy-toolbar) .lexxy-editor__toolbar-button {
  color: currentColor;

  &[aria-disabled="true"] {
    cursor: default;
    opacity: 1;
  }

  svg {
    color: var(--color--aa-text);
  }

  &:is(:active):not([aria-disabled="true"]),
  &[aria-pressed="true"] {
    svg {
      color: var(--color--aaa-text);
    }
  }

  &.lexxy-editor__toolbar-group-end:after {
    background-color: var(--color--border-low-contrast);
  }
}

:where(.lexxy-editor__toolbar-dropdown) {
  &:is([open]) > .lexxy-editor__toolbar-button {
    border-end-end-radius: var(--lexxy-radius);
    border-end-start-radius: var(--lexxy-radius);
  }

  button {
    color: var(--lexxy-color-text);
  }
}

lexxy-link-dropdown {
  padding: 0.5rem;
  form {
    gap: 0.5rem;

    [overflowing] & {
      .lexxy-editor__toolbar-dropdown-actions {
        margin-block-start: 0.5rem;
      }
    }
  }

  .lexxy-editor__toolbar-dropdown-actions {
    gap: 0.5rem;
  }
}

:where(.lexxy-floating-controls) {
  z-index: var(--lexxy-z-popup);
}

:where(.lexxy-prompt-menu) {
  --lexxy-prompt-avatar-size: 24px;
  --lexxy-prompt-min-width: 20ch;
  --lexxy-prompt-padding: 0.5ch;

  background-color: var(--lexxy-color-canvas);
  border-radius: calc(var(--lexxy-prompt-padding) * 2);
  box-shadow: var(--lexxy-shadow);
  color: var(--lexxy-color-ink);
  font-family: var(--lexxy-font-base);
  font-size: var(--lexxy-text-small);
  margin: 0;
  max-block-size: 200px;
  min-inline-size: var(--lexxy-prompt-min-width);
  overflow: auto;
  padding: var(--lexxy-prompt-padding);
  visibility: hidden;
  z-index: var(--lexxy-z-popup);
}

:where(.lexxy-prompt-menu--visible) {
  visibility: initial;
}

:where(.lexxy-prompt-menu__item) {
  align-items: center;
  border-radius: var(--lexxy-radius);
  cursor: pointer;
  display: flex;
  gap: var(--lexxy-prompt-padding);
  padding: var(--lexxy-prompt-padding);
  white-space: nowrap;

  &:hover {
    background-color: var(--lexxy-color-ink-lightest);
  }

  &[aria-selected] {
    background-color: var(--lexxy-color-selected);
  }

  img {
    block-size: var(--lexxy-prompt-avatar-size);
    border-radius: 50%;
    flex-shrink: 0;
    inline-size: var(--lexxy-prompt-avatar-size);
    margin: 0;
  }

  + & {
    margin-top: 2px;
  }
}

:where(.lexxy-prompt-menu__item--empty) {
  color: var(--lexxy-color-ink-medium);
  padding: var(--lexxy-prompt-padding);
}
