/*
 * assets/css/list.css
 * Owner: feat/taxonomy-pages (RFC 1.3, 1.5, 1.6)
 *
 * Styles for:
 *   _layouts/tag.html     — /tags/<slug>/ listing + pagination
 *   _layouts/archive.html — /archive/ year-grouped timeline
 *
 * RULE: ALL colours MUST use CSS custom-property tokens from theme.css.
 *       NO hardcoded colour values.
 */

/* =========================================================================
   Shared utilities
   ========================================================================= */

/* Tag chip — small inline label linking to a tag page */
.tag-chip {
  display: inline-block;
  padding: 0.1em 0.55em;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--surface);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tag-chip:hover,
.tag-chip:focus {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
/* Active chip — the current page's own tag */
.tag-chip--active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* =========================================================================
   Tag page (_layouts/tag.html)
   ========================================================================= */

.tag-page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* --- Header --- */
.tag-page__header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}
.tag-page__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 0.35rem;
}
.tag-page__blurb {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}
.tag-page__meta {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* --- Empty state --- */
.tag-page__empty {
  padding: 3rem 0;
  text-align: center;
}
.tag-page__empty-msg {
  color: var(--fg-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.tag-page__empty-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.tag-page__empty-link:hover {
  text-decoration: underline;
}

/* --- Post list --- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}
.post-list__item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list__item:first-child {
  border-top: 1px solid var(--border);
}
.post-list__date {
  flex-shrink: 0;
  width: 6.5rem;
  font-size: 0.82rem;
  color: var(--fg-muted);
  padding-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}
.post-list__body {
  flex: 1;
  min-width: 0;
}
.post-list__title {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}
.post-list__title:hover,
.post-list__title:focus {
  color: var(--accent);
  text-decoration: none;
}
.post-list__excerpt {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin: 0 0 0.45rem;
  line-height: 1.5;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-list__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

/* --- Numeric pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.pagination__btn:hover,
.pagination__btn:focus {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.pagination__btn--current {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
  cursor: default;
}
.pagination__btn--current:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.pagination__btn--disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* =========================================================================
   Archive page (_layouts/archive.html)
   ========================================================================= */

.archive-page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.archive-page__header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}
.archive-page__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 0.25rem;
}
.archive-page__meta {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* --- Year section --- */
.archive-year {
  margin-bottom: 2rem;
}
.archive-year__heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

/* --- Archive list --- */
.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.archive-list__item {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.archive-list__item:first-child {
  border-top: 1px solid var(--border);
}
.archive-list__date {
  flex-shrink: 0;
  width: 3.2rem;
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.archive-list__title {
  flex: 1;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
  line-height: 1.4;
}
.archive-list__title:hover,
.archive-list__title:focus {
  color: var(--accent);
  text-decoration: none;
}
.archive-list__tags {
  flex-shrink: 0;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

/* =========================================================================
   Responsive adjustments
   ========================================================================= */
@media (max-width: 576px) {
  .post-list__item {
    flex-direction: column;
    gap: 0.3rem;
  }
  .post-list__date {
    width: auto;
    font-size: 0.78rem;
  }
  .archive-list__tags {
    display: none;  /* keep rows compact on tiny screens */
  }
  .tag-page__title,
  .archive-page__title {
    font-size: 1.6rem;
  }
}
