/* 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. */

.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);
}

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

.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;
  }
}
