:root {
  --lexxy-color-ink-lighter: transparent;
  --lexxy-color-ink: oklch(55.1% 0.027 264.364);
  --lexxy-radius: 0px;
  --lexxy-color-canvas: #F8F8F8;
  --lexxy-toolbar-button-size: 1.5lh;
  --lexxy-color-ink-lightest: #e4e4e4;
  --lexxy-color-selected: #dfdfdf;
  --lexxy-color-selected-hover: #d9d9d9;
}

lexxy-editor.buzz-editor {
  --lexxy-color-ink: #060606;
  --lexxy-editor-padding: 6px 8px;
}

lexxy-editor.buzz-editor .lexxy-editor__content::before {
  color: oklch(55.1% 0.027 264.364);
  font-weight: 500;
}

.editor-toggle {
  position: fixed;
  bottom: calc(1.25rem + var(--keyboard-inset, env(safe-area-inset-bottom)));
  left: 1rem;
  z-index: 20;
  transition: bottom 200ms ease-out;
}

lexxy-toolbar.lexxy-toolbar--floating {
  position: fixed;
  bottom: calc(1.25rem + var(--keyboard-inset, env(safe-area-inset-bottom)));
  right: 1rem;
  z-index: 20;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 9999px;
  background-color: #FFFFFF;
  box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.12);
  color: #060606;
  transition: bottom 200ms ease-out;
}

lexxy-toolbar.lexxy-toolbar--floating .lexxy-editor__toolbar-button {
  border-radius: 9999px;
}

lexxy-toolbar.lexxy-toolbar--floating .lexxy-editor__toolbar-button:not([aria-pressed="true"]):not(:active) {
  background: transparent;
}

:where(.lexxy-content) {
  blockquote {
    border-inline-start: 0.25em solid var(--lexxy-color-ink);
  }
}

:where(.lexxy-content:not(lexxy-editor)) {
  .attachment--preview,
  .attachment-gallery {
    inline-size: 100%;
    padding: 16px 16px 0;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.08);
  }

  .attachment--preview {
    img,
    video {
      inline-size: 100%;
      max-block-size: none;
      border-radius: 0.375rem;
    }

    .attachment__caption {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.25rem;
      padding-block: 5px 2.5px;
      font-size: 12px;
      line-height: 26px;
    }

    .attachment__name {
      inline-size: 0.875rem;
      block-size: 0.875rem;
      overflow: hidden;
      color: transparent;
      background-color: var(--lexxy-color-text-subtle);
      mask: url("/assets/photo-ea9adcbb.svg") center / contain no-repeat;
    }
  }

  .attachment--video .attachment__name {
    mask-image: url("/assets/video-camera-96bdc365.svg");
  }

  .attachment-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;

    &.attachment-gallery--2,
    &.attachment-gallery--4 {
      grid-template-columns: repeat(2, 1fr);

      .attachment {
        inline-size: auto;
      }
    }

    .attachment {
      inline-size: auto;
      min-inline-size: 0;
      margin: 0;
      padding: 0;
      border-radius: 0;
      background-color: transparent;
      box-shadow: none;

      img {
        aspect-ratio: 1;
        object-fit: cover;
      }

      .attachment__caption {
        padding-block-end: 2.5px;
      }
    }
  }
}

:where(.lexxy-editor__toolbar-dropdown) {
  & lexxy-link-dropdown {
    input[type="url"] {
      block-size: 100%;
    }
  }
}

:where(.lexxy-floating-controls) {
  &:is(lexxy-code-language-picker) {
    & select {
      @media (prefers-color-scheme: dark) {
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19.5c-.7 0-1.3-.3-1.7-.8l-9.8-11.1c-.7-.8-.6-1.9.2-2.6.8-.6 1.9-.6 2.5.2l8.6 9.8c0 .1.2.1.4 0l8.6-9.8c.7-.8 1.8-.9 2.6-.2s.9 1.8.2 2.6l-9.8 11.1c-.4.5-1.1.8-1.7.8z' fill='%236a7282'/%3E%3C/svg%3E");
      }
    }
  }
}
