/* The industry switch (site/snippets/blocks/indswitch.php,
   public/assets/js/indswitch.js): one quiet row of pill chips on the
   section's background, near the top of each Search funnel page. The
   pressed chip is mint with the 1px ink line; 44px touch height; the row
   wraps on phones (no sideways scroll). Linked in the head by the block
   (peanut_page_css). Every selector names an indswitch class (the section
   rules name the block's own section class too). Tokens only.

   The chips only work with the script, so the strip stays invisible until
   the script adds .is-live: visibility keeps its space, so nothing moves
   when it shows. Where scripting is off, and in print, the section is
   gone and the neutral text stands. */

@layer blocks {
  /* a slim strip, not a full section */
  .section.block-indswitch {
    padding-block: var(--space-4);
  }

  /* After In short (the tier pages, 2026-11-28): the switch opens with its own 1px line, so it is a
     band of its own and keeps its top padding even after a section on the same background (blocks.css
     drops it for two same-background sections in a row), and it takes In short's column so the label
     and the chips line up with the box above them */
  .has-accent .section + .section.block-indswitch {
    padding-block-start: var(--space-4);
  }

  .section.block-inshort + .section.block-indswitch .indswitch {
    max-width: 48rem;
    margin-inline: auto;
  }

  .indswitch:not(.is-live) {
    visibility: hidden;
  }

  .indswitch__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
  }

  .indswitch__label {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-caps);
    line-height: 1.6;
    text-transform: uppercase;
  }

  .indswitch__hint {
    margin: 0;
  }

  .indswitch__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    flex: 1 1 100%;
    min-width: 0;
  }

  .indswitch__chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    max-width: 100%;
    margin: 0;
    padding: 0.5rem 1rem;
    background: transparent;
    border: var(--border);
    border-radius: var(--radius-pill);
    color: inherit;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: start;
    overflow-wrap: anywhere;
    cursor: pointer;
  }

  .indswitch__chip:hover {
    background: var(--color-white);
  }

  .indswitch__chip[aria-pressed="true"] {
    background: var(--color-brand);
    color: var(--color-ink);
  }

  .indswitch__chip:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .section--white .indswitch__chip:hover {
    background: var(--color-paper);
  }

  .section--ink .indswitch__chip {
    border-color: var(--color-white);
  }

  .section--ink .indswitch__chip:hover {
    background: var(--color-on-ink-fill);
  }

  .section--ink .indswitch__chip[aria-pressed="true"] {
    border-color: var(--color-ink);
  }

  @media (min-width: 64rem) {
    .indswitch__chips {
      flex: 1 1 auto;
    }
  }

  @media (scripting: none) {
    .section.block-indswitch {
      display: none;
    }
  }

  @media print {
    .section.block-indswitch {
      display: none;
    }
  }
}
