/* Styles the static /papers/* subject & component pages generated by
 * scripts/build-subject-pages.js. These pages deliberately ship no JS (see
 * that script's header comment), so this is a small, self-contained
 * stylesheet — not a build-time slice of the app's own bundle, which would
 * need the app's hashed asset filename to be known before Vite has produced
 * it. Colors/radius below are hand-copied from packages/ui/src/tokens.css's
 * literal values (not imported — tokens.css pulls in the IBM Plex Sans
 * webfont via a bare package specifier, which only resolves through Vite's
 * bundler, not as a plain static file); update both if the palette changes.
 * Font is a plain system stack rather than the site's webfont, on purpose:
 * these are lightweight companion pages, not the app shell. */

:root {
  --pp-bg: hsl(0 0% 98%);
  --pp-card: hsl(0 0% 100%);
  --pp-fg: hsl(0 0% 6%);
  --pp-fg-muted: hsl(0 0% 40%);
  --pp-primary: hsl(243 75% 59%);
  --pp-primary-fg: hsl(0 0% 100%);
  --pp-border: hsl(0 0% 90%);
  --pp-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pp-bg: hsl(0 0% 6%);
    --pp-card: hsl(0 0% 10%);
    --pp-fg: hsl(0 0% 94%);
    --pp-fg-muted: hsl(0 0% 65%);
    --pp-primary: hsl(239 84% 67%);
    --pp-primary-fg: hsl(0 0% 100%);
    --pp-border: hsl(0 0% 18%);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--pp-bg);
  color: var(--pp-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: var(--pp-primary);
}

.pp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--pp-border);
}

.pp-brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--pp-fg);
}

.pp-brand span {
  font-weight: 400;
  color: var(--pp-fg-muted);
}

.pp-header-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pp-header-links a:not(.pp-btn) {
  text-decoration: none;
  color: var(--pp-fg);
}

.pp-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--pp-radius);
  text-decoration: none;
  font-weight: 600;
}

.pp-btn-primary {
  background: var(--pp-primary);
  color: var(--pp-primary-fg);
}

.pp-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.pp-breadcrumb {
  font-size: 0.875rem;
  color: var(--pp-fg-muted);
  margin-bottom: 1rem;
}

.pp-breadcrumb a {
  text-decoration: none;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 1rem;
}

.pp-lead {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.pp-intro {
  color: var(--pp-fg-muted);
  margin: 0 0 1.5rem;
}

.pp-freshness {
  color: var(--pp-fg-muted);
  font-size: 0.85rem;
  margin: 1.5rem 0 0;
}

.pp-component-list,
.pp-chapter-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pp-component-list li,
.pp-chapter-list li {
  padding: 0;
  background: var(--pp-card);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius);
  overflow: hidden;
}

/* Whole-card link: earlier versions of these pages wrapped only the label in
 * <a>, leaving a small real tap target inside a visually full-width card —
 * the anchor now wraps the entire <li> content, so the whole card is
 * clickable/tappable, not just the text. */
.pp-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--pp-fg);
}

.pp-card-link:hover {
  background: var(--pp-bg);
}

.pp-card-meta,
.pp-chapter-meta {
  color: var(--pp-fg-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.pp-subtopics-label {
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.pp-subtopics-list {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  color: var(--pp-fg-muted);
}

.pp-subtopics-list li {
  margin-bottom: 0.25rem;
}

.pp-cta {
  display: inline-block;
  font-size: 1.05rem;
}

.pp-cta-top {
  margin-bottom: 1.5rem;
}

.pp-notfound {
  text-align: center;
  padding: 3rem 0;
}

.pp-notfound h1 {
  margin-bottom: 1rem;
}

.pp-notfound .pp-intro {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
}

.pp-footer {
  border-top: 1px solid var(--pp-border);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--pp-fg-muted);
}

.pp-footer-copy {
  margin: 0;
}

.pp-footer-links {
  display: flex;
  gap: 1rem;
}

.pp-footer-links a {
  text-decoration: none;
  color: var(--pp-fg-muted);
}
