/* ==========================================================================
   1. DESIGN TOKENS & CORE RESETS
   ========================================================================== */
:root {
  --bg: #f7f5f2;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #555;
  --accent: #8b5a2b;         /* Historic warm accent brown */
  --border: #e0d8cf;         /* Light heritage separator tint */
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --highlight-red: #c62828;  /* Vibrant rust tone for hover interaction */
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  padding: 1rem;
}

.container { 
  max-width: 1100px; 
  margin: 0 auto; 
}

/* ==========================================================================
   2. THREE-WAY HEADER & FOOTER NAVIGATION
   ========================================================================== */
.page-nav-bar {
  display: flex;
  justify-content: space-between; /* Spreads items evenly: Left, Center, Right */
  align-items: center;
  max-width: 850px;
  margin: 2rem auto;
  padding: 1rem 1.5rem;
}

/* Clean divider rules that utilize verified design tokens */
.page-nav-bar.nav-top {
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-nav-bar.nav-bottom {
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  margin-bottom: 2rem;
}

/* Shared typography and baseline adjustments for all layout navigation links */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);          
  text-decoration: none;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  font-weight: bold;
  transition: color 0.2s ease-in-out;
  width: 33.33%; /* Allocates symmetric layout columns for text nodes */
}

/* Multi-direction alignment corrections */
.nav-link.lnk-prev { text-align: left; justify-content: flex-start; }
.nav-link.lnk-home { text-align: center; justify-content: center; }
.nav-link.lnk-next { text-align: right; justify-content: flex-end; }

.nav-link:hover, 
.nav-link:focus {
  color: var(--highlight-red);
  text-decoration: underline;
}

/* ==========================================================================
   3. STRUCTURAL CONTENT LAYOUTS
   ========================================================================== */
header {
  text-align: center;
  padding: 1.75rem 1rem 1.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.75rem;
}

header h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--accent);
  font-weight: 700;
}

header .subtitle { 
  color: var(--muted); 
  margin-top: 0.35rem; 
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 820px) {
  .main-grid { 
    grid-template-columns: 1.45fr 1fr; 
  }
}

/* ==========================================================================
   4. DATA CARDS & COMPONENT BLOCKS
   ========================================================================== */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.bio p { 
  margin-bottom: 0.9rem; 
  font-size: 0.97rem; 
}

.bio p:last-child { 
  margin-bottom: 0; 
}

.info-list { 
  display: grid; 
  gap: 0.8rem; 
}

.info-item {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 0.4rem;
  font-size: 0.93rem;
}

.info-item .label { 
  font-weight: 600; 
  color: var(--accent); 
}

/* Multi-column grid adjustments for family records */
.children {
  columns: 1;
  column-gap: 1.4rem;
  padding-left: 1.1rem;
}

@media (min-width: 480px) { 
  .children { 
    columns: 2; 
  } 
}

.children li { 
  break-inside: avoid; 
  margin-bottom: 0.3rem; 
  font-size: 0.92rem; 
}

/* ==========================================================================
   5. ANCESTRY GRAPHICS & DATA SECTIONS
   ========================================================================== */
.ancestry-section { 
  margin-top: 0.5rem; 
}

.ancestry-section > h2 {
  text-align: center;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.tree-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem 0.5rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.pedigree-svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
  margin: 0 auto;
}

.ahnentafel { 
  margin-top: 1.75rem; 
}

.ahnentafel h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.ahnentafel ol {
  columns: 1;
  column-gap: 2rem;
  padding-left: 1.3rem;
  font-size: 0.9rem;
}

@media (min-width: 640px) { 
  .ahnentafel ol { 
    columns: 2; 
  } 
}

.ahnentafel li { 
  break-inside: avoid; 
  margin-bottom: 0.28rem; 
}

/* ==========================================================================
   6. ARCHIVE FOOTER
   ========================================================================== */
footer {
  text-align: center;
  margin-top: 2.5rem;
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.84rem;
  border-top: 1px solid var(--border);
}
