/* TỨ PHỦ — UI-39 Anh hùng dân tộc (Việt sử · Hào khí non sông) */

:root {
  --nh-paper-border: #d8c6a8;
  --nh-tabs-h: 0px;
}

/* In-module tabs — cùng ngôn ngữ nút site (không sticky chồng header) */
.nh-tabs {
  margin-top: 1.25rem;
}

.nh-tabs-track {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.15rem;
}

.nh-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196, 154, 89, 0.35);
  border-radius: 0.65rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gold-light);
  background: transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nh-tab:hover,
.nh-tab:focus-visible {
  border-color: rgba(196, 154, 89, 0.7);
  background: rgba(53, 35, 38, 0.65);
  color: var(--text-light);
  outline: none;
}

.nh-tab.is-active {
  border-color: transparent;
  background: var(--primary);
  color: var(--text-light);
}

.nh-hero-compact .nh-tabs {
  margin-top: 1rem;
}

/* Legacy class hooks (JS / old markup) */
.nh-subnav,
.nh-subnav-track,
.nh-subnav-link {
  /* no-op aliases kept for safety */
}

.nh-hero-art {
  border: 1px solid rgba(196, 154, 89, 0.35);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--surface-dark);
}

.nh-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.nh-search-wrap {
  position: relative;
}

.nh-search-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(98, 68, 60, 0.55);
  border-radius: 0.85rem;
  background: rgba(42, 26, 28, 0.95);
  padding: 0.85rem 1rem;
}

.nh-search-box:focus-within {
  border-color: rgba(196, 154, 89, 0.7);
}

.nh-search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text-light);
  font-size: 0.95rem;
  outline: none;
}

.nh-search-box input::placeholder {
  color: rgba(213, 186, 153, 0.65);
}

.nh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.nh-chip {
  border: 1px solid rgba(98, 68, 60, 0.55);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nh-chip:hover,
.nh-chip:focus-visible {
  border-color: var(--gold);
  color: var(--gold-light);
  outline: none;
}

.nh-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid rgba(98, 68, 60, 0.55);
  border-radius: 0.75rem;
  background: var(--surface-elevated);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.nh-suggest[hidden] {
  display: none !important;
}

.nh-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-bottom: 1px solid rgba(98, 68, 60, 0.25);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
}

.nh-suggest-item:last-child {
  border-bottom: 0;
}

.nh-suggest-item.is-active,
.nh-suggest-item:hover {
  background: rgba(116, 43, 50, 0.28);
}

.nh-suggest-type {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.nh-suggest mark {
  background: rgba(196, 154, 89, 0.28);
  color: inherit;
  border-radius: 0.15rem;
  padding: 0 0.1rem;
}

.nh-era-track {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.nh-era-card {
  flex: 0 0 min(280px, 82vw);
  scroll-snap-align: start;
  border: 1px solid rgba(98, 68, 60, 0.5);
  border-radius: 0.75rem;
  background: rgba(42, 26, 28, 0.9);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s ease;
}

.nh-era-card:hover,
.nh-era-card:focus-within {
  border-color: rgba(196, 154, 89, 0.65);
}

.nh-era-num {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.nh-portrait-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .nh-portrait-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .nh-portrait-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.nh-portrait-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(98, 68, 60, 0.5);
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(42, 26, 28, 0.88);
  transition: border-color 0.18s ease;
}

.nh-portrait-card:hover,
.nh-portrait-card:focus-within {
  border-color: var(--gold);
}

.nh-portrait-media {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #2a1a1c;
}

.nh-portrait-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-portrait-card:hover .nh-portrait-media img {
    transform: scale(1.03);
  }
}

.nh-portrait-body {
  padding: 0.85rem 0.9rem 1rem;
}

.nh-women-layout {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 1024px) {
  .nh-women-layout {
    grid-template-columns: 1.35fr 1fr;
    align-items: stretch;
  }
}

.nh-women-featured {
  border: 1px solid rgba(216, 198, 168, 0.35);
  border-radius: 0.85rem;
  background: linear-gradient(160deg, rgba(53, 35, 38, 0.95), rgba(42, 26, 28, 0.9));
  padding: 1.25rem;
}

.nh-women-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.nh-timeline-wrap {
  position: relative;
}

.nh-timeline-track {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0 1rem;
  -webkit-overflow-scrolling: touch;
}

.nh-timeline-node {
  flex: 0 0 min(260px, 80vw);
  scroll-snap-align: start;
  border: 1px solid rgba(98, 68, 60, 0.5);
  border-radius: 0.75rem;
  background: rgba(42, 26, 28, 0.9);
  padding: 1rem;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nh-timeline-node.is-selected {
  border-color: var(--gold);
  background: rgba(116, 43, 50, 0.22);
}

.nh-timeline-year {
  font-family: "Noto Serif", Georgia, serif;
  color: var(--gold-light);
  font-size: 1.15rem;
}

.nh-timeline-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.nh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(98, 68, 60, 0.55);
  padding: 0.55rem 0.95rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: transparent;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.nh-btn:hover,
.nh-btn:focus-visible {
  border-color: var(--gold);
  color: var(--gold-light);
  outline: none;
}

.nh-btn.is-primary {
  border-color: transparent;
  background: var(--primary);
  color: var(--text-light);
}

.nh-btn.is-primary:hover,
.nh-btn.is-primary:focus-visible {
  background: var(--primary-hover);
  color: var(--text-light);
}

.nh-events-layout {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 1024px) {
  .nh-events-layout {
    grid-template-columns: 1.2fr 1fr;
  }
}

.nh-event-featured,
.nh-event-card,
.nh-belief-card,
.nh-heritage-card,
.nh-doc-card {
  border: 1px solid rgba(98, 68, 60, 0.5);
  border-radius: 0.75rem;
  background: rgba(42, 26, 28, 0.88);
  padding: 1rem 1.1rem;
}

.nh-event-grid {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .nh-event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.nh-belief-grid,
.nh-heritage-grid,
.nh-doc-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .nh-belief-grid,
  .nh-heritage-grid,
  .nh-doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .nh-belief-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nh-heritage-grid,
  .nh-doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.nh-empty {
  border: 1px dashed rgba(98, 68, 60, 0.55);
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.nh-principles {
  border: 1px solid rgba(216, 198, 168, 0.3);
  border-radius: 0.85rem;
  background: rgba(245, 235, 221, 0.96);
  color: var(--paper-text);
  padding: 1.5rem;
}

.nh-principles ul {
  margin-top: 0.85rem;
  list-style: none;
  padding: 0;
}

.nh-principles li {
  position: relative;
  padding-left: 1.15rem;
  margin-top: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.nh-principles li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--primary);
}

.nh-meta-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nh-kicker {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Paper bands (xen kẽ như home) — chữ / nút đọc được trên nền sáng */
.texture-paper .nh-kicker {
  color: var(--primary);
}

.texture-paper .nh-btn:not(.is-primary) {
  border-color: rgba(98, 68, 60, 0.35);
  color: var(--paper-text);
  background: rgba(255, 255, 255, 0.45);
}

.texture-paper .nh-btn:not(.is-primary):hover,
.texture-paper .nh-btn:not(.is-primary):focus-visible {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary);
}

.texture-paper .nh-era-card,
.texture-paper .nh-event-card,
.texture-paper .nh-heritage-card,
.texture-paper .nh-doc-card,
.texture-paper .nh-women-side a,
.texture-paper .nh-belief-card {
  border-color: rgba(98, 68, 60, 0.28);
  background: rgba(255, 255, 255, 0.55);
  color: var(--paper-text);
}

.texture-paper .nh-meta-note,
.texture-paper .text-muted {
  color: rgba(51, 36, 31, 0.72);
}

@media (max-width: 767px) {
  .nh-timeline-track {
    flex-direction: column;
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .nh-timeline-node {
    flex: 1 1 auto;
    width: 100%;
  }
}
