/* The Listen unit's tabs (STYLING.md › The Listen unit's tabs): the band's
   last row on a Listen and on its paired fill-in, Listen | Fill in the gaps.
   A row of links: each tab loads the other post, and the current one carries
   aria-current="page". The selected tab's underline sits on the band's own
   hairline, so the row closes the band. */

/* The band ends on the tab row, not on the 12px of air under the controls. */
.pp-single-header__inner:has(> .pp-listen-unit-tabs) {
  padding-bottom: 0;
}

.pp-listen-unit-tabs {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 4px;
  /* Over the band's hairline, so the current tab's 2px underline covers it. */
  margin-bottom: -1px;
}

/* 4px under the controls row, whose 44px boxes already hold about 10px of
   air under their glyphs: the column's 12px gap less 8px. */
.pp-single-header__controls + .pp-listen-unit-tabs {
  margin-top: -8px;
}

.pp-listen-unit-tabs__tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0;
  /* At rest the border is transparent, so selecting shifts nothing. */
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.2;
  /* --pp-steel-5, not the panel tabs' --pp-steel-4, which is under AA on the
     Listen band (3.01:1); steel-5 is 4.91:1 there. */
  color: var(--pp-steel-5);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.pp-listen-unit-tabs__tab:hover {
  color: var(--pp-steel-7);
  text-decoration: none;
}

.pp-listen-unit-tabs__tab[aria-current="page"] {
  font-weight: 600;
  color: var(--theme-palette-color-5);
  border-bottom-color: var(--theme-palette-color-5);
}

.pp-listen-unit-tabs__tab:focus-visible {
  outline: 2px solid var(--pp-focus-ring);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Switching tabs crossfades the two pages (a cross-document view transition,
   the browser's own 0.25s ease, the slower-reveal step). Both pages opt in;
   listen-unit.php skips it for any navigation that is not between the two
   tabs. The band and the top are the same on both pages, so only the card
   below them visibly changes. Off under reduced motion, where the tab loads
   as any page does. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}
