/**
 * UI-42 — National heroes timeline (museum editorial)
 */
:root {
  --nht-sticky-top: calc(var(--header-h, 64px) + var(--nh-subnav-h, 48px));
}

body[data-nht-page] {
  --nh-subnav-h: 48px;
}

.nht-hero {
  border-bottom: 1px solid rgba(98, 68, 60, 0.45);
  background: linear-gradient(180deg, rgba(42, 26, 28, 0.6), rgba(25, 15, 18, 0.2));
}

.nht-controls {
  position: sticky;
  top: var(--nht-sticky-top);
  z-index: 40;
  background: rgba(25, 15, 18, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(98, 68, 60, 0.35);
  padding: 0.75rem 0;
}

.nht-controls-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.nht-search-input {
  flex: 1 1 12rem;
  min-width: 10rem;
  border-radius: 0.5rem;
  border: 1px solid #62443c;
  background: #2a1a1c;
  color: #f4e6d1;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
}

.nht-year-input {
  width: 5.5rem;
  border-radius: 0.5rem;
  border: 1px solid #62443c;
  background: #2a1a1c;
  color: #f4e6d1;
  padding: 0.45rem 0.5rem;
  font-size: 0.8125rem;
}

.nht-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .nht-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.nht-stat-grid dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d5ba99;
}

.nht-stat-grid dd {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.35rem;
  color: #e4c58c;
}

.nht-era-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.nht-era-chip,
.nht-type-chip {
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(196, 154, 89, 0.35);
  background: #2a1a1c;
  color: #d5ba99;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.nht-era-chip.is-active,
.nht-type-chip.is-active {
  border-color: #c49a59;
  color: #f4e6d1;
  background: #352326;
}

.nht-chip-count {
  opacity: 0.75;
  margin-left: 0.25rem;
}

.nht-view-toggle {
  display: inline-flex;
  border: 1px solid #62443c;
  border-radius: 0.5rem;
  overflow: hidden;
}

.nht-view-toggle button {
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  color: #d5ba99;
  background: transparent;
}

.nht-view-toggle button.is-active {
  background: #742b32;
  color: #f4e6d1;
}

.nht-editorial-row {
  display: flex;
  justify-content: flex-start;
  margin: 1rem 0;
}

.nht-editorial-row.is-right {
  justify-content: flex-end;
}

.nht-event-card {
  max-width: 28rem;
  width: 100%;
  border: 1px solid rgba(98, 68, 60, 0.5);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  background: rgba(42, 26, 28, 0.65);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.nht-event-card:hover,
.nht-event-card:focus-visible {
  border-color: #c49a59;
  outline: none;
  transform: translateY(-1px);
}

.nht-event-card.is-featured {
  border-color: rgba(196, 154, 89, 0.75);
  box-shadow: inset 0 0 0 1px rgba(196, 154, 89, 0.2);
}

.nht-event-card.is-approx {
  border-style: dashed;
}

.nht-event-meta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c49a59;
}

.nht-event-title {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.1rem;
  color: #f4e6d1;
  margin-top: 0.35rem;
}

.nht-event-summary {
  font-size: 0.82rem;
  color: #d5ba99;
  margin-top: 0.5rem;
  line-height: 1.45;
}

.nht-event-cta {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: #e4c58c;
}

.nht-cluster {
  margin: 1rem 0 1.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(196, 154, 89, 0.35);
}

.nht-cluster-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c49a59;
  margin-bottom: 0.75rem;
}

.nht-scale-viewport {
  overflow: hidden;
  border: 1px solid rgba(98, 68, 60, 0.45);
  border-radius: 0.75rem;
  transform-origin: 0 0;
}

.nht-scale-svg {
  width: 100%;
  height: auto;
  display: block;
}

.nht-scale-bg {
  fill: #241518;
}

.nht-scale-lane-label {
  fill: #d5ba99;
  font-size: 11px;
}

.nht-scale-node rect {
  fill: #742b32;
  stroke: #c49a59;
  stroke-width: 1;
}

.nht-scale-node.is-featured rect {
  fill: #913c43;
}

.nht-undated {
  margin-top: 1.25rem;
}

.nht-undated-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.nht-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.nht-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.nht-overview-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nht-overview-band {
  border: 1px solid rgba(98, 68, 60, 0.55);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #2a1a1c;
  color: #d5ba99;
  font-size: 0.8rem;
}

.nht-overview-count {
  display: block;
  font-size: 1rem;
  color: #e4c58c;
  font-family: "Noto Serif", Georgia, serif;
}

.nht-figure-chip {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(196, 154, 89, 0.35);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  color: #f4e6d1;
  margin: 0.2rem;
}

.nht-heritage-card,
.nht-doc-card {
  border: 1px solid rgba(98, 68, 60, 0.45);
  border-radius: 0.65rem;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  background: rgba(42, 26, 28, 0.5);
}

.nht-legend-list {
  list-style: none;
  padding: 0;
  font-size: 0.8rem;
  color: #d5ba99;
}

.nht-legend-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
}

.nht-legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  border: 1px solid #62443c;
  background: #2a1a1c;
}

.nht-legend-swatch.is-featured {
  background: #913c43;
  border-color: #c49a59;
}

.nht-legend-swatch.is-approx {
  border-style: dashed;
}

.nht-legend-swatch.is-pending {
  background: #352326;
}

.nht-empty {
  border: 1px dashed rgba(98, 68, 60, 0.65);
  border-radius: 0.65rem;
  padding: 2rem 1rem;
  text-align: center;
  color: #d5ba99;
}

.nht-filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.nht-filter-drawer.is-open {
  pointer-events: auto;
  opacity: 1;
}

.nht-filter-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 15, 18, 0.75);
}

.nht-filter-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(100%, 320px);
  background: #2a1a1c;
  border-left: 1px solid #62443c;
  padding: 1rem;
  overflow-y: auto;
}

.nht-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  border: 0;
  background: rgba(25, 15, 18, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.nht-preview-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nht-preview-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 95;
  width: min(100%, 400px);
  background: #2a1a1c;
  border-left: 1px solid #62443c;
  padding: 1.25rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.nht-preview-panel.is-open {
  transform: translateX(0);
}

.nht-preview-head {
  position: relative;
  padding-right: 2rem;
}

.nht-preview-close {
  position: absolute;
  right: 0;
  top: 0;
  border: 0;
  background: transparent;
  color: #d5ba99;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.nht-preview-meta {
  margin-top: 1rem;
  font-size: 0.82rem;
}

.nht-preview-meta dt {
  color: #c49a59;
  margin-top: 0.35rem;
}

.nht-preview-meta dd {
  color: #d5ba99;
}

.nht-preview-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}

.nht-preview-link {
  color: #e4c58c;
  font-size: 0.85rem;
}

.nht-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .nht-event-card,
  .nht-preview-panel,
  .nht-filter-drawer {
    transition: none;
  }
}

@media (max-width: 640px) {
  .nht-editorial-row,
  .nht-editorial-row.is-right {
    justify-content: stretch;
  }
  .nht-event-card {
    max-width: none;
  }
}