/* ─────────────────────────────────────────────────────────────────────────
   Holon tabs — the tab bar under a holon page's header (METIS-pub#744)

     .holon-tabs           the bar: one row of links, scrolling sideways
                           when it does not fit (never wrapping, never
                           widening the page)
     .holon-tabs__tab      one tab, a plain link (?tab=<slug>)
     .holon-tabs__tab[aria-current="page"]
                           the active tab: accent underline, strong text
     .holon-tabs__icon     the tab's icon, before its label (METIS-pub#826:
                           every tab carries one)
     .holon-tabs__label    the tab's name; on a phone an unlit tab hides it
                           (kept for a screen reader, and as its title), so
                           the row is icons with the lit tab named
     .holon-tabs__count    the number beside a tab's label

   One look for every tab, whichever app owns it (METIS-pub#826 m2): an
   inactive tab is untinted text, the active tab is the accent underline.
   An app's tab used to carry its app's tint ([data-app-group]), which made
   inactive tabs look selected and the active one a filled block on some
   pages and an underline on others. The tab's name says what it opens.

   Drawn by crm/holon/partials/_holon_tabs.html for a class whose config sets
   `tabs` (holon_detail_sections.class_tabs). Platform tier: the tab bar is
   the holon page's, whichever app owns the class, so it reads the accent the
   page's app theme sets. No literal colour, size, radius or duration.
   ───────────────────────────────────────────────────────────────────────── */

@layer components {
  .holon-tabs {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .holon-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex: none;
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--color-text-muted);
    /* #786: the tabs read at the page's text size, not 10.5px (METIS-pub#793). */
    font-size: var(--text-lg);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
  }

  .holon-tabs__tab:hover { color: var(--color-text); }

  .holon-tabs__tab[aria-current="page"] {
    color: var(--color-text-strong);
    border-bottom-color: var(--color-accent);
  }

  .holon-tabs__icon {
    flex: none;
    width: var(--text-lg);
    height: var(--text-lg);
  }

  .holon-tabs__count {
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    background: var(--color-surface-2);
    color: var(--color-text-muted);
    font-size: var(--text-md);
    font-weight: 600;
  }

  /* A phone (METIS-pub#826): every tab would not fit by name, so an unlit
     tab is its icon, at least a finger wide, its name the tooltip and the
     screen reader's; the lit tab keeps its name, so the row says where you
     are. The same clip as .visually-hidden (visually-hidden.css). */
  @media (max-width: 767px) {
    .holon-tabs { gap: var(--space-1); }

    .holon-tabs__tab:not([aria-current="page"]) {
      position: relative;
      justify-content: center;
      min-width: 44px;
    }

    .holon-tabs__tab:not([aria-current="page"]) .holon-tabs__label {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
      clip-path: inset(50%);
      white-space: nowrap;
      border: 0;
    }
  }
}
