/* Characters hub (/people) — Style A 塞上泼墨 · 舆图纪事 */
.editorial-shell .people-directory.people-lexicon {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2.5rem max(1.5rem, calc((100% - var(--reading-max, 1080px)) / 2)) 4.75rem;
  background-color: var(--bg-canvas, #efe4ce);
  background-image: var(--paper-grain);
  color: var(--ink-primary, #1a1410);
  font-family: var(--font-serif, "Noto Serif SC", "Songti SC", Georgia, serif);
  font-size: 1.02rem;
  line-height: 1.9;
  scrollbar-gutter: stable;
}

.people-breadcrumb {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.82rem;
  color: var(--ink-muted, #696d65);
  margin-bottom: 1.15rem;
}

.people-breadcrumb a {
  color: var(--ink-muted, #696d65);
  text-decoration: none;
}

.people-breadcrumb a:hover {
  color: var(--vermilion, #a63426);
}

.people-lexicon > h1 {
  font-family: var(--font-serif, serif);
  font-size: var(--text-display-page, clamp(2rem, 1.5rem + 1.4vw, 2.6rem));
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0.08em;
  color: var(--ink-primary, #1a1410);
  margin: 0 0 1.85rem;
}

.people-lexicon a,
.people-hub a {
  color: var(--ochre, #7e5129);
  text-decoration: underline;
  text-decoration-color: rgba(126, 81, 41, 0.35);
  text-underline-offset: 4px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.people-lexicon a:hover,
.people-hub a:hover {
  color: var(--vermilion, #a63426);
  text-decoration-color: var(--vermilion, #a63426);
}

.people-hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: 3.5rem;
  align-items: start;
}

.people-hub-body {
  min-width: 0;
}

.people-hub-intro {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-hairline, #e3ddd0);
}

.people-intro-lead {
  max-inline-size: 62ch;
  font-size: var(--text-body, 1rem);
  line-height: 1.92;
  color: var(--ink-primary, #1a1410) !important;
  margin: 0 0 0.75rem !important;
}

.people-intro-meta {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: var(--text-sm, 0.875rem);
  color: var(--ink-muted, #6c5b4b) !important;
  font-variant-numeric: tabular-nums;
  margin: 0 !important;
}

.people-intro-meta strong {
  color: var(--ink-primary, #1e211e);
  font-weight: 600;
}

.people-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.people-hub p {
  margin: 0 0 1rem;
  line-height: 1.92;
  color: var(--ink-secondary, #4e534d);
}

.people-hub section {
  margin-top: 2.75rem;
  scroll-margin-top: 5.5rem;
  display: flow-root;
}

.people-hub h2 {
  font-family: var(--font-serif, serif);
  font-size: var(--text-heading, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  margin: 0 0 1.4rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--ink-primary, #1a1410);
  box-shadow: 0 4px 0 -3px var(--bg-canvas, #efe4ce), 0 5px 0 -3px var(--border-mid, #bca583);
  color: var(--ink-primary, #1a1410);
}

/* Tiered Notable Characters: 1 + 4 Protagonist Gallery Plates + Faction Ledger */
.people-tier {
  margin-bottom: 2.25rem;
}

.people-tier:last-child {
  margin-bottom: 0;
}

.people-tier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
}

.people-tier-head h3 {
  font-family: var(--font-serif, serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-primary, #1e211e);
  margin: 0;
}

.people-tier-head span {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.8rem;
  color: var(--ink-muted, #696d65);
}

.people-lead-featured {
  margin-bottom: 1.15rem;
}

.people-lead-quad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.people-lead-plate {
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: var(--bg-surface, #f7efe0);
  border: 1px solid var(--ink-primary, #1a1410);
  border-radius: var(--radius-sm, 2px);
  overflow: clip;
  transition: border-color 160ms ease;
}

.people-lead-quad .people-lead-plate {
  container-type: normal;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
}

.people-lead-plate > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 20%;
  background: var(--bg-subtle, #e2d2b5);
}

@media (prefers-reduced-motion: no-preference) {
  .people-lead-plate > img {
    transition: transform 360ms ease;
  }
  .people-lead-plate:has(a.card-link:hover) > img {
    transform: scale(1.02);
  }
}

.people-lead-plate > hgroup {
  padding: 1rem 1.15rem 0.35rem;
}

.people-lead-plate > hgroup h3 {
  margin: 0;
  font-family: var(--font-serif, serif);
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.people-lead-plate a.card-link {
  color: var(--ink-primary, #1e211e);
  text-decoration: none;
}

.people-lead-plate a.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.people-lead-plate a.card-link:focus-visible {
  outline: none;
}

.people-lead-plate:has(a.card-link:focus-visible) {
  outline: 2px solid var(--vermilion, #a63426);
  outline-offset: 3px;
}

.people-lead-plate:has(a.card-link:hover) {
  border-color: var(--celadon, #2d4e45);
}

.people-lead-plate:has(a.card-link:hover) a.card-link {
  color: var(--vermilion, #a63426);
}

.people-lead-plate > hgroup p {
  margin: 0.22rem 0 0;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--celadon, #2d4e45);
}

.people-lead-plate > .people-plate-summary {
  padding: 0 1.15rem;
  margin: 0 0 0.85rem;
  font-family: var(--font-serif, serif);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--ink-secondary, #4e534d);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.people-lead-plate > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.15rem;
  border-top: 1px solid var(--border-hairline, #e3ddd0);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.people-lead-plate a:not(.card-link) {
  position: relative;
  z-index: 1;
  color: var(--ochre, #7e5129);
  text-decoration: underline;
  text-decoration-color: rgba(126, 81, 41, 0.35);
  text-underline-offset: 3px;
}

.people-lead-plate a:not(.card-link):hover {
  color: var(--vermilion, #a63426);
  text-decoration-color: var(--vermilion, #a63426);
}

.people-plate-count {
  color: var(--ink-muted, #696d65);
}

/* Container-adaptive horizontal lead plate when the card itself has room */
@container (min-width: 34rem) {
  .people-lead-plate:has(> img) {
    grid-template-columns: minmax(14rem, 44%) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
  }

  .people-lead-plate:has(> img) > img {
    grid-column: 1;
    grid-row: 1 / 4;
    height: 100%;
    aspect-ratio: 16 / 10.5;
  }

  .people-lead-plate:has(> img) > hgroup {
    grid-column: 2;
    grid-row: 1;
    padding: 1.25rem 1.45rem 0.45rem;
  }

  .people-lead-plate:has(> img) > hgroup h3 {
    font-size: 1.42rem;
  }

  .people-lead-plate:has(> img) > .people-plate-summary {
    grid-column: 2;
    grid-row: 2;
    padding: 0 1.45rem;
    font-size: 0.94rem;
    -webkit-line-clamp: 4;
  }

  .people-lead-plate:has(> img) > footer {
    grid-column: 2;
    grid-row: 3;
    padding: 0.75rem 1.45rem;
  }
}

/* Tier 2: Faction-grouped notable supporting ledger */
.people-notable-factions {
  display: flex;
  flex-direction: column;
  gap: 1.45rem;
}

.people-faction-group {
  --faction-tone: var(--celadon, #2d4e45);
}

.people-faction-group.fp-jin {
  --faction-tone: var(--ochre, #8c6a36);
}

.people-faction-group.fp-xia {
  --faction-tone: var(--xia, #604a69);
}

.people-faction-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-inline-start: 0.7rem;
  border-inline-start: 3px solid var(--faction-tone);
  margin-bottom: 0.65rem;
}

.people-faction-bar h4 {
  margin: 0;
  font-family: var(--font-serif, serif);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-primary, #1e211e);
}

.people-faction-bar a {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.78rem;
  color: var(--ink-muted, #696d65);
  text-decoration: none;
}

.people-faction-bar a:hover {
  color: var(--vermilion, #a63426);
}

.people-notable-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  border-top: 1px solid var(--border-hairline, #e3ddd0);
}

.people-notable-list li {
  padding: 0;
  border-bottom: 1px solid var(--border-hairline, #e3ddd0);
}

.people-notable-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 0.2rem;
  text-decoration: none;
  color: var(--ink-primary, #1e211e);
  transition: color 140ms ease;
}

.people-notable-list strong {
  font-family: var(--font-serif, serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.people-notable-list span {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.78rem;
  color: var(--ink-muted, #696d65);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-notable-list a:hover strong {
  color: var(--vermilion, #a63426);
}

.people-notable-list a:hover span {
  color: var(--ink-secondary, #4e534d);
}

.people-hub #character-timelines ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.people-hub #character-timelines li {
  padding: 0;
  line-height: 1.4;
}

.people-hub #character-timelines a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.75rem;
  background: var(--bg-surface, #fcfbf8);
  border: 1px solid var(--border-hairline, #e3ddd0);
  border-radius: var(--radius-sm, 4px);
  text-decoration: none;
  color: var(--ink-primary, #1e211e);
  font-size: 0.96rem;
  letter-spacing: 0.04em;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.people-hub #character-timelines a:hover {
  border-color: var(--celadon, #2d4e45);
  background: var(--celadon-soft, #e4ece8);
  color: var(--celadon, #2d4e45);
}

.people-hub #essays ul,
.people-hub #groups ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.7rem;
}

.people-hub #essays li,
.people-hub #groups li {
  padding: 0;
}

.people-hub #essays a,
.people-hub #groups a {
  display: block;
  padding: 0.72rem 1rem;
  background: var(--bg-surface, #fcfbf8);
  border: 1px solid var(--border-hairline, #e3ddd0);
  border-radius: var(--radius-sm, 4px);
  text-decoration: none;
  color: var(--ink-primary, #1e211e);
  font-size: 0.94rem;
  line-height: 1.5;
}

.people-hub #essays a:hover,
.people-hub #groups a:hover {
  border-color: var(--celadon, #2d4e45);
  color: var(--celadon, #2d4e45);
}

.people-timeline-illustration {
  float: right;
  object-fit: cover;
  object-position: 50% 25%;
  width: 12.5rem;
  height: 9.5rem;
  margin: 0.35rem 0 1rem 1.5rem;
  border-radius: var(--radius-sm, 4px);
}

/* Woodblock-framed sticky TOC */
.people-hub-toc {
  position: sticky;
  top: 5.75rem;
  background: var(--bg-subtle, #e2d2b5);
  border: 1px solid var(--border-mid, #bca583);
  border-top: 2px solid var(--ink-primary, #1a1410);
  border-radius: var(--radius-md, 3px);
  padding: 1.35rem 1.5rem;
}

.people-hub-toc nav {
  display: block !important;
  margin: 0 !important;
}

.people-hub-toc strong {
  display: block;
  font-family: var(--font-serif, serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-primary, #1e211e);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-mid, #cfc7b6);
}

.people-hub-toc ul {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.people-hub-toc a {
  display: block;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.88rem;
  color: var(--ink-secondary, #4e534d);
  text-decoration: none;
  padding: 0.2rem 0;
}

.people-hub-toc a:hover {
  color: var(--vermilion, #a63426);
}

/* Alphabetical Index Grid */
.people-letter-index {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.35rem !important;
  margin: 1rem 0 1.15rem !important;
}

.people-letter-index a,
.people-letter-index span,
.people-letter-index button {
  min-inline-size: 2.25rem;
  min-block-size: 2.25rem;
  display: inline-grid;
  place-items: center;
  padding: 0 0.55rem;
  border: 1px solid var(--border-hairline, #e3ddd0);
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.86rem;
  font-weight: 500;
  background: var(--bg-surface, #fcfbf8);
  color: var(--ink-primary, #1e211e);
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.people-letter-index a:hover,
.people-letter-index button:hover:not(:disabled) {
  border-color: var(--celadon, #2d4e45);
  color: var(--celadon, #2d4e45);
}

.people-letter-index span,
.people-letter-index button:disabled {
  background: transparent;
  border-color: transparent;
  color: #b4b0a5;
  cursor: default;
}

.people-letter-index button[aria-pressed="true"] {
  background: var(--celadon, #2d4e45);
  border-color: var(--celadon, #2d4e45);
  color: #fff;
}

.people-index-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  background: var(--bg-subtle, #efeae0);
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.88rem;
}

.people-index-tools label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-secondary, #4e534d);
}

.people-index-tools input,
.people-index-tools select,
.people-index-tools button {
  padding: 0.45rem 0.75rem;
  background: var(--bg-surface, #fcfbf8);
  border: 1px solid var(--border-mid, #cfc7b6);
  border-radius: var(--radius-sm, 4px);
  color: var(--ink-primary, #1e211e);
  font: inherit;
}

.people-index-results {
  list-style: none;
  padding: 0;
  max-inline-size: 48rem;
}

.people-index-results li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-hairline, #e3ddd0);
}

.people-index-results a {
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-primary, #1e211e);
}

.people-index-results a:hover {
  color: var(--vermilion, #a63426);
}

.people-index-results span {
  display: block;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.84rem;
  color: var(--ink-muted, #696d65);
  margin-top: 0.25rem;
}

.people-lexicon button {
  cursor: pointer;
}

.people-lexicon button:disabled {
  cursor: default;
}

@media (max-width: 860px) {
  .editorial-shell .people-directory.people-lexicon {
    padding: 1.75rem 1.15rem 3.25rem;
    font-size: 0.98rem;
  }
  .people-hub-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .people-hub-toc {
    position: static;
    grid-row: 1;
    padding: 1rem 1.15rem;
  }
  .people-hub-toc strong {
    border: 0;
    padding: 0;
    margin-bottom: 0.5rem;
  }
  .people-hub-toc ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem 1.15rem;
    margin-top: 0;
  }
  .people-hub #character-timelines ul {
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  }
}

@media (max-width: 600px) {
  .people-lead-quad {
    grid-template-columns: 1fr;
  }
  .people-lead-quad .people-lead-plate {
    grid-row: auto;
    grid-template-rows: auto auto 1fr auto;
  }
  .people-notable-list {
    grid-template-columns: 1fr;
  }
}
