/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

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

/* Header */
.header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.site-title a {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #2563eb;
}

/* Main content */
.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

/* Members grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.member-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.member-card a {
    text-decoration: none;
    color: inherit;
}

.member-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    display: block;
    border: 3px solid #e2e8f0;
}

.member-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 auto 1rem;
}

.member-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.member-title {
    font-size: 0.9rem;
    color: #2563eb;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.member-bio {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

/* Member profile page */
.member-profile {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.profile-title {
    font-size: 1.25rem;
    color: #2563eb;
    font-weight: 500;
}

.profile-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #374151;
}

.profile-content h1,
.profile-content h2,
.profile-content h3,
.profile-content h4,
.profile-content h5,
.profile-content h6 {
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.profile-content h1 {
    font-size: 2rem;
}

.profile-content h2 {
    font-size: 1.5rem;
}

.profile-content h3 {
    font-size: 1.25rem;
}

.profile-content p {
    margin-bottom: 1rem;
}

.profile-content ul,
.profile-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.profile-content li {
    margin-bottom: 0.5rem;
}

.profile-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #64748b;
}

.profile-content code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.profile-content pre {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.profile-content pre code {
    background: none;
    padding: 0;
}

.profile-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 2rem 0;
    text-align: center;
}

/* Family Tree Styles */
.family-tree-section {
    margin: 4rem 0;
}

.family-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.generation {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

.generation-label {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2rem;
    text-align: center;
    padding: 0.5rem 1.5rem;
    background: #2563eb;
    color: white;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.generation-members {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.family-unit {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
}

.family-unit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -0.5rem;
    right: -0.5rem;
    height: 2px;
    background: #cbd5e1;
    z-index: 1;
    transform: translateY(-50%);
}

.tree-member {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    min-width: 200px;
}

.tree-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.tree-member-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tree-member-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    display: block;
    border: 3px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

.tree-member:hover .tree-member-photo {
    border-color: #2563eb;
}

.tree-member-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 auto 1rem;
}

.tree-member-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.tree-member-title {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.3;
}

/* Placeholder Member Styles */
.tree-member-placeholder {
    opacity: 0.7;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    cursor: default;
}

.tree-member-placeholder:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tree-member-placeholder .tree-member-photo,
.tree-member-placeholder .tree-member-photo-placeholder {
    opacity: 0.6;
    border-color: #cbd5e1;
}

.tree-member-placeholder .tree-member-name {
    color: #64748b;
}

.tree-member-placeholder .tree-member-title {
    color: #94a3b8;
}

.placeholder-status {
    display: block;
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 500;
    margin-top: 0.25rem;
    font-style: italic;
}

.tree-member-content {
    display: block;
    text-align: center;
}

/* Deceased Member Styles */
.tree-member-deceased {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #d1d5db;
    position: relative;
}

.tree-member-deceased::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #d97706);
    border-radius: 15px;
    z-index: -1;
}

.tree-member-deceased .tree-member-photo,
.tree-member-deceased .tree-member-photo-placeholder {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.deceased-status {
    display: block;
    font-size: 0.75rem;
    color: #d97706;
    font-weight: 600;
    margin-top: 0.25rem;
    font-style: italic;
}

.tree-member-deceased .tree-member-name {
    color: #374151;
    font-weight: 600;
}

.tree-member-deceased .tree-member-title {
    color: #6b7280;
}

.generation-connector {
    width: 2px;
    height: 2rem;
    background: linear-gradient(to bottom, #cbd5e1, #94a3b8);
    position: relative;
}

.generation-connector::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #2563eb;
    border-radius: 50%;
}

/* Family connections for couples */
.family-unit {
    position: relative;
}

.family-unit .tree-member:not(:last-child)::after {
    content: '♥';
    position: absolute;
    top: 50%;
    right: -1rem;
    transform: translateY(-50%);
    color: #ef4444;
    font-size: 1.2rem;
    z-index: 3;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .family-tree {
        padding: 1rem;
        gap: 2rem;
    }
    
    .generation-members {
        flex-direction: column;
        align-items: center;
    }
    
    .family-unit {
        flex-direction: column;
        gap: 1rem;
    }
    
    .family-unit::before {
        display: none;
    }
    
    .family-unit .tree-member:not(:last-child)::after {
        content: '♥';
        position: static;
        transform: none;
        display: block;
        text-align: center;
        margin: 0.5rem 0;
    }
    
    .tree-member {
        min-width: 280px;
    }
    
    .member-profile {
        padding: 2rem 1.5rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .profile-name {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .member-profile {
        padding: 1.5rem 1rem;
    }
}