/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
  text-align: center;
  padding: 30px 20px 20px;
}

.header-content h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tagline {
  font-size: 1.1em;
  font-style: italic;
  opacity: 0.95;
}

/* Navigation */
nav {
  background-color: rgba(0,0,0,0.2);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px 20px;
  gap: 5px;
  background: none;
  border: none;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
}

nav li {
  margin: 0;
}

nav a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 15px 25px;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

nav a:hover,
nav a.active {
  background-color: rgba(255,255,255,0.2);
}

/* Main Content */
main {
  min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(139,0,0,0.7), rgba(220,20,60,0.7)), 
              url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23DC143C" width="1200" height="600"/></svg>');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 100px 20px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hero h2 {
  font-size: 3em;
  margin-bottom: 20px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.hero p {
  font-size: 1.5em;
  max-width: 800px;
  margin: 0 auto;
}

/* About Section */
.about {
  padding: 60px 20px;
  background-color: white;
}

.about h2 {
  text-align: center;
  font-size: 2.5em;
  color: #8B0000;
  margin-bottom: 40px;
}

.story-text p {
  font-size: 1.1em;
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Mission Section */
.mission {
  padding: 60px 20px;
  background-color: #f9f9f9;
}

.mission h2 {
  text-align: center;
  font-size: 2.5em;
  color: #8B0000;
  margin-bottom: 50px;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.mission-card {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.3s ease;
}

.mission-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.mission-card h3 {
  font-size: 1.5em;
  color: #DC143C;
  margin-bottom: 15px;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
  color: white;
  text-align: center;
  padding: 60px 20px;
}

.page-header h2 {
  font-size: 2.5em;
  margin-bottom: 15px;
}

.page-header p {
  font-size: 1.2em;
  opacity: 0.95;
}

/* Events Section */
.events-section {
  padding: 60px 20px;
  background-color: white;
}

.events-section h3 {
  font-size: 2em;
  color: #8B0000;
  margin-bottom: 30px;
  text-align: center;
}

.event-card {
  display: flex;
  gap: 30px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.event-date {
  flex-shrink: 0;
  background: linear-gradient(135deg, #8B0000, #DC143C);
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-date .month {
  font-size: 1.2em;
  font-weight: bold;
  text-transform: uppercase;
}

.event-date .day {
  font-size: 2.5em;
  font-weight: bold;
  line-height: 1;
  margin: 10px 0;
}

.event-date .year {
  font-size: 1.1em;
}

.event-details h4 {
  font-size: 1.8em;
  color: #8B0000;
  margin-bottom: 10px;
}

.location {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 15px;
}

.description {
  margin-bottom: 20px;
  line-height: 1.7;
}

.event-highlights {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.event-highlights h5 {
  color: #DC143C;
  margin-bottom: 10px;
}

.event-highlights ul {
  margin-left: 20px;
}

.event-highlights li {
  margin-bottom: 8px;
}

.past-events {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.past-event {
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 8px;
  border-left: 4px solid #DC143C;
}

.past-event h4 {
  color: #8B0000;
  margin-bottom: 10px;
}

/* Button Styles */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, #8B0000, #DC143C);
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: linear-gradient(135deg, #666, #888);
}

/* Photo Upload Section */
.upload-section {
  padding: 40px 20px;
  background-color: white;
}

.upload-card {
  max-width: 700px;
  margin: 0 auto;
  background: #f9f9f9;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  text-align: center;
}

.upload-card h3 {
  color: #8B0000;
  font-size: 2em;
  margin-bottom: 15px;
}

.upload-form {
  margin-top: 30px;
}

#photoUpload {
  display: none;
}

.upload-btn {
  display: inline-block;
  background: linear-gradient(135deg, #8B0000, #DC143C);
  color: white;
  padding: 12px 30px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#photoCaption {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
  margin-bottom: 15px;
}

#uploadStatus {
  margin-top: 20px;
  font-weight: bold;
}

/* Gallery Section */
.gallery-section {
  padding: 60px 20px;
  background-color: #f5f5f5;
}

.gallery-section h3 {
  text-align: center;
  font-size: 2em;
  color: #8B0000;
  margin-bottom: 40px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  background: white;
}

.photo-item:hover {
  transform: scale(1.05);
}

.photo-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.photo-caption {
  padding: 15px;
  background: white;
  font-size: 0.95em;
  color: #666;
}

/* Family Tree Form */
.tree-form-section {
  padding: 40px 20px;
  background-color: white;
}

.form-card {
  max-width: 800px;
  margin: 0 auto;
  background: #f9f9f9;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.form-card h3 {
  color: #8B0000;
  font-size: 2em;
  margin-bottom: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #DC143C;
}

/* Tree Display */
.tree-display-section {
  padding: 60px 20px;
  background-color: #f5f5f5;
}

.tree-display-section h3 {
  text-align: center;
  font-size: 2em;
  color: #8B0000;
  margin-bottom: 40px;
}

.tree-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 50px;
}

.stat-card {
  background: white;
  padding: 30px 50px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-number {
  display: block;
  font-size: 3em;
  font-weight: bold;
  color: #DC143C;
}

.stat-label {
  display: block;
  font-size: 1.1em;
  color: #666;
  margin-top: 10px;
}

.family-tree-display {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  max-width: 1000px;
  margin: 0 auto;
}

.tree-member {
  background: #f9f9f9;
  border-left: 4px solid #DC143C;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 5px;
}

.tree-member h4 {
  color: #8B0000;
  font-size: 1.4em;
  margin-bottom: 10px;
}

.tree-member-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  color: #666;
}

.tree-member-info p {
  margin: 5px 0;
}

.tree-member-notes {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
  font-style: italic;
  color: #555;
}

/* Contact Section */
.contact-section {
  padding: 60px 20px;
  background-color: white;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-form-card,
.contact-info-card {
  background: #f9f9f9;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.contact-form-card h3,
.contact-info-card h3 {
  color: #8B0000;
  font-size: 1.8em;
  margin-bottom: 25px;
}

.info-block {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid #ddd;
}

.info-block:last-child {
  border-bottom: none;
}

.info-block h4 {
  color: #DC143C;
  font-size: 1.3em;
  margin-bottom: 10px;
}

.info-block p {
  color: #666;
  line-height: 1.6;
}

.quick-links {
  list-style: none;
  padding: 0;
}

.quick-links li {
  margin-bottom: 10px;
}

.quick-links a {
  color: #DC143C;
  text-decoration: none;
  transition: color 0.3s ease;
}

.quick-links a:hover {
  color: #8B0000;
  text-decoration: underline;
}

/* Footer */
footer {
  background-color: #8B0000;
  color: white;
  text-align: center;
  padding: 30px 20px;
  margin-top: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content h1 {
    font-size: 1.8em;
  }

  .hamburger {
    display: flex;
  }

  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(139,0,0,0.97);
    padding: 0;
  }

  nav ul.open {
    display: flex;
  }

  nav a {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: left;
  }
  
  .hero h2 {
    font-size: 2em;
  }
  
  .hero p {
    font-size: 1.2em;
  }
  
  .event-card {
    flex-direction: column;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .tree-stats {
    flex-direction: column;
    gap: 20px;
  }
}
/* ===================================
   FAMILY TREE - NESTED STYLES
   Add these to the bottom of style.css
   =================================== */

.tree-node {
  position: relative;
  margin-bottom: 8px;
}

.founder-node {
  margin-left: 0 !important;
}

/* Vertical connector line from parent to children */
.tree-children {
  position: relative;
  margin-left: 24px;
  padding-left: 20px;
  border-left: 3px solid #DC143C;
  margin-top: 6px;
}

/* Horizontal connector tick for each child node */
.tree-children > .tree-node {
  position: relative;
}

.tree-children > .tree-node::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 22px;
  width: 20px;
  height: 3px;
  background-color: #DC143C;
}

/* Member card */
.tree-member-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  overflow: visible;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease;
  margin-bottom: 4px;
}

.tree-member-card:hover {
  box-shadow: 0 4px 12px rgba(139,0,0,0.15);
  border-color: #DC143C;
}

/* Founder gets a special style */
.founder-card {
  border-color: #8B0000;
  border-width: 3px;
  background: linear-gradient(135deg, #fff8f8, #ffffff);
}

/* Clickable header row */
.tree-member-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  user-select: none;
}

.founder-card .tree-member-header {
  background: linear-gradient(135deg, #8B0000, #DC143C);
  color: white;
  border-bottom: none;
}

.tree-member-header:hover {
  background: #fff0f0;
}

.founder-card .tree-member-header:hover {
  background: linear-gradient(135deg, #7a0000, #c01230);
}

.tree-toggle {
  font-size: 0.8em;
  color: #DC143C;
  min-width: 16px;
  transition: transform 0.2s;
}

.founder-card .tree-toggle {
  color: white;
}

.tree-member-header h4 {
  flex: 1;
  margin: 0;
  font-size: 1.1em;
  color: #8B0000;
}

.founder-card .tree-member-header h4 {
  color: white;
  font-size: 1.25em;
}

/* Generation badge */
.tree-gen-badge {
  font-size: 0.75em;
  background: #DC143C;
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 600;
}

.founder-badge {
  background: rgba(255,255,255,0.25);
}

/* Expandable details section */
.tree-member-details {
  padding: 14px 18px;
}

.tree-member-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
}

.tree-member-info p {
  margin: 0;
  font-size: 0.9em;
  color: #555;
}

.tree-member-notes {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  font-style: italic;
  color: #666;
  font-size: 0.9em;
}

/* Responsive - reduce indent on small screens */
@media (max-width: 768px) {
  .tree-children {
    margin-left: 10px;
    padding-left: 12px;
  }

  .tree-node .tree-children > .tree-node::before {
    left: -12px;
    width: 12px;
  }

  .tree-gen-badge {
    display: none;
  }
}