/*
 * mlp-sidebar styles. Import after platform.css, same convention as mlp-forms — reuses its
 * tokens (--c-*, --s-*, --shadow, --radius-sm). This is the panel *mechanism* only: width,
 * background, and the responsive collapse-into-a-drawer behavior. Content sections inside it
 * (brand, nav, account — or whatever a second sidebar holds) are the consuming page's own CSS.
 * The dropdown-menu mechanism this package's own account/app-switcher menus use lives in
 * mlp-dropdown-menu.css now, not here — see that package's README for why it moved out.
 */

.mlp-sidebar {
  width: 15rem;
  flex-shrink: 0;
  /* Pinned to the viewport, not stretched to match a tall content column — a flex row's
   * align-items: stretch (the default) makes every item as tall as the tallest one, which
   * would otherwise push anything anchored to the sidebar's bottom (margin-top: auto) down
   * past the fold on any page with a long form. overflow-y lets the sidebar's own content
   * scroll independently if it's ever taller than the viewport, rather than growing the page. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
}

.mlp-sidebar-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mlp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 80%;
    max-width: 18rem;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.15s ease;
    box-shadow: var(--shadow);
  }

  .mlp-sidebar.mlp-sidebar--open {
    transform: translateX(0);
  }

  .mlp-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: var(--s-3);
    left: var(--s-3);
    z-index: 25;
    width: 2.5rem;
    height: 2.5rem;
    margin: var(--s-3) 0 0 var(--s-3);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    /* Native <button> text color doesn't follow the page's color scheme on its own — without
       this, the icon (fill: currentColor) stayed browser-default black even in dark mode,
       against this button's dark var(--c-surface) background. */
    color: var(--c-text);
    font-size: var(--t-md);
    cursor: pointer;
  }
}

