/**
 * Fiches age menu: links between the age pages of a fiches homepage.
 *
 * Only enqueued on "Page fiches" pages whose parent is a fiches homepage.
 */

.fiches-age-menu {
  margin-block-end: 1.5rem;
  /* Scroll sideways on small screens instead of wrapping. */
  overflow-x: auto;
}

.fiches-age-menu__list {
  display: flex;
  justify-content: center;
  gap: 2rem;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0 1rem;
  list-style: none;
}

.fiches-age-menu__link {
  display: inline-block;
  padding-bottom: 0.25rem;
  color: var(--text-color);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  /* Same center-growing underline as the homepage tiles. */
  background-image: linear-gradient(currentColor, currentColor);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  transition: background-size 0.3s ease;

  &:hover,
  &:focus-visible,
  &.is-active {
    color: var(--color-primary);
    background-size: 100% 2px;
    text-decoration: none;
  }

  &:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fiches-age-menu__link {
    transition: none;
  }
}
