/* Hanging Context — per-entity page chrome.
   Used by /stories/<slug>.html, /tags/<slug>.html, /sources/<slug>.html.
   Loaded on top of shared.css + data.css. */

.entity-hero {
  padding: clamp(2.7rem, 6.2vw, 4.2rem) 0 clamp(1.75rem, 3.3vw, 2.7rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.3rem;
}
.entity-hero .kind-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.875rem;
}
.entity-hero .kind-eyebrow::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background-color: var(--bg-subtle);
  background-image: var(--pattern-diagonal);
}
.entity-hero .kind-eyebrow a { color: inherit; }
.entity-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 1rem;
}
.entity-hero .summary {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 720px;
  margin: 0.5rem 0 1.25rem;
}

.entity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 1rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  background: var(--bg);
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.chip-accent {
  color: var(--text);
  border-color: var(--line-strong);
  background-color: var(--bg-subtle);
  background-image: var(--pattern-diagonal);
}
.chip.chip-muted {
  color: var(--text-tertiary);
  border-color: var(--line);
}

.entity-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem 2rem;
  margin: 1.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.entity-meta .m-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}
.entity-meta .m-value {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

/* Section blocks */
.entity-section {
  margin: 2.75rem 0;
}
.entity-section > h2 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.entity-section .lede {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

/* Claim list inside a page */
.claim-list .claim-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.claim-list .claim-item:last-child { border-bottom: none; }
.claim-list .c-quote {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 0.625rem;
  position: relative;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}
.claim-list .c-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
}
.claim-list .c-row a {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.claim-list .c-row a:hover { color: var(--text); border-color: var(--text); }

/* Two-column layout for page body */
.entity-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2.2rem 3.2rem;
  align-items: start;
}
@media (max-width: 840px) {
  .entity-grid { grid-template-columns: 1fr; }
}

/* Sidebar block */
.entity-side .block {
  border: 1px solid color-mix(in srgb, var(--line-strong) 64%, transparent);
  border-radius: var(--panel-radius);
  padding: 1rem 1.125rem 1.125rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, var(--bg-subtle)) 0%, var(--bg) 100%);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}
.entity-side .block:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--elev-soft);
}
.entity-side .block h3 {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 0.5rem;
  font-weight: 500;
}

/* Index page grids */
.entity-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 3rem;
}
.entity-index .idx-card {
  padding: 1rem 1.125rem 1.125rem;
  border: 1px solid color-mix(in srgb, var(--line-strong) 60%, transparent);
  border-radius: var(--panel-radius);
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 96%, var(--bg-subtle)) 0%, var(--bg) 100%);
  display: block;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}
.entity-index .idx-card:hover {
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--elev-soft);
}
.entity-index .idx-card .idx-type {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}
.entity-index .idx-card .idx-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.25;
  word-break: break-word;
}
.entity-index .idx-card .idx-stat {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.entity-index .idx-card .idx-sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.pager {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.pager a, .pager span.current {
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-secondary);
  text-decoration: none;
  min-width: 2rem;
  text-align: center;
}
.pager a:hover { color: var(--text); border-color: var(--text); }
.pager span.current { color: var(--text); border-color: var(--text); background: var(--bg-subtle); }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0 0 1.25rem;
}
.filter-chips button {
  padding: 0.3125rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chips button.active {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}
.filter-chips button:not(.active):hover {
  color: var(--text);
  border-color: var(--text);
}
@media (max-width: 640px) {
  .entity-hero {
    padding: 2rem 0 1.35rem;
    margin-bottom: 1.5rem;
  }
  .entity-hero .summary {
    font-size: 0.96rem;
  }
  .entity-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
  }
  .entity-section {
    margin: 2rem 0;
  }
  .claim-list .c-quote {
    font-size: 0.93rem;
    padding-left: 0.85rem;
  }
  .claim-list .c-row {
    gap: 0.55rem;
  }
  .entity-index {
    grid-template-columns: 1fr;
    margin-bottom: 2.2rem;
  }
  .pager {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
