/* Tabs side by side in a track, the open one raised. A tab can say how many things are chosen on it in its top right
   corner, over its edge, so showing the count doesn't change its width */
.tabs {
  display: flex;
  gap: var(--space-1);
  width: fit-content;
  padding: var(--space-1);

  background-color: var(--card-bg-color);
  border-radius: var(--radius-m);
}

.tab {
  position: relative;
  padding: var(--space-1) var(--space-3);

  color: var(--meta-text-color);
  background: none;
  border-radius: calc(var(--radius-m) - var(--space-1));
  cursor: pointer;

  transition: color 0.2s ease-out, background-color 0.2s ease-out;

  @media (hover: hover) {
    &:hover {
      color: var(--text-color);
    }
  }

  &[aria-selected="true"] {
    color: var(--text-color);
    background-color: var(--bg-color);

    /* Its shadow gives way to the focus ring */
    &:not(:focus-visible) {
      box-shadow: 0 1px 4px var(--drop-shadow-color);
    }
  }
}

/* Above the tab after it, which would otherwise cover it once it's the open one */
.tab .count-badge {
  position: absolute;
  z-index: 1;
  top: calc(-1 * var(--space-2));
  right: calc(-1 * var(--space-2));
}
