:root {
  /* Coptic Church Color Palette */
  --bg: #f5f1ed; /* warm off-white, like church walls */
  --surface: #ffffff;
  --ink: #3d2817; /* deep brown, like wood */
  --muted: #6b5444; /* muted brown */
  --primary: #8b1a1a; /* martyrs' blood red - carpet & altar veil */
  --primary-hover: #a52020;
  --primary-ink: #fff8f7;
  --border: #d4c4b0; /* warm stone border */
  --wood: #5c4033; /* iconostasis & pew wood */
  --wood-dark: #4a3326; /* darker wood accents */
  --gold: #d4af37; /* liturgical gold */
  --gold-light: #f4d47e; /* light gold accents */
  --red-carpet: #9b2226; /* deep carpet red */
  --altar-red: #a01c1c; /* altar veil red */
  --white-linen: #fffef9; /* pure liturgical white */
}

[data-theme="dark"] {
  /* Evening church / candlelight atmosphere */
  --bg: #1a1410; /* dark church interior */
  --surface: #2a2018; /* warm dark wood */
  --ink: #f5ede3; /* light parchment text */
  --muted: #b8a890; /* muted gold-brown */
  --primary: #c93a3a; /* glowing red (candlelit) */
  --primary-hover: #db5050;
  --primary-ink: #2a1614;
  --border: #4a3d2f; /* dark wood border */
  --wood: #3d2f24; /* dark wood */
  --wood-dark: #2a2018; /* deeper wood */
  --gold: #e6c558; /* glowing candlelight gold */
  --gold-light: #f4d896; /* bright gold highlights */
  --red-carpet: #b83838; /* rich evening red */
  --altar-red: #c94444; /* warm altar glow */
  --white-linen: #f8f4ed; /* candlelit white */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  /* Warm church interior gradient - stone to wood tones */
  background: linear-gradient(180deg, var(--white-linen), #f0e8dd 320px, var(--bg) 100%);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
}

[data-theme="dark"] body {
  /* Candlelit evening church atmosphere */
  background: linear-gradient(180deg, #221a12, #1c1510 320px, var(--bg) 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  /* Rich wood iconostasis appearance with gold ornament */
  background: linear-gradient(180deg, var(--wood) 0%, var(--wood-dark) 100%) url('assets/ornament-border.svg') top center repeat-x;
  background-size: auto, 100% 100%;
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(212, 175, 55, 0.3);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-light); }
.brand:hover { color: var(--gold); }
.brand-title { 
  font-family: "Cormorant Garamond", Georgia, serif; 
  font-weight: 700; 
  font-size: 22px; 
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.brand-mark { 
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)) brightness(1.1);
  width: 32px; 
  height: 32px;
  object-fit: contain;
  background: transparent;
  border-radius: 4px;
}
.nav-toggle { display: none; margin-right: 4px; font-size: 20px; background: none; border: 0; color: var(--gold); }
.header-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--wood-dark); 
  color: var(--gold);
  border: 2px solid var(--gold);
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.theme-toggle:hover { 
  background: var(--wood);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.3); 
  border-color: var(--gold-light);
}

/* Evening/candlelit header */
[data-theme="dark"] .site-header { 
  background: linear-gradient(180deg, var(--wood) 0%, var(--wood-dark) 100%) url('assets/ornament-border.svg') top center repeat-x;
  border-bottom-color: var(--gold);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(230, 197, 88, 0.4);
}

.layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; max-width: 1200px; margin: 0 auto; padding: 24px; }
.sidebar { position: sticky; top: 70px; align-self: start; height: calc(100dvh - 90px); overflow: auto; padding-right: 8px; }
.sections, .toc { 
  background: var(--white-linen); 
  border: 2px solid var(--gold); 
  border-radius: 10px; 
  padding: 18px;
  box-shadow: 0 2px 8px rgba(92, 64, 51, 0.15), inset 0 1px 0 rgba(212, 175, 55, 0.2);
}
.sections-title, .toc-title { 
  font-family: "Cormorant Garamond", Georgia, serif; 
  font-weight: 700; 
  font-size: 19px; 
  color: var(--red-carpet); 
  margin-bottom: 10px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
}
.sections nav ul { list-style: none; margin: 0; padding: 0; }
.sections nav li { margin: 8px 0; }
.sections nav a { 
  color: var(--wood); 
  text-decoration: none; 
  display: block; 
  padding: 8px 10px; 
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all 200ms ease;
}
.sections nav a:hover {
  background: rgba(212, 175, 55, 0.1);
  border-left-color: var(--gold);
}
.sections nav a.active { 
  background: linear-gradient(90deg, rgba(139, 26, 26, 0.1), rgba(139, 26, 26, 0.05)); 
  color: var(--altar-red); 
  font-weight: 600;
  border-left-color: var(--red-carpet);
}
.toc nav ul { list-style: none; margin: 0; padding: 0; }
.toc nav li { margin: 6px 0; }
.toc nav a { 
  color: var(--wood); 
  text-decoration: none; 
  border-left: 3px solid transparent; 
  padding-left: 10px; 
  display: block;
  transition: all 200ms ease;
}
.toc nav a:hover {
  color: var(--altar-red);
  border-left-color: var(--gold);
}
.toc nav a.active { 
  color: var(--altar-red); 
  border-left-color: var(--red-carpet);
  font-weight: 600;
}

.content { 
  background: var(--white-linen); 
  border: 3px solid var(--gold); 
  border-radius: 12px; 
  box-shadow: 0 4px 16px rgba(92, 64, 51, 0.2), inset 0 1px 0 rgba(212, 175, 55, 0.3);
}
.hero {
  position: relative;
  /* Red carpet & altar veil inspired gradient over image */
  background: linear-gradient(180deg, rgba(139, 26, 26, 0.7), rgba(139, 26, 26, 0.5)), url('assets/hero.png') center/cover no-repeat;
  border-bottom: 3px solid var(--gold);
  border-radius: 9px 9px 0 0;
  box-shadow: inset 0 -2px 8px rgba(212, 175, 55, 0.3);
}
.hero-inner { 
  padding: 52px 32px 28px; 
  color: var(--white-linen); 
  text-shadow: 0 2px 4px rgba(0,0,0,0.6), 0 1px 12px rgba(139, 26, 26, 0.8); 
}
.hero h1 { 
  font-family: "Cormorant Garamond", Georgia, serif; 
  font-size: 46px; 
  line-height: 1.15; 
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.hero .subtitle { 
  color: var(--gold-light); 
  margin: 0 0 8px; 
  font-size: 17px;
  font-weight: 500;
}

.sections-explore { padding: 24px 28px; }
.sections-explore-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.sections-explore h2 { 
  margin: 0; 
  font-size: 22px; 
  font-family: "Cormorant Garamond", Georgia, serif; 
  color: var(--altar-red);
  font-weight: 700;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 4px;
}
.sections-explore-sub { margin: 0; color: var(--wood); font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  gap: 10px; 
  padding: 18px; 
  border: 2px solid var(--gold); 
  border-radius: 10px; 
  background: var(--white-linen); 
  text-decoration: none; 
  color: var(--wood); 
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease, background 200ms ease;
  box-shadow: 0 2px 8px rgba(92, 64, 51, 0.12);
}
.card:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 8px 24px rgba(139, 26, 26, 0.2), 0 0 16px rgba(212, 175, 55, 0.3); 
  border-color: var(--red-carpet);
  background: #fffefb;
}
.card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.card .card-title { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  font-weight: 700; 
  color: var(--altar-red);
  font-size: 16px;
}
.card .card-title img { 
  width: 22px; 
  height: 22px; 
  border: 0;
  filter: drop-shadow(0 1px 2px rgba(212, 175, 55, 0.6)) brightness(1.1);
  object-fit: contain;
}
.card .card-desc { color: var(--wood); font-size: 14px; line-height: 1.5; }

@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .cards { grid-template-columns: 1fr; } }

.document { padding: 28px 32px 36px; }
.document h1, .document h2, .document h3 { 
  font-family: "Cormorant Garamond", Georgia, serif; 
  letter-spacing: 0.3px; 
  color: var(--wood-dark);
  font-weight: 700;
}
.document h1 { 
  font-size: 34px; 
  margin-top: 32px; 
  border-top: 2px solid var(--gold); 
  padding-top: 18px; 
  position: relative;
  color: var(--altar-red);
}
.document h1::after { 
  content: ""; 
  display: block; 
  margin: 12px auto 0; 
  width: 260px; 
  height: 14px; 
  background: url('assets/ornament-divider.svg') center no-repeat; 
  background-size: contain; 
  opacity: 1;
  filter: drop-shadow(0 1px 2px rgba(212, 175, 55, 0.5));
}
.document h2 { 
  font-size: 26px; 
  margin-top: 28px;
  color: var(--red-carpet);
  border-left: 4px solid var(--gold);
  padding-left: 12px;
}
.document h3 { 
  font-size: 21px; 
  margin-top: 22px;
  color: var(--wood);
}
.document p { margin: 14px 0; line-height: 1.7; }
.document blockquote { 
  border-left: 4px solid var(--gold); 
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.02)); 
  padding: 16px 18px; 
  margin: 16px 0; 
  color: var(--wood-dark); 
  position: relative;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 6px rgba(92, 64, 51, 0.1);
}
.document blockquote::before { 
  content: "\201C"; 
  position: absolute; 
  left: -12px; 
  top: -10px; 
  font-family: "Cormorant Garamond", Georgia, serif; 
  color: var(--gold); 
  font-size: 52px; 
  opacity: 0.7;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.document blockquote::after { 
  content: "\201D"; 
  position: absolute; 
  right: 12px; 
  bottom: -32px; 
  font-family: "Cormorant Garamond", Georgia, serif; 
  color: var(--gold); 
  font-size: 52px; 
  opacity: 0.4;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.document p.lead:first-letter { 
  float: left; 
  font-family: "Cormorant Garamond", Georgia, serif; 
  font-size: 3.6em; 
  line-height: 0.9; 
  padding-right: 10px; 
  color: var(--altar-red);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.document ul li::marker { color: var(--gold); font-size: 1.2em; }
.document a { color: var(--red-carpet); font-weight: 500; text-decoration: underline; text-decoration-color: var(--gold); }
.document a:hover { color: var(--altar-red); text-decoration-color: var(--gold-light); }
.document del { color: var(--red-carpet); text-decoration-color: var(--gold); }
.document mark { background: rgba(212, 175, 55, 0.25); color: var(--wood-dark); }
.document img { border-radius: 8px; border: 2px solid var(--gold); box-shadow: 0 2px 8px rgba(92, 64, 51, 0.15); }
.document .mermaid { border: 2px solid var(--gold); border-radius: 8px; padding: 12px; background: var(--white-linen); overflow: auto; }

/* Wedding Timeline Component */
.timeline {
  position: relative;
  margin: 32px 0;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--red-carpet), var(--gold));
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.timeline-item {
  position: relative;
  padding-left: 80px;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wood), var(--wood-dark));
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light);
  box-shadow: 0 4px 12px rgba(92, 64, 51, 0.3), inset 0 1px 2px rgba(212, 175, 55, 0.3);
  z-index: 2;
}

.timeline-content {
  background: var(--white-linen);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 3px 12px rgba(92, 64, 51, 0.15), inset 0 1px 0 rgba(212, 175, 55, 0.2);
  position: relative;
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid var(--gold);
}

.timeline-content::after {
  content: '';
  position: absolute;
  left: -9px;
  top: 21px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 9px solid var(--white-linen);
}

.timeline-content h4 {
  margin: 0 0 8px 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--altar-red);
}

.timeline-content p {
  margin: 8px 0 0 0;
  color: var(--wood);
  line-height: 1.6;
}

.timeline-content ul {
  margin: 12px 0 0 0;
  padding-left: 24px;
}

.timeline-content li {
  margin: 6px 0;
  color: var(--wood);
}

/* Decision point styling */
.timeline-decision .timeline-marker {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--wood-dark);
  font-size: 32px;
  border-width: 3px;
  box-shadow: 0 5px 14px rgba(212, 175, 55, 0.5), 0 0 18px rgba(212, 175, 55, 0.4);
  transform: rotate(45deg);
  font-weight: 700;
}

.timeline-decision .timeline-marker::before {
  content: '?';
  display: block;
  transform: rotate(-45deg);
}

.timeline-decision .timeline-content {
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.02));
}

.timeline-decision .timeline-content h4 {
  color: var(--gold);
}

/* Milestone/checkpoint styling */
.timeline-milestone .timeline-marker {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 28px;
  border-color: #34d399;
  box-shadow: 0 5px 14px rgba(16, 185, 129, 0.4), 0 0 18px rgba(52, 211, 153, 0.4);
}

.timeline-milestone .timeline-content {
  border: 3px solid #10b981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(52, 211, 153, 0.3);
}

.timeline-milestone .timeline-content h4 {
  color: #059669;
  font-size: 23px;
}

.timeline-milestone .timeline-content::before {
  border-right-color: #10b981;
}

/* Parallel tasks section */
.timeline-parallel {
  position: relative;
  padding-left: 80px;
  margin: 40px 0 32px 0;
}

.parallel-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--altar-red);
  margin: 0 0 20px 0;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold);
}

.parallel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.parallel-card {
  background: var(--white-linen);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(92, 64, 51, 0.15), inset 0 1px 0 rgba(212, 175, 55, 0.2);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.parallel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(139, 26, 26, 0.2), 0 0 12px rgba(212, 175, 55, 0.3);
}

.parallel-icon {
  font-size: 36px;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.4));
}

.parallel-card h5 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--red-carpet);
  margin: 8px 0 6px 0;
}

.parallel-card p {
  font-size: 14px;
  color: var(--wood);
  margin: 0;
  line-height: 1.5;
}

/* Special styling for ceremony day */
.timeline-ceremony .timeline-marker {
  background: linear-gradient(135deg, var(--red-carpet), var(--altar-red));
  font-size: 28px;
  border-width: 4px;
  box-shadow: 0 6px 16px rgba(139, 26, 26, 0.4), 0 0 20px rgba(212, 175, 55, 0.5);
}

.timeline-ceremony .timeline-content {
  border: 3px solid var(--red-carpet);
  box-shadow: 0 4px 16px rgba(139, 26, 26, 0.2), inset 0 1px 0 rgba(212, 175, 55, 0.3);
}

.timeline-ceremony .timeline-content::before {
  border-right-color: var(--red-carpet);
}

.timeline-ceremony .timeline-content h4 {
  font-size: 24px;
  color: var(--red-carpet);
}

/* Special styling for final step */
.timeline-final .timeline-marker {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--wood-dark);
  font-size: 26px;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.5), 0 0 24px rgba(212, 175, 55, 0.6);
}

.timeline-final .timeline-content {
  border: 3px solid var(--gold);
  background: linear-gradient(135deg, var(--white-linen), #fffdf5);
}

.timeline-final .timeline-content h4 {
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
  
  .timeline-item {
    padding-left: 60px;
  }
  
  .timeline-marker {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  
  .timeline-decision .timeline-marker {
    font-size: 24px;
  }
  
  .timeline-milestone .timeline-marker,
  .timeline-ceremony .timeline-marker,
  .timeline-final .timeline-marker {
    font-size: 22px;
  }
  
  .timeline-content {
    padding: 16px 18px;
  }
  
  .timeline-content h4 {
    font-size: 19px;
  }
  
  .timeline-ceremony .timeline-content h4 {
    font-size: 21px;
  }
  
  .timeline-parallel {
    padding-left: 0;
  }
  
  .parallel-title {
    font-size: 21px;
  }
  
  .parallel-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .parallel-card {
    padding: 16px;
  }
  
  .parallel-icon {
    font-size: 32px;
  }
  
  .parallel-card h5 {
    font-size: 17px;
  }
}

/* Dark mode timeline */
[data-theme="dark"] .timeline::before {
  background: linear-gradient(180deg, var(--gold), var(--primary), var(--gold));
}

[data-theme="dark"] .timeline-content {
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(230, 197, 88, 0.2);
}

[data-theme="dark"] .timeline-content::after {
  border-right-color: var(--surface);
}

[data-theme="dark"] .timeline-content h4 {
  color: var(--primary);
}

[data-theme="dark"] .timeline-content p,
[data-theme="dark"] .timeline-content li {
  color: var(--white-linen);
}

[data-theme="dark"] .timeline-ceremony .timeline-content {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(230, 197, 88, 0.3);
}

[data-theme="dark"] .timeline-final .timeline-content {
  background: var(--surface);
}

[data-theme="dark"] .timeline-decision .timeline-content {
  background: linear-gradient(135deg, rgba(230, 197, 88, 0.15), rgba(230, 197, 88, 0.05));
}

[data-theme="dark"] .timeline-decision .timeline-content h4 {
  color: var(--gold-light);
}

[data-theme="dark"] .timeline-milestone .timeline-content {
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .parallel-card {
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

[data-theme="dark"] .parallel-card h5 {
  color: var(--primary);
}

[data-theme="dark"] .parallel-card p {
  color: var(--white-linen);
}

[data-theme="dark"] .parallel-title {
  color: var(--primary);
}

[data-theme="dark"] .document {
  color: var(--white-linen); /* White text for readability */
}
[data-theme="dark"] .document h1 { color: var(--primary); }
[data-theme="dark"] .document h2 { color: var(--primary); }
[data-theme="dark"] .document h3 { color: var(--gold-light); }
[data-theme="dark"] .document p { color: var(--white-linen); }
[data-theme="dark"] .document blockquote { 
  background: linear-gradient(90deg, rgba(230, 197, 88, 0.12), rgba(230, 197, 88, 0.04)); 
  color: var(--white-linen); 
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .document a {
  color: var(--primary);
}
[data-theme="dark"] .document a:hover {
  color: var(--gold-light);
}
[data-theme="dark"] .document ul, [data-theme="dark"] .document ol {
  color: var(--white-linen);
}
[data-theme="dark"] .document p.lead:first-letter {
  color: var(--primary);
}

.back-to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; 
  border: 2px solid var(--gold);
  background: var(--wood-dark); 
  color: var(--gold-light); 
  cursor: pointer;
  display: none; align-items: center; justify-content: center; 
  box-shadow: 0 4px 16px rgba(92, 64, 51, 0.4), inset 0 1px 0 rgba(212, 175, 55, 0.3);
  font-size: 20px;
  font-weight: bold;
}
.back-to-top:hover {
  background: var(--wood);
  box-shadow: 0 6px 20px rgba(139, 26, 26, 0.3), 0 0 16px rgba(212, 175, 55, 0.5);
  border-color: var(--gold-light);
}

.site-footer { 
  text-align: center; 
  color: var(--wood); 
  padding: 32px 24px 28px; 
  font-size: 14px;
  background: linear-gradient(180deg, transparent, rgba(92, 64, 51, 0.03));
  border-top: 2px solid var(--gold);
  margin-top: 32px;
}
.footer-content { max-width: 800px; margin: 0 auto; }
.footer-links { margin-bottom: 16px; }
.footer-links a { 
  color: var(--wood); 
  text-decoration: none; 
  transition: color 200ms ease;
  font-weight: 500;
}
.footer-links a:hover { 
  color: var(--red-carpet); 
  text-decoration: underline;
  text-decoration-color: var(--gold);
}
.footer-separator { margin: 0 10px; color: var(--gold); opacity: 0.6; }
.footer-copyright { margin: 0; color: var(--muted); }

[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
  color: var(--muted);
}

/* Dark theme refinements */
[data-theme="dark"] .sections, [data-theme="dark"] .toc {
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(230, 197, 88, 0.15);
}
[data-theme="dark"] .sections-title, [data-theme="dark"] .toc-title {
  color: var(--primary);
}
[data-theme="dark"] .sections nav a {
  color: var(--white-linen); /* White text for readability */
}
[data-theme="dark"] .sections nav a:hover {
  background: rgba(230, 197, 88, 0.15);
}
[data-theme="dark"] .sections nav a.active {
  background: linear-gradient(90deg, rgba(201, 58, 58, 0.25), rgba(201, 58, 58, 0.12));
  color: var(--primary);
}
[data-theme="dark"] .toc nav a {
  color: var(--white-linen); /* White text for readability */
}
[data-theme="dark"] .toc nav a.active {
  color: var(--primary);
}

/* Dark mode main content area */
[data-theme="dark"] .content {
  background: var(--surface); /* Dark wood background */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .sections-explore {
  background: transparent;
}
[data-theme="dark"] .sections-explore h2 {
  color: var(--primary);
}
[data-theme="dark"] .sections-explore-sub {
  color: var(--muted);
}

[data-theme="dark"] .card {
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .card .card-title {
  color: var(--primary);
}
[data-theme="dark"] .card .card-desc {
  color: var(--white-linen);
}
[data-theme="dark"] .card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), 0 0 20px rgba(230, 197, 88, 0.3);
}

[data-theme="dark"] .contact-info {
  background: var(--surface);
}
[data-theme="dark"] .contact-info p {
  color: var(--white-linen);
}

/* Dark mode hero section */
[data-theme="dark"] .hero {
  background: linear-gradient(180deg, rgba(139, 26, 26, 0.8), rgba(139, 26, 26, 0.6)), url('assets/hero.png') center/cover no-repeat;
}
[data-theme="dark"] .hero-inner {
  color: var(--white-linen);
}
[data-theme="dark"] .hero h1 {
  color: var(--white-linen);
}
[data-theme="dark"] .hero .subtitle {
  color: var(--gold-light);
}

/* Static pages (privacy, cookies, contact) */
.static-page { grid-column: 1 / -1; max-width: 900px; margin: 0 auto; width: 100%; }
.contact-info { 
  background: var(--white-linen); 
  border: 2px solid var(--gold); 
  border-radius: 10px; 
  padding: 24px; 
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(92, 64, 51, 0.15), inset 0 1px 0 rgba(212, 175, 55, 0.2);
}
.contact-email { font-size: 19px; font-weight: 700; color: var(--altar-red); }
.contact-email a { 
  color: var(--red-carpet); 
  text-decoration: underline;
  text-decoration-color: var(--gold);
}
.contact-email a:hover { 
  color: var(--altar-red);
  text-decoration-color: var(--gold-light);
}
.contact-ornament { 
  text-align: center; 
  margin: 40px 0; 
  opacity: 0.5;
  filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.4));
}

/* Dark mode for static pages */
[data-theme="dark"] .static-page .document {
  color: var(--white-linen);
}
[data-theme="dark"] .static-page .document h1 {
  color: var(--primary);
}
[data-theme="dark"] .static-page .document h2 {
  color: var(--primary);
}
[data-theme="dark"] .static-page .document h3 {
  color: var(--gold-light);
}
[data-theme="dark"] .static-page .document p,
[data-theme="dark"] .static-page .document li {
  color: var(--white-linen);
}
[data-theme="dark"] .static-page .document a {
  color: var(--primary);
}
[data-theme="dark"] .static-page .document a:hover {
  color: var(--gold-light);
}
[data-theme="dark"] .static-page .document strong {
  color: var(--gold-light);
}
[data-theme="dark"] .contact-email {
  color: var(--primary);
}
[data-theme="dark"] .contact-email a {
  color: var(--primary);
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; order: 2; display: none; }
  .nav-toggle { display: inline-block; }
}
