/* Library index listing (Story 2.1): track disclosures (listing-directory /
   listing-lesson, DESIGN.md) and the posts section. Tokens only --
   references the custom properties tokens.css.njk already emits (same
   precedent as prose.css/lesson.css); no color, font-size, or spacing value
   already named by a token is restated as a literal here. Every row
   declares its own font-size and vertical padding to reach >=24px hit area
   (NFR20/SC 2.5.8) -- none of these rows inherit --font-meta-size at its
   natural (~19.5px) line height. */

/* Story 6.3 (CAP-11): filter-chip rows -- one for kind (Track/Essay/Note),
   one for topics, each rendered only when at least one present item would
   match it (src/_includes/partials/filter-chips.njk). Inert by default
   (plain <button>, no onclick) -- src/js/filter-chips.js is what gives a
   chip its click behavior; [aria-pressed] styling works identically whether
   or not that script has run. */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
  margin: var(--spacing-3) 0 0;
}

.filter-chip {
  min-height: 24px;
  padding: var(--spacing-1) var(--spacing-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-muted);
  font-family: inherit;
  font-size: var(--font-meta-size);
  line-height: var(--font-meta-line-height);
  cursor: pointer;
}

.filter-chip[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
}

.listing {
  margin: var(--spacing-6) 0 0;
}

.listing details {
  border-bottom: 1px solid var(--border-subtle);
}

/* listing-directory: a track row's summary -- accent disclosure marker,
   track name in fg at weight 500, fg-muted lesson count, divided by
   border-subtle (the details' own border-bottom, above). */
.listing summary {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-3);
  min-height: 24px;
  padding: var(--spacing-2) 2px;
  font-size: var(--font-meta-size);
  line-height: var(--font-meta-line-height);
  list-style: none;
  cursor: pointer;
}

.listing summary::-webkit-details-marker {
  display: none;
}

.listing summary::before {
  content: '\25B8';
  color: var(--accent);
  flex: 0 0 auto;
}

.listing details[open] > summary::before {
  content: '\25BE';
}

.listing-name {
  flex: 1 1 auto;
  color: var(--fg);
  font-weight: 500;
}

.listing-count {
  flex: 0 0 auto;
  color: var(--fg-muted);
}

.listing-updated {
  flex: 0 0 auto;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* listing-lesson: expanded lesson rows -- indented, border-subtle tree
   glyphs (aria-hidden, decoration only, never the sole signal of order --
   the visible index and title carry that), fg-muted index, accent title,
   fg-muted duration. */
.listing-kids {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--spacing-2) var(--spacing-6);
}

.listing-kid {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-2);
  min-height: 24px;
  padding: var(--spacing-2) 0;
  font-size: var(--font-meta-size);
  line-height: var(--font-meta-line-height);
}

.listing-tree {
  flex: 0 0 auto;
  color: var(--border-subtle);
}

.listing-index {
  flex: 0 0 auto;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.listing-title {
  flex: 1 1 auto;
}

.listing-title a {
  color: var(--accent);
}

.listing-duration {
  flex: 0 0 auto;
  color: var(--fg-muted);
}

/* Posts section -- omitted entirely by the template when empty, so this
   styling only ever applies when collections.postsByDate is non-empty. */
.sectionhead {
  font-size: var(--font-meta-size);
  font-weight: var(--font-h2-weight);
  margin: var(--spacing-8) 0 var(--spacing-2);
  padding-bottom: var(--spacing-2);
  border-bottom: 1px solid var(--border);
}

.postlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.postlist-row {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-3);
  min-height: 24px;
  padding: var(--spacing-2) 2px;
  font-size: var(--font-meta-size);
  line-height: var(--font-meta-line-height);
  border-bottom: 1px solid var(--border-subtle);
}

/* Story 6.3 review (2026-10-05): the UA `[hidden] { display: none }` rule
   loses to this row's own `display: flex` above -- author stylesheet beats
   UA stylesheet at equal specificity -- so without this override,
   filter-chips.js's setAttribute('hidden', '') on a non-matching row is a
   silent no-op and filtering does nothing. */
.postlist-row[hidden] {
  display: none;
}

.postlist-date {
  flex: 0 0 auto;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.postlist-kind {
  flex: 0 0 auto;
  color: var(--fg-muted);
}

.postlist-title {
  flex: 1 1 auto;
}

/* Below 640px (repo convention: max-width: 639px, same breakpoint
   lesson.css's .lesson-nav uses): listing rows drop the updated date,
   keeping name and lesson count (EXPERIENCE.md:180). */
@media (max-width: 639px) {
  .listing-updated,
  .postlist-date {
    display: none;
  }
}
