.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

/* Default: below the button, left-aligned */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  padding: 4px;
  min-width: 12rem;
  background-color: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--light-grey);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
}

/* Vertical direction */
.dropdown--top {
  top: auto;
  bottom: calc(100% + 4px);
}

/* Horizontal alignment */
.dropdown--end {
  left: auto;
  right: 0;
}

/* Side placement: right of the button, aligned to its top */
.dropdown--right {
  top: 0;
  left: calc(100% + 4px);
}

/* Side placement: left of the button, aligned to its top */
.dropdown--left {
  top: 0;
  left: auto;
  right: calc(100% + 4px);
}

.dropdown hr {
  margin: 4px 0;
  border: none;
  border-top: 1px solid var(--light-grey);
}


.dropdown [role="menuitem"] {
  display: flex;
  width: 100%;
  padding: 8px 12px;
  justify-content: start;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  font: inherit;
  color: inherit;
  text-align: left;
}

.dropdown [role="menuitem"]:hover,
.dropdown [role="menuitem"]:focus-visible {
  background-color: var(--off-background-color);
  outline: none;
}
