@import "./_mixins.less";

:host {
  position: absolute;

  display: inline-grid;
  grid-template-columns: repeat(5, max-content);
  grid-template-rows: auto;

  .no-user-select();
  cursor: pointer;

  width: auto;
  height: auto;

  z-index: var(--bokeh-top-level);

  font-size: var(--font-size);
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.bk-item, .bk-divider {
  position: relative;
  display: grid;
  grid-template-columns: subgrid;
  grid-column: span 5;
  align-items: center;
}
.bk-check {
  grid-column: 1;
}
.bk-icon {
  grid-column: 2;
}
.bk-label {
  grid-column: 3;
}
.bk-shortcut {
  grid-column: 4;
}
.bk-chevron {
  grid-column: 5;
}

.bk-divider {
  cursor: default;
  overflow: hidden;
  background-color: var(--divider-color);
  height: 1px;
  margin: 1px 5px;
}

.bk-item {
  padding: 0.5em;

  &:hover {
    background-color: var(--hover-color);
  }
  &:focus, &:focus-visible {
    outline: 1px dotted var(--highlight-color);
    outline-offset: -1px;
  }
  &::-moz-focus-inner {
    border: 0;
  }

  &.bk-disabled {
    color: var(--disabled-color);
    cursor: not-allowed;

    .bk-icon {
      color: var(--icon-color-disabled);
    }
  }

  &:first-of-type {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
  }

  &:last-of-type {
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
  }
}

.bk-icon {
  position: relative;

  width: 16px;
  height: 16px;

  .icon-mask-base();
  .icon-mask-base-png();
}

.bk-label {
  padding: 0 0.5em;
}

.bk-shortcut {
  text-align: right;
  font-size: 90%;
  color: var(--shortcut-color);
}

.bk-chevron {
  .icon-mask(var(--bokeh-icon-caret-right));
  width: 12px;
  height: 12px;
}
.bk-item:not(.bk-menu) {
  .bk-chevron {
    display: none;
  }
}
.bk-item.bk-checkable {
  .bk-check {
    width: 16px;
    height: 16px;
  }
  &.bk-checked {
    .bk-check {
      .icon-mask(var(--bokeh-icon-check));
    }
  }
}
