/*
 * Bottom navigation: the bar fixed to the bottom of the screen on phones,
 * with a link on each side and the Add button in the middle.
 *
 *   <nav class="bottom-nav" aria-label="Main">
 *     <a class="bottom-nav__item" href="…">Notes</a>
 *     <button class="bottom-nav__add" commandfor="add-menu" command="show-modal" aria-label="Add"><svg class="icon">…</svg></button>
 *     <a class="bottom-nav__item" href="…">Vocab</a>
 *   </nav>
 */
@layer components {
  .bottom-nav {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 1000;
    display: flex;
    align-items: stretch;
    block-size: var(--nav-height);
    background: var(--color-surface);
    border-block-start: 1px solid var(--color-border);
    box-shadow: var(--shadow-overlay);
  }

  /* Keep the end of the page clear of the fixed bar */
  body:has(.bottom-nav) { padding-block-end: var(--nav-height); }

  .bottom-nav__item,
  .bottom-nav__add {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-subtle);
    background: none;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--duration-fast), background-color var(--duration-fast);

    &:hover { background: var(--color-bg); color: var(--color-accent); }
  }

  .bottom-nav__item { flex: 1; font-weight: 600; }

  .bottom-nav__add {
    flex: 0 0 var(--nav-height);
    --icon-size: var(--text-lg);

    color: var(--color-accent);
  }
}
