*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #111318;
  --ink-soft: #4a4e5a;
  --ink-muted: #8a8f9e;
  --rule: #e2e4ea;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --accent: #1a3a5c;
  --accent-light: #e8eef5;
  --tag-bg: #f0f2f7;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--tag-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ── Layout ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 0 2rem;
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ── Home ── */
.home-hero { margin-bottom: 3rem; }
.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.home-hero p {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 520px;
}

.category-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.cat-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-soft);
  transition: all 0.15s;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.cat-btn:hover, .cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.profile-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.card-top { display: flex; align-items: center; gap: 1rem; }
.card-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-light);
  flex-shrink: 0;
}
.card-avatar-placeholder {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}
.card-meta h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}
.card-meta p {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.15rem;
}
.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--tag-bg);
  color: var(--ink-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  align-self: flex-start;
}
.card-arrow {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── Profile ── */
.profile-back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
  transition: color 0.15s;
}
.profile-back:hover { color: var(--accent); }

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}
.profile-photo {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--rule);
}
.profile-photo-placeholder {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent);
  flex-shrink: 0;
}
.profile-title h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.profile-title .role {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.wiki-link {
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  display: inline-block;
  transition: all 0.15s;
}
.wiki-link:hover { background: var(--accent); color: #fff; }

.profile-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.profile-section {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.75rem;
}
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
  order: 99;
}
.section-source {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--ink-muted);
  opacity: 0.8;
}
.profile-section p {
  font-size: 0.97rem;
  color: var(--ink-soft);
  line-height: 1.75;
}
/* The reset at the top of this file zeroes every margin, so paragraph
   spacing has to be put back explicitly. Two rules on purpose: this one
   catches any <p> in a section, the .block rules below handle the
   controversy blocks specifically. */
.profile-section p + p { margin-top: 0.85rem; }
.profile-section p.empty {
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-style: italic;
}
.profile-section p.empty a { color: var(--accent); text-decoration: underline; font-style: normal; }

/* ── News ── */
.news-list { display: flex; flex-direction: column; gap: 1rem; }
.news-item { padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.news-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.3rem;
  transition: color 0.15s;
}
.news-item a:hover h3 { color: var(--accent); }
.news-item p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.news-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
  display: flex;
  gap: 0.75rem;
}

/* ── Debug ── */
.debug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.debug-table th, .debug-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.debug-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.debug-table tr.hit td { background: var(--accent-light); font-weight: 500; }

/* ── States ── */
.error-state { text-align: center; padding: 4rem 2rem; color: var(--ink-soft); }
.error-state h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.error-state p { margin-bottom: 1rem; }

@media (max-width: 640px) {
  .page-wrap { padding: 2rem 1rem; }
  .profile-header { flex-direction: column; gap: 1rem; }
  .site-header { padding: 0 1rem; }
}

/* ── Excerpt block (link-out to Wikipedia) ── */
.excerpt-block {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
}
.excerpt-kicker {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
  font-style: italic;
}
.excerpt-text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 1rem;
}
.excerpt-readmore {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.15s;
}
.excerpt-readmore:hover { background: var(--accent); color: #fff; }
.block-attrib {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem !important;
  color: var(--ink-muted) !important;
}
.block-attrib a { color: var(--accent); text-decoration: underline; }

/* ── Search ── */
.search-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  max-width: 520px;
}
.search-bar input[type="search"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-bar button {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.search-bar button:hover { opacity: 0.88; }
.search-clear {
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-decoration: underline;
  white-space: nowrap;
}
.search-clear:hover { color: var(--accent); }
.search-result-count {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}
.search-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
  max-width: 420px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

/* ── Status badge (honest per-person framing) ── */
.status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.85rem;
}
.status-badge.st-convicted {
  background: #f3e0e0; color: #8a2020; border: 1px solid #e0b8b8;
}
.status-badge.st-admitted {
  background: #efe6dc; color: #7a4d1f; border: 1px solid #dcc4a8;
}
.status-badge.st-caution {
  background: #fdf4dc; color: #8a6d1f; border: 1px solid #f0e0b0;
}
.status-badge.st-neutral {
  background: #e8ecef; color: #445; border: 1px solid #cdd5db;
}
