/* =========================================
   DROPDOWN — shared dropdown menu component.
   Used by navbar org/user dropdowns, season status dropdown
   on configure page, and any hover/focus-revealed menu.
   Extracted from navbar.css to survive navbar rewrites.
   ========================================= */

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; left: -1px;
  background: var(--surface);
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 50;
  margin-top: 6px;
}
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px; left: 0; right: 0;
  height: 6px;
}
.dropdown-menu--right { left: auto; right: 0; }

.status-dropdown:hover        > .dropdown-menu,
.status-dropdown:focus-within > .dropdown-menu {
  display: block;
}

.status-dropdown {
  position: relative;
  display: inline-block;
}
.status-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.status-dropdown .dropdown-item .status-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 500;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-2); }
.dropdown-item.is-active { background: var(--accent-light); font-weight: 700; }

.dropdown-item--with-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dropdown-item--with-pill .status-pill {
  font-size: 0.65rem;
  padding: 2px 8px;
}

.dropdown-divider {
  height: 1px;
  background: var(--line-2);
  margin: 6px 0;
}

.arrow-down {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3);
}

.dropdown-section-label {
  padding: 6px 14px 2px;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}

/* button_to renders an inline form; ensure its button fills the dropdown row. */
.dropdown-menu form { margin: 0; }
.dropdown-menu form .dropdown-item { display: block; width: 100%; }

/* Non-interactive row (e.g. "Organization: X" when there's nothing to switch to) */
.dropdown-item--static { color: var(--ink-3); cursor: default; }
.dropdown-item--static:hover { background: none; }

.dropdown-item--danger { color: var(--danger); }

/* ---- Nested submenu (epic 0035 §11 — "Switch Organizations ▸") ----
   Hover/focus reveals a side panel; it opens LEFTWARD because the parent
   menu is right-aligned against the viewport edge. On phones, where hover
   doesn't exist, the submenu renders inline as an indented list. */
.dropdown-submenu { position: relative; outline: none; }
.dropdown-submenu__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: default;
}
.dropdown-submenu__arrow { color: var(--ink-3); font-size: 0.8rem; }
/* The panel butts up against the parent menu (no margin gap — a gap is
   where the pointer leaves both elements and the menu snaps shut) and has
   NO overflow rule of its own: overflow would clip the hover bridge below
   and turn the bridge's overhang into a horizontal scrollbar. */
.dropdown-submenu > .dropdown-menu--sub {
  display: none;
  top: -7px;
  right: calc(100% - 2px);
  left: auto;
  margin: 0;
  min-width: 220px;
  width: max-content;
  max-width: 320px;
  white-space: nowrap;
}
.dropdown-submenu > .dropdown-menu--sub::before {
  top: 0; bottom: 0; left: auto; right: -8px;
  width: 8px; height: auto;
}
.dropdown-submenu:hover > .dropdown-menu--sub,
.dropdown-submenu:focus-within > .dropdown-menu--sub { display: block; }

@media (max-width: 767px) {
  .dropdown-submenu > .dropdown-menu--sub {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0 0 4px 0.75rem;
    min-width: 0;
    width: auto;
    max-width: none;
  }
  .dropdown-submenu__arrow { display: none; }
}
