/* 06-components/_dropdown.css */
/* ── c-dropdown — the shadowed MC panel that opens under a menu item. */
.c-dropdown {
  position: absolute;
  top: 100%;                  /* directly under the menu item it belongs to */
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 24ch;
  background: var(--panel);
  border: var(--bw) solid var(--line-strong);
  box-shadow: 0.55em 0.55em 0 var(--shadow);  /* the hard offset MC drop shadow */
  padding-block: var(--space-2xs);
}
.c-dropdown[hidden] { display: none; }   /* closed by default; Stimulus toggles [hidden] */
/* hangs from the right edge of its item — for a menu near the right edge of the bar, where a
   left-anchored panel would run off screen. The MC shadow falls outward, so pull the panel in
   by its own offset to keep the shadow inside the viewport. */
.c-dropdown--right { left: auto; right: 0.55em; }
.c-dropdown__item {
  position: relative;                  /* positioning context for the ▸ current cue */
  display: flex;
  justify-content: space-between;
  gap: 3ch;
  width: 100%;
  /* Every item reserves the same left gutter, lit or not, so the ▸ has somewhere to appear
     without shunting the label right and leaving the column jagged. 1.25ch is the glyph's own
     cell plus a hair — the cue reads as attached to its label rather than floating off it. */
  padding: var(--space-3xs) var(--space-sm) var(--space-3xs) calc(var(--space-sm) + 1.25ch);
  color: var(--text);
  background: none; border: 0;
  text-align: left;
  cursor: pointer;
}
.c-dropdown__item:hover,
.c-dropdown__item:focus-visible { background: var(--panel-hi); color: var(--text-bright); outline: 0; }
/* current page — amber ink + a ▸ glyph before the label (mirrors c-toc__link.is-current). The
   glyph is absolutely placed in the gutter the padding above reserves: as an in-flow ::before it
   would be a third flex item and space-between would strand it away from its label. */
.c-dropdown__item.is-current { color: var(--accent); }
.c-dropdown__item.is-current .c-dropdown__key { color: var(--accent); }
.c-dropdown__item.is-current::before {
  content: "▸";
  position: absolute;
  left: var(--space-sm);
}
.c-dropdown__item .c-dropdown__key { color: var(--accent); }
.c-dropdown__shortcut { color: var(--text-dim); }
.c-dropdown__divider { height: var(--bw); background: var(--line); margin-block: var(--space-2xs); }

