/**
 * Theme Name:       HeritageForge Theme
 * Theme URI:        https://heritageforge.com
 * Description:      Official companion theme for the HeritageForge Tree genealogy plugin.
 * Version:          1.0.10
 * Author:           HeritageForge
 * Author URI:       https://heritageforge.com
 * Requires at least: 6.4
 * Tested up to:      6.7
 * Requires PHP:      8.0
 * Text Domain:       heritageforge-theme
 * License:           GNU General Public License v2 or later
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.html
 */

/* ====================== Base ====================== */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #334155;
    margin: 0;
}

.heritageforge-single-ancestor,
.heritageforge-archive-ancestor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
}

/* ====================== Header ====================== */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
}

.site-branding .site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.site-branding a {
    text-decoration: none;
    color: inherit;
}

.main-navigation {
    flex: 1;
    text-align: right;
}

.main-navigation ul,
.menu-primary-container ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    justify-content: flex-end;
}

.main-navigation a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    padding: 1.25rem 0;
    transition: color 0.2s ease;
}

.main-navigation a:hover {
    color: #0066cc;
}

/* ====================== Single Ancestor - Portrait Fix ====================== */
.person-hero {
    display: flex !important;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: flex-start;
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 102, 204, 0.12);
    margin-bottom: 4rem;
}

.portrait-wrapper {
    flex: 0 0 240px;
    max-width: 240px;
}

.portrait-large,
.portrait-placeholder {
    width: 100% !important;
    max-width: 240px !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 12px solid #f8fafc;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    display: block;
}

.portrait-placeholder {
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7rem;
    color: #94a3b8;
}

.person-meta h1 {
    font-size: 2.8rem;
    margin: 0 0 0.8rem;
    line-height: 1.1;
    color: #1e293b;
}

.lifespan { font-size: 1.55rem; color: #475569; margin-bottom: 1rem; }
.places { font-size: 1.1rem; color: #64748b; }

/* Section titles */
.section-title {
    font-size: 1.9rem !important;
    color: #0066cc !important;
    border-bottom: 4px solid #e2e8f0 !important;
    padding-bottom: 0.8rem;
    margin: 3.5rem 0 2rem !important;
}

.family-section,
.biography-section {
    margin-bottom: 4rem;
}

.biography-content {
    font-size: 1.15rem;
    line-height: 1.75;
    color: #334155;
}

.no-biography {
    font-style: italic;
    color: #64748b;
}

/* Pro teaser */
.pro-teaser-box {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 3rem 0;
    font-size: 1.1rem;
}

.pro-upgrade-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.9rem 2.5rem;
    background: #d97706;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
}

.pro-upgrade-btn:hover { background: #b45309; }

/* ====================== Archive Ancestor ====================== */
.archive-header {
    margin-bottom: 3rem;
    text-align: center;
}

.archive-title {
    font-size: 2.4rem;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

.archive-description {
    font-size: 1.2rem;
    color: #64748b;
}

.ancestors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.ancestor-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.ancestor-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 102, 204, 0.15);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-portrait {
    height: 180px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portrait-small {
    width: 120px !important;
    height: 120px !important;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid #ffffff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.portrait-placeholder-small {
    width: 120px;
    height: 120px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #94a3b8;
}

.card-content {
    padding: 1.25rem;
    text-align: center;
}

.card-name {
    font-size: 1.35rem;
    margin: 0 0 0.4rem;
    color: #1e293b;
}

.card-lifespan {
    font-size: 1rem;
    color: #64748b;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border-radius: 16px;
}

/* ====================== Responsive ====================== */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .main-navigation,
    .menu-primary-container {
        text-align: center;
        width: 100%;
    }
    
    .main-navigation ul,
    .menu-primary-container ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .heritageforge-single-ancestor,
    .heritageforge-archive-ancestor {
        padding: 1.5rem 1rem;
    }
    
    .person-hero {
        flex-direction: column !important;
        text-align: center;
        padding: 2rem 1.5rem;
    }
    
    .portrait-wrapper {
        flex: 0 0 auto;
        max-width: 180px;
        margin: 0 auto;
    }
    
    .portrait-large,
    .portrait-placeholder {
        max-width: 180px !important;
        height: auto !important;
    }
    
    .ancestors-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ====================== Footer ====================== */
.site-footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 3rem 0 2rem;
    margin-top: 5rem;
    font-size: 0.95rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: space-between;
    align-items: flex-start;
}

.site-info p {
    margin: 0.4rem 0;
}

.site-info a {
    color: #60a5fa;
}

.footer-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-navigation a {
    color: #cbd5e1;
    text-decoration: none;
}

.footer-navigation a:hover {
    color: #93c5fd;
}

.footer-pro-teaser {
    margin-top: 0.5rem;
}

.pro-teaser-archive {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 3rem auto 2rem;
    max-width: 800px;
    font-size: 1.05rem;
}

.pro-teaser-archive strong {
    color: #d97706;
}

/* ====================== Responsive Footer ====================== */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-navigation ul {
        justify-content: center;
    }
}

/* ====================== Archive Filters ====================== */
.archive-filters {
    margin-bottom: 2.5rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 240px;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.gender-filter {
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    min-width: 140px;
}

.archive-filters button,
.archive-filters .button {
    padding: 0.75rem 1.5rem;
}

/* Pro teaser on archive */
.pro-teaser-archive {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 3rem auto 2rem;
    max-width: 820px;
    font-size: 1.05rem;
}

.pro-teaser-archive strong {
    color: #d97706;
}

/* ====================== Archive Filters Phase 4.2 ====================== */
.archive-filters {
    margin-bottom: 2.5rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input, .year-input, .gender-filter, .living-filter {
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.pro-filter-teaser {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.5rem;
    width: 100%;
}

.pro-filter-teaser a {
    color: #0066cc;
    font-weight: 500;
}

/* Floating Add Button */
.add-person-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: #0066cc;
    color: white;
    font-size: 28px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.3);
    text-decoration: none;
    z-index: 999;
    transition: all 0.2s ease;
}

.add-person-float:hover {
    background: #0052a3;
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .archive-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-person-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Relationship summary on cards (Pro) */
.card-relations {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.4rem;
}

/* Make year inputs smaller on mobile */
@media (max-width: 768px) {
    .year-input {
        width: 100% !important;
    }
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-navigation ul {
        justify-content: center;
    }
}

/* ====================== Mobile Hamburger Menu ====================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #1e293b;
    padding: 0.5rem;
    z-index: 1000;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        max-height: 0;
        overflow-y: auto;
        transition: max-height 0.4s ease;
        z-index: 999;
        padding: 0;
    }
    
    .main-navigation.active {
        max-height: 70vh;
        padding: 1rem 0;
    }
    
    .main-navigation ul,
    .menu-primary-container ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1.5rem;
        margin: 0;
    }
    
    .main-navigation a {
        padding: 0.85rem 0;
        display: block;
        font-size: 1.1rem;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .main-navigation a:last-child {
        border-bottom: none;
    }
}

/* Portrait improvements */
.portrait-placeholder,
.portrait-placeholder-small {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7rem;           /* large on single */
    color: #94a3b8;
    background: #e2e8f0;
    border-radius: 50%;
}

.portrait-placeholder-small {
    font-size: 4rem;
}


/* ====================== Professional Blue Gender Icons ====================== */
.portrait-placeholder,
.portrait-placeholder-small {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #e2e8f0 !important;
    border-radius: 50% !important;
    font-size: 6.5rem;
    font-weight: 300;
    line-height: 1;
    color: #1e40af !important;     /* Deep blue */
}

.portrait-placeholder-small {
    font-size: 3.8rem !important;
}

/* Male */
.male-icon {
    color: #1e40af !important;
    font-size: 7rem !important;
}

/* Female */
.female-icon {
    color: #3b82f6 !important;
    font-size: 6.8rem !important;
}

/* Unknown */
.unknown-icon {
    color: #64748b !important;
}