/* ============================================================================
   COMPONENT: menu-list — tappable rows for the More/settings surface
   (FEA-0000 / Dusk slice 1, template D). Rows group inside a soft card; each
   row is a list row (leading icon-tile · label + optional subtitle · trailing
   chevron/badge/switch). Works for links and buttons alike; thumb-friendly.
   ========================================================================== */

@layer components {
  .menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface-raised);
    border: var(--border-width) solid color-mix(in oklab, var(--color-border) 55%, transparent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  .menu-list > li + li { border-block-start: var(--border-width) solid var(--color-border); }

  .menu-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    inline-size: 100%;
    min-block-size: var(--touch-target);
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: 0;
    font-size: var(--text-base);
    color: var(--color-text);
    text-decoration: none;
    text-align: start;
    cursor: pointer;

    &:hover { background: var(--surface-sunken); }
    &:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  }

  /* A settings row whose control is the trailing switch — the row itself is
     not tappable, so it gets no hover/pointer affordance. */
  .menu-list__item--switch,
  .menu-list__item--static { cursor: default; }
  .menu-list__item--switch:hover,
  .menu-list__item--static:hover { background: none; }
  /* A read-only row's subtitle can wrap to a second line (it's content). */
  .menu-list__item--static .menu-list__sub { white-space: normal; }

  /* button_to wraps the button in a form — let it span the row. */
  form:has(> .menu-list__item--full) { display: contents; }

  .menu-list__label { flex: 1; display: flex; flex-direction: column; gap: var(--space-3xs); min-inline-size: 0; }
  .menu-list__sub { font-size: var(--text-sm); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-list__chevron { color: var(--color-text-muted); flex: 0 0 auto; }

  /* Dusk section label: small tracked caps ("NOTIFICATIONS", "YOUR TEAMS"). */
  .menu-section-title {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
  }

  /* Identity card at the top of the More surface: avatar · name/email · role. */
  .account-card { display: flex; align-items: center; gap: var(--space-sm); }
  .account-card__text { display: flex; flex-direction: column; min-inline-size: 0; }
  .account-card__name { font-weight: var(--weight-medium); }
  .account-card__email { font-size: var(--text-sm); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-card__role { margin-inline-start: auto; flex: 0 0 auto; }
}
