@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
/* Compound family aggregation: importing `cinder/side-navigation/styles` pulls
 * in SideNavigationGroup and NavigationItem. SideNavigationItem delegates its
 * rendering to NavigationItem, so its styles must be included here.
 * Sibling-leaf paths resolve identically in `src/` and the verbatim-copied
 * `dist/` because the layout mirrors. */
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/side-navigation-group/side-navigation-group.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/navigation-item/navigation-item.css';
@import '/assets/f47cf25678047dc1d0c5372c25b330b4ffdf35604610caa62c68ff9ad26b877e/components/side-navigation-item/side-navigation-item.css';

@layer cinder.components {
  /* ========================================
 * SIDE NAVIGATION
 * ======================================== */

  .cinder-side-navigation {
    display: block;
  }

  .cinder-side-navigation__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--cinder-side-navigation-list-gap, var(--cinder-space-1));
  }

  /* ----------------------------------------
 * Brand and primary action (COR-2315)
 *
 * Two slots above the list. The brand is the product's name or mark, padded to line up with the
 * rows. The primary action is the one thing the product leads with, drawn as a neutral control
 * the width of the sidebar: a leading accent "+", the label, and the shortcut glyph at the
 * trailing edge as plain text with no key cap. It is deliberately not an accent slab: the accent
 * is for the "+" alone.
 * ---------------------------------------- */

  .cinder-side-navigation__brand {
    display: flex;
    align-items: center;
    min-block-size: max(var(--cinder-shell-header-height), var(--_cinder-painted-height-md));
    min-inline-size: 0;
    padding-inline: var(--cinder-space-2);
  }

  .cinder-side-navigation__brand > * {
    flex: 1 1 auto;
    min-inline-size: 0;
  }

  .cinder-side-navigation__primary-action {
    padding-block-end: var(--cinder-space-3);
  }

  .cinder-side-navigation__brand + .cinder-side-navigation__primary-action {
    padding-block-start: var(--cinder-space-2);
  }

  .cinder-side-navigation__primary-action > :is(a, button) {
    display: flex;
    align-items: center;
    inline-size: 100%;
    box-sizing: border-box;
    gap: var(--cinder-space-2);
    min-block-size: max(2rem, var(--cinder-list-row-min-height));
    padding-block: 0;
    /* The trailing shortcut needs more breathing room than the leading plus and label group.
     * Keep the leading row alignment while making the key inset at least 1.5 times the compact
     * face's vertical room. Logical sides preserve that proportion in RTL. */
    padding-inline: var(--cinder-space-2) var(--cinder-space-3);
    border: 1px solid var(--cinder-border);
    border-radius: var(--cinder-radius-sm);
    background: var(--cinder-surface-raised);
    color: var(--cinder-text-default);
    font: inherit;
    font-size: var(--cinder-text-sm);
    font-weight: var(--cinder-font-medium);
    line-height: 1.25rem;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
  }

  .cinder-side-navigation__primary-action > :is(a, button)::before {
    flex: none;
    /* The alternative text after the slash keeps the glyph out of the accessible name where the
     * browser supports it; the line above is the fallback where it does not. */
    content: '+';
    content: '+' / '';
    color: var(--cinder-accent-text);
    font-size: var(--cinder-text-base);
    font-weight: var(--cinder-font-semibold);
    line-height: 1;
  }

  .cinder-side-navigation__primary-action > :is(a, button) [data-cinder-shortcut] {
    margin-inline-start: auto;
    color: var(--cinder-text-subtle);
    font-size: var(--cinder-text-sm);
    font-weight: var(--cinder-font-normal);
    /* Plain text: no key cap, border or fill. */
    background: none;
    border: none;
    padding: 0;
  }

  /* On a touch screen the face stays 2rem and the 44px tap is a positioned pseudo-element that
   * takes no layout space, as a Button's does (the `+` already owns `::before`). The key hint has
   * no key to press, so it goes. */
  @media (pointer: coarse) {
    .cinder-side-navigation__primary-action > :is(a, button) {
      position: relative;
      min-block-size: 2rem;
    }

    .cinder-side-navigation__primary-action > :is(a, button)::after {
      content: '';
      position: absolute;
      inset-block: min(0px, calc((100% - var(--cinder-touch-target-min)) / 2));
      inset-inline: 0;
    }
  }

  @media (hover: none) {
    .cinder-side-navigation__primary-action > :is(a, button) [data-cinder-shortcut] {
      display: none;
    }
  }

  @media (hover: hover) {
    .cinder-side-navigation__primary-action > :is(a, button):hover {
      background: var(--cinder-surface-raised-hover);
    }
  }

  .cinder-side-navigation__primary-action > :is(a, button):focus-visible {
    outline: var(--cinder-ring-width) solid transparent;
    box-shadow: inset 0 0 0 var(--cinder-ring-width) var(--cinder-ring-color);
  }

  @media (forced-colors: active) {
    .cinder-side-navigation__primary-action > :is(a, button):focus-visible {
      outline: var(--cinder-ring-width) solid ButtonText;
      outline-offset: calc(var(--cinder-ring-width) * -1);
    }
  }

  /* ----------------------------------------
 * Item wrapper <li> — reset list styles
 *
 * Vertical geometry (square rows, inline-start active border) now lives
 * on `.cinder-navigation-item[data-variant='vertical']` in `navigation-item.css`.
 * `SideNavigationItem` forces `variant="vertical"` on its inner item, so no
 * ancestor-specificity overrides are needed here.
 * ---------------------------------------- */

  /* The list's own gap sets the pitch between rows, so the global `li` margin does not add to it. */
  .cinder-side-navigation__item {
    list-style: none;
    margin: 0;
  }
}
