/* ─── /traits/ and /traits/<category>/<value> ─────────────────────────
   Generated pages (scripts/build-trait-pages.js); this is their only stylesheet
   beyond style.css + labels.css. Shared file so the 155 pages cache it once.

   Every link on these pages gets a colour here: style.css has no global `a`
   rule, and anything unstyled falls back to the browser's blue + underline. */

.tp { padding-top: calc(64px + var(--s-10)); padding-bottom: var(--s-20); }
.tp a { color: var(--gold-link); text-decoration: none; transition: color var(--t-base), border-color var(--t-base); }
.tp a:hover { color: var(--gold); }
.tp a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.tp-head { max-width: 900px; margin-bottom: var(--s-12); }
.tp-crumb { font-size: var(--fs-meta); color: var(--dim); margin-bottom: var(--s-8); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.tp-crumb a { color: var(--dim); }
.tp-crumb a:hover { color: var(--gold-link); }
.tp-crumb [aria-current] { color: var(--off-70); }
.tp-crumb-sep { color: var(--line-strong); }
.tp-head .eyebrow { margin-bottom: var(--s-4); }
.tp-title {
  font-family: var(--font-display); font-size: var(--fs-title); font-weight: 700;
  line-height: 1.02; color: var(--off); word-spacing: 0.12em; margin-bottom: var(--s-5);
  overflow-wrap: anywhere;
}
.tp-lead { font-size: var(--fs-heading); line-height: 1.7; color: var(--dim); max-width: 62ch; }
.tp-lead strong { color: var(--off); font-weight: 600; }
.tp-actions { margin-top: var(--s-8); display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.tp .btn-primary, .tp .btn-primary:hover { color: var(--bg); }

/* ── Sections ───────────────────────────────────────────────────────── */
.tp-section { padding-top: var(--s-12); margin-top: var(--s-12); border-top: 1px solid var(--line); }
.tp-h2 {
  font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600;
  color: var(--off); margin-bottom: var(--s-6); display: flex; align-items: baseline; gap: var(--s-3);
}
.tp-h2-n { font-family: var(--font-mono); font-size: var(--fs-meta); font-weight: 400; color: var(--dim); }

/* ── Rarest cards ───────────────────────────────────────────────────── */
.tp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s-4); }   /* 12 cards = 2 full rows */
@media (max-width: 1100px) { .tp-grid { grid-template-columns: repeat(4, 1fr); } }
.tp-card { display: block; border: 1px solid var(--line); background: var(--bg2); overflow: hidden; }
.tp .tp-card:hover { border-color: var(--gold-dim); }
.tp-card img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1.41; object-fit: cover; background: var(--bg3); }
.tp-card-cap { display: block; padding: var(--s-3); }
.tp-card-name { display: block; color: var(--off); font-size: var(--fs-body-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-card:hover .tp-card-name { color: var(--gold); }
.tp-card-meta { display: flex; justify-content: space-between; gap: var(--s-2); margin-top: var(--s-1); color: var(--dim); font-family: var(--font-mono); font-size: var(--fs-meta); }

/* ── Named masks — a scannable index, not a paragraph of links ─────── */
.tp-names { list-style: none; padding: 0; margin: 0; columns: 4 200px; column-gap: var(--s-8); }
.tp-names li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.tp-names a {
  display: block; padding: var(--s-2) 0; color: var(--off-70); font-size: var(--fs-body-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp .tp-names a:hover { color: var(--gold); }
.tp-more { margin-top: var(--s-2); }
.tp-more > summary {
  display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; list-style: none;
  margin: var(--s-4) 0; padding: var(--s-2) var(--s-4); border: 1px solid var(--gold-dim);
  color: var(--gold); font-size: var(--fs-button); font-weight: 600; letter-spacing: var(--track-default);
  text-transform: uppercase;
}
.tp-more > summary::-webkit-details-marker { display: none; }
.tp-more > summary:hover { background: var(--gold-faint); }
.tp-more > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tp-more[open] > summary { display: none; }

/* ── Pills (siblings, subtypes, index) ──────────────────────────────── */
.tp-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.tp-pill {
  display: inline-flex; align-items: baseline; gap: var(--s-2);
  padding: var(--s-1) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: var(--fs-body-sm); color: var(--off-70);
}
.tp a.tp-pill { color: var(--off-70); }
.tp a.tp-pill:hover { border-color: var(--gold-dim); color: var(--gold); }
.tp-pill.is-current { border-color: var(--gold); color: var(--gold); background: var(--gold-faint); }
.tp-pill .n { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--dim); }

/* ── Keep browsing ──────────────────────────────────────────────────── */
.tp-steps { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-bottom: var(--s-12); }
.tp-step {
  display: flex; flex-direction: column; gap: var(--s-1);
  padding: var(--s-5) var(--s-6); border: 1px solid var(--line); background: var(--bg2);
}
.tp-step--next { text-align: right; align-items: flex-end; }
.tp a.tp-step:hover { border-color: var(--gold-dim); }
.tp-step-dir { font-size: var(--fs-meta); color: var(--dim); }
.tp-step-name { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; color: var(--off); }
.tp a.tp-step:hover .tp-step-name { color: var(--gold); }
.tp-step-n { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--dim); }
.tp-step.is-end { justify-content: center; background: transparent; border-style: dashed; }
.tp-cats { margin-top: var(--s-10); color: var(--dim); font-size: var(--fs-body-sm); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: baseline; }

/* ── /traits/ index ─────────────────────────────────────────────────── */
.tp-jump { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--fs-body-sm); }
.tp-cat { scroll-margin-top: calc(64px + var(--s-6)); }

@media (max-width: 600px) {
  .tp .tp-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
  .tp-steps { grid-template-columns: 1fr; }
  .tp-step--next { text-align: left; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .tp a { transition: none; }
}
