/* AV tag: the standard look for a tune's tag (Pages/Shared/_TuneTag.cshtml).
   Three roles, told apart by shape (docs/design-system.md, Tags):
   - .av-tag             a label you can't click: a teal pill.
   - .av-tag--clickable  a <button> that filters the tune list: same teal, but the 4px
                         button radius and a darker outline, so it reads as a button.
   - .av-tag--active     a filter that's on, above the list: drawn like the filter tag
                         that turned it on (4px radius, outline, hard shadow), with its
                         own square remove button (.av-tag__remove). Not a pill: it holds
                         a button, and pills are only for things you can't click.

   Bootstrap's reboot (button font-size and line-height: inherit) and button.css (a
   full-size shadow on every <button>) load outside the cascade layers, and unlayered
   rules beat layered ones, so the button versions need !important on those properties
   until Bootstrap moves into its layer (docs/design-system.md, Known debt). */
@layer components {
  .av-tag {
    display: inline-block;
    max-width: 100%;
    padding: 0.25em 0.6em;
    border: 0;
    border-radius: var(--av-pill-radius);
    background: var(--av-tag-bg);
    color: var(--av-tag-text);
    font-size: 75%;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    vertical-align: middle;
  }

  .av-tag--clickable {
    display: inline-flex;
    align-items: center;
    min-height: 24px;                 /* WCAG 2.2 AA target size */
    border: 1px solid var(--av-tag-clickable-border);
    border-radius: var(--av-btn-radius);
    background: var(--av-tag-clickable-bg);
    box-shadow: 1px 1px 0 rgba(15, 23, 42, 0.18) !important;
    font-size: 75% !important;
    line-height: 1.2 !important;
    font-family: inherit;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease;
  }

  .av-tag--clickable:hover {
    background: var(--av-tag-clickable-bg-hover);
    transform: scale(1.06);
  }

  .av-tag--clickable:focus-visible {
    outline: 2px solid var(--av-ghost-focus, #176269);
    outline-offset: 2px;
  }

  .av-tag--active {
    display: inline-flex;
    align-items: center;
    gap: 0.15em;
    min-height: 24px;
    padding-right: 0.15em;
    border: 1px solid var(--av-tag-clickable-border);
    border-radius: var(--av-btn-radius);
    background: var(--av-tag-clickable-bg);
    box-shadow: 1px 1px 0 rgba(15, 23, 42, 0.18);
  }

  /* A real button with a 28px hit area, though the icon is small. */
  .av-tag__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    margin: -0.4em -0.1em -0.4em 0;
    padding: 0;
    border: 0;
    border-radius: var(--av-btn-radius);
    background: transparent;
    box-shadow: none !important;
    color: inherit;
    font-size: inherit;
    line-height: 1;
    cursor: pointer;
  }

  .av-tag__remove:hover {
    background: rgba(15, 23, 42, 0.12);
  }

  .av-tag__remove:focus-visible {
    outline: 2px solid var(--av-ghost-focus, #176269);
    outline-offset: 1px;
  }

  .av-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
}
