/*
 * News page additions.
 *
 * Builds on the .patch-list / .patch-entry rules in site.css (they
 * style the home-page changelog already). Anything here is only for
 * the long-form /news page: list head subtitle, multi-paragraph
 * summary spacing, pagination strip, empty state.
 *
 * Token sources (declared in site.css :root):
 *   --accent, --ink-deep, --text, --text-muted, --border, --surface.
 * No new tokens introduced.
 */

/* Section wrapper. The hero handles its own spacing; we just need
 * breathing room below it and above the footer. */
.news-list-section {
  padding: 3rem 0 5rem;
}

@media (min-width: 768px) {
  .news-list-section {
    padding: 4.5rem 0 6rem;
  }
}

/* Header strip above the list: shows page x of y + last-patched line. */
.news-list-head {
  margin-bottom: 2rem;
}

.news-list-sub {
  color: var(--text-muted, #b8b8b8);
  font-size: 0.9375rem;
  margin: 0.5rem 0 0;
}

.news-last-ago {
  color: var(--text-muted, #b8b8b8);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  opacity: 0.85;
}

/* The list itself. Inherits .patch-list/.patch-entry from site.css;
 * only the news-specific overrides go here. */
.news-patch-list {
  max-width: 56rem;
}

.news-entry {
  /* Slightly more vertical room than the home-page condensed list,
   * because the long list benefits from clearer per-entry rhythm. */
  padding-block: 1.25rem;
}

.news-entry-coder {
  color: var(--text-muted, #b8b8b8);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.4rem 0;
}

/* Summary paragraphs. Multi-paragraph entries (rare but real) need
 * the inter-paragraph spacing site.css's `.patch-entry p` doesn't
 * provide on its own (it sets margin: 0). */
.news-entry-summary {
  color: var(--text, #ebe9e4);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin: 0;
}

.news-entry-summary + .news-entry-summary {
  margin-top: 0.65rem;
}

/* Empty-state copy when changes.dat is unreadable. */
.news-empty {
  background: var(--surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 0.5rem;
  color: var(--text-muted, #b8b8b8);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
}

.news-empty code {
  background: rgba(241, 108, 10, 0.08);
  border-radius: 0.25rem;
  color: var(--accent, #F16C0A);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  padding: 0.1rem 0.4rem;
}

.news-empty a {
  color: var(--accent, #F16C0A);
  border-bottom: 1px solid currentColor;
  text-decoration: none;
}

.news-empty a:hover { opacity: 0.85; }

/* Pagination strip. Three columns on desktop; stacks on mobile. */
.news-pagination {
  align-items: center;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 2.5rem;
  padding-top: 2rem;
}

.news-pager {
  color: var(--text, #ebe9e4);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 120ms ease;
}

a.news-pager:hover,
a.news-pager:focus-visible {
  color: var(--accent, #F16C0A);
}

a.news-pager:focus-visible {
  outline: 2px solid var(--accent, #F16C0A);
  outline-offset: 4px;
  border-radius: 0.25rem;
}

.news-pager-newer { justify-self: start; }
.news-pager-older { justify-self: end; }

.news-pager-disabled {
  color: var(--text-muted, #b8b8b8);
  cursor: default;
  opacity: 0.4;
}

.news-pager-status {
  color: var(--text-muted, #b8b8b8);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
}

.news-pager-status strong {
  color: var(--text, #ebe9e4);
  font-weight: 700;
}

@media (max-width: 540px) {
  .news-pagination {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .news-pager-newer,
  .news-pager-older,
  .news-pager-disabled { justify-self: center; }
}

/* Screen-reader-only utility used by the h2. Matches the
 * .visually-hidden pattern from site.css (kept duplicate here so
 * the file is self-contained if site.css ever loses the rule). */
.news-list-head .visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
