/* === Site Navigation === */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav a {
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  border-radius: 2px;
  transition: all 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.site-nav a.active {
  color: var(--bg);
  background: var(--text);
}

.nav-spacer {
  flex: 1;
}

.nav-toggle {
  display: none;
  font-size: 1.3rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
}

.lang-toggle {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.lang-toggle:hover {
  background: var(--accent);
  color: var(--bg);
}

/* === Section Sub-Navigation === */
.section-nav {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 2.3rem;
  z-index: 99;
}

.section-nav-item {
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.section-nav-item:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.section-nav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

/* === Disclaimer === */
.disclaimer {
  max-width: 750px;
  margin: 1rem auto 0;
  padding: 0.8rem 1.2rem;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 3px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #5d4037;
}

/* === Overview Content === */
.overview-content {
  max-width: 850px;
  padding-top: 1.5rem;
}

/* === Bio Section === */
.bio-section {
  margin-bottom: 3rem;
}

.bio-section h2 {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bio-text p {
  margin-bottom: 1rem;
  text-align: justify;
  hyphens: auto;
}

/* === Timeline === */
.timeline-section {
  margin-bottom: 3rem;
}

.timeline-section h2 {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.timeline-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Timeline legend */
.timeline-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  font-size: 0.7rem;
  font-family: "Courier New", monospace;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.legend-item::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-tape::before {
  background: var(--accent-light);
}

.legend-genealogy::before {
  background: #6a7b5b;
}

.legend-article::before {
  background: #5b6a7b;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

/* Era dividers */
.timeline-era {
  position: relative;
  margin: 2rem 0 1rem;
  padding: 0.3rem 0.8rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-block;
  margin-left: -0.5rem;
}

.timeline-event {
  position: relative;
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.timeline-event:hover {
  border-color: var(--accent);
  background: var(--annotation-bg);
}

.timeline-event-header {
  position: relative;
  padding-right: 1.5rem;
}

.timeline-event-header::after {
  content: '▸';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.timeline-event.expanded .timeline-event-header::after {
  transform: rotate(90deg);
}

/* Hide expand arrow when no detail panel exists */
.timeline-event:not(:has(.timeline-detail)) .timeline-event-header::after {
  display: none;
}

.timeline-event:not(:has(.timeline-detail)) {
  cursor: default;
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.timeline-year {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.timeline-text {
  font-size: 0.85rem;
  line-height: 1.4;
}

.timeline-source {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-family: "Courier New", monospace;
}

.timeline-source-genealogy {
  color: #6a7b5b;
}

.timeline-source-article {
  color: #5b6a7b;
}

/* --- Person links & popover --- */
.person-link {
  text-decoration: underline dotted var(--accent-light);
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s;
}
.person-link:hover {
  color: var(--accent);
}

.person-popover {
  position: absolute;
  z-index: 1000;
  max-width: 320px;
  background: var(--bg);
  border: 1px solid var(--accent-light);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 0.82rem;
  line-height: 1.45;
}
.person-popover-name {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.person-popover-desc {
  color: var(--text);
}

/* Event type styling */
.timeline-event-genealogy::before {
  background: #6a7b5b;
  box-shadow: 0 0 0 2px #6a7b5b;
}

.timeline-event-article::before {
  background: #5b6a7b;
  box-shadow: 0 0 0 2px #5b6a7b;
}

.timeline-event-genealogy {
  border-left: 3px solid #6a7b5b;
}

.timeline-event-article {
  border-left: 3px solid #5b6a7b;
}

/* Expandable detail panel */
.timeline-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.3s ease;
  margin-top: 0;
}

.timeline-event.expanded .timeline-detail {
  max-height: 500px;
  opacity: 1;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.timeline-event.expanded {
  border-color: var(--accent);
  background: var(--annotation-bg);
}

.timeline-detail-topics {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.timeline-detail-summary {
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.timeline-detail-link {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  transition: all 0.15s;
}

.timeline-detail-link:hover {
  background: var(--accent);
  color: var(--bg);
}

/* === Tape Summaries Grid === */
.summaries-section h2 {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.summaries-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.tape-grid {
  display: grid;
  gap: 1rem;
}

.tape-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.2rem;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tape-card:hover {
  border-color: var(--accent);
  background: var(--annotation-bg);
}

.tape-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tape-card-label {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 2px;
  white-space: nowrap;
}

.tape-card-topics {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

.tape-card-summary {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* === Tape Card Actions (audio + link) === */
.tape-card-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.tape-play-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
}

.tape-play-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.tape-audio-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.tape-audio-progress-wrap {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.tape-audio-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.tape-audio-time {
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tape-card-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
}

.tape-card-link:hover {
  text-decoration: underline;
}

/* === Placeholder Sections === */
.placeholder-section {
  padding: 3rem 2rem;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 3px;
  background: var(--annotation-bg);
}

.placeholder-text {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.placeholder-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* === Responsive === */
@media (max-width: 600px) {
  .overview-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-event {
    padding: 0.5rem 0.6rem;
  }

  .timeline-text {
    font-size: 0.8rem;
  }

  /* Mobile hamburger nav */
  .nav-toggle {
    display: block;
  }

  .site-nav {
    padding: 0.5rem 1rem;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .site-nav a {
    display: none;
    width: 100%;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
  }

  .site-nav.open a {
    display: block;
  }

  .site-nav.open {
    flex-wrap: wrap;
  }

  .site-nav.open .nav-spacer {
    display: none;
  }

  .nav-spacer {
    flex: 0;
  }

  .tape-card-actions {
    flex-wrap: wrap;
  }

  .bio-text p {
    text-align: left;
  }

  .disclaimer {
    margin: 0.5rem 1rem 0;
    font-size: 0.75rem;
  }
}
