/* pages/hub_list.html — hub list rows: row box, layout, and the hover swap from title
   to description. Typography: partials/hub-common.css. */

.hub-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
}

.hub-row__text {
  display: grid;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
}

.hub-row__desc {
  text-wrap: pretty;
}

/* As on the cards, hover swaps the title for the description; level and arrow stay put */
@media (hover: hover) {
  .hub-row__title,
  .hub-row__desc {
    grid-area: 1 / 1;
    transition: opacity 0.2s ease;
  }

  /* Hidden descriptions stay out of the row height until hover. */
  .hub-row__desc {
    height: 0;
    min-height: 0;
    overflow: hidden;
    opacity: 0;
  }

  .hub-row:has(.hub-row__desc):hover .hub-row__title,
  .hub-row:has(.hub-row__desc):focus-visible .hub-row__title {
    opacity: 0;
  }

  .hub-row:hover .hub-row__desc,
  .hub-row:focus-visible .hub-row__desc {
    height: auto;
    overflow: visible;
    opacity: 1;
  }
}
