/* Shared resource menus for Classic and VCE. Change these defaults in one place. */
.resource-dropdown {
  --csp-menu-background: #ffc368;
  --csp-menu-color: #fff;
  --csp-menu-hover: rgba(0, 0, 0, .2);
  --csp-menu-shadow: 0 .35rem 1rem rgba(0, 0, 0, .16);
  --csp-menu-radius: 1.5rem;
  --csp-menu-duration: 160ms;
}

/* Raising only the menu cannot escape the ribbon panel's stacking context. */
.resource-ribbon:has(.dropdown-menu.show) { z-index: 20; }
.resource-ribbon-panel > .resource-dropdown:has(> .dropdown-menu.show) { z-index: 1; }

.resource-dropdown > .dropdown-menu {
  background-color: var(--csp-menu-background);
  color: var(--csp-menu-color);
  border: 0;
  border-radius: var(--csp-menu-radius) 0 var(--csp-menu-radius) var(--csp-menu-radius);
  box-shadow: var(--csp-menu-shadow);
  padding: 1rem;
  margin-top: .25rem !important;
  font-family: "K2D", sans-serif;
  font-size: .875rem;
  line-height: 1.5;
  transform-origin: top right;
}

.resource-dropdown > .dropdown-menu .dropdown-item {
  color: var(--csp-menu-color);
  border-radius: .75rem;
  padding: .25rem 1rem;
  font: inherit;
}
.resource-dropdown > .dropdown-menu .dropdown-item:is(:hover, :focus, :active) {
  background-color: var(--csp-menu-hover) !important;
  color: var(--csp-menu-color);
}
.resource-dropdown > .dropdown-menu .dropdown-item:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.resource-dropdown:focus { height: 40px !important; }
.resource-dropdown:hover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--csp-menu-background);
}

.resource-dropdown > .dropdown-menu.show {
  animation: csp-resource-menu-open var(--csp-menu-duration) cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes csp-resource-menu-open {
  /* Independent scale preserves the translation calculated by Bootstrap/Popper. */
  from { opacity: 0; scale: .94; }
  to { opacity: 1; scale: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .resource-dropdown > .dropdown-menu.show { animation: none; }
}
