/**
 * Reusable A-Z filter bar (.alpha-bar / .alpha-btn).
 *
 * Used on the countries listing, health-topics A-Z view, and any other
 * letter-grid filter UI. Decoupled so it can be attached independently
 * via the who26/alpha-bar library — pages that don't need the rest of
 * health-topics CSS still get correct button styling.
 */

.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

.alpha-btn {
  /* Reset native <button> chrome (outset 3D border, OS background) */
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;

  background: var(--who-white);
  border: 1px solid var(--who-gray-300);
  border-radius: var(--who-radius-sm);

  font-size: 14px;
  font-weight: 700;
  color: var(--who-navy);
  text-decoration: none;
  line-height: 1;

  transition: background var(--who-transition),
              color var(--who-transition),
              border-color var(--who-transition);
}

/* "All" pill is wider to fit the label */
.alpha-btn[data-filter="all"] {
  width: auto;
  padding: 0 14px;
}

.alpha-btn:hover,
.alpha-btn:focus-visible {
  background: var(--who-blue);
  color: var(--who-white);
  border-color: var(--who-blue);
  text-decoration: none;
  outline: none;
}

.alpha-btn.active,
.alpha-btn[aria-pressed="true"] {
  background: var(--who-navy);
  color: var(--who-white);
  border-color: var(--who-navy);
}

.alpha-btn:disabled,
.alpha-btn.is-disabled {
  opacity: .35;
  pointer-events: none;
}

/* Countries-specific tweak: tighten margin under the bar on mobile so
   the grid starts closer when the page header is also compact. */
@media (max-width: 480px) {
  .countries-alpha-bar {
    gap: 4px;
  }
  .countries-alpha-bar .alpha-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}
