/* /categories and /categories/{leaf}. Mobile rule from design.md §5: no sideways page
   scroll, tables scroll inside .table-scroll with a sticky first column, the sidebar
   stacks under the main column below 760px.
   Colours and fonts come only from application.css: .category-card is the dark panel,
   .data-table the table, var(--…) everything else. Layout is the only thing set here. */

.categories-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.categories-intro,
.category-subtitle {
  font-size: 1.1rem;
  color: var(--dark-gray);
  max-width: 70ch;
}

.category-parent {
  margin-top: 2.5rem;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.category-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.category-card-description {
  color: var(--dark-gray);
  margin: 0 0 0.5rem;
}

.category-card-count {
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.category-card-products {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
}

.category-leaves {
  margin-top: 3rem;
}

.category-leaf-list {
  columns: 2;
  padding-left: 1.1rem;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--dark-gray);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.35rem;
}

.category-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 2rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.table-scroll th,
.table-scroll td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  vertical-align: top;
  white-space: nowrap;
}

/* .data-table drops the border on a tr:last-child, which the lone thead row is. */
.table-scroll thead th {
  border-bottom: 1px solid var(--border-color);
}

.table-scroll th:first-child,
.table-scroll td:first-child {
  position: sticky;
  left: 0;
  background: var(--app-bg);
}

.pill {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  margin: 0 0.25rem 0.25rem 0;
  border-radius: 999px;
  background: var(--panel-header);
  color: var(--text-color);
  font-size: 0.8rem;
  white-space: nowrap;
}

.category-about,
.category-faq {
  margin-top: 2.5rem;
}

.category-faq h3 {
  margin: 1.25rem 0 0.25rem;
  font-size: 1.05rem;
}

.category-sidebar ul {
  padding-left: 1.1rem;
}

@media (max-width: 760px) {
  .category-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .category-leaf-list {
    columns: 1;
  }
}
