/*
 * Reorder (behaviour in script/components/reorder.js): a grip that drags its item, and the
 * Move up / Move down menu it opens on a tap, click, Enter or Space.
 *
 *   <button type="button" class="reorder-grip" data-reorder-grip aria-label="Move Name" aria-expanded="false">
 *     <span class="icon icon-reorder" aria-hidden="true"></span></button>
 */
.reorder-grip {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--cf-radius-sm);
  background: none;
  color: var(--cf-muted-color);
  cursor: grab;
}
.reorder-grip:hover,
.reorder-grip[aria-expanded="true"] {
  color: var(--cf-body-color);
}
.reorder-grip .icon {
  width: 24px;
  height: 24px;
}

/* the item while it is dragged, and the sub-rows it carries along (folded away meanwhile) */
.reorder-ghost {
  opacity: .4;
}
[data-reorder] > .reorder-carried {
  display: none;
}

/* the menu: a popover in the top layer, placed under the grip (above it near the bottom of the window) */
.reorder-menu {
  position: fixed;
  inset: auto;
  z-index: 1000; /* browsers without popovers */
  display: flex;
  flex-direction: column;
  min-width: 140px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--cf-border-color);
  border-radius: var(--cf-radius);
  background: var(--cf-surface);
  color: var(--cf-body-color);
  box-shadow: var(--cf-shadow-overlay);
}
.reorder-menu button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--cf-radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.reorder-menu button:hover:not(:disabled) {
  background: var(--cf-surface-2);
}
.reorder-menu button:disabled {
  opacity: var(--cf-disabled-opacity);
  cursor: default;
}
