/* Main Stylesheet - Consolidated */

/* === RESET & BASE === */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
    display: flex;
    min-height: 100vh;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #0f172a;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.title-xl {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.title-lg {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.title-md {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #0f172a;
}

.body-text {
    font-size: 0.938rem;
    line-height: 1.7;
    color: #475569;
}

p {
    margin: 0 0 16px 0;
    line-height: 1.7;
}

.body-text-sm {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

a {
    color: #3182ce;
    text-decoration: none;
    transition: all 0.15s ease;
}

a:hover {
    text-decoration: underline;
}

/* === NEW 3-COLUMN LAYOUT === */

/* Left Navigation - Modern Minimalist Design */
.left-navigation {
    width: 200px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    padding: 40px 0;
}

.left-nav-header {
    padding: 0 28px 48px 28px;
}

.site-logo {
    font-size: 0.688rem;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.site-name {
    margin-bottom: 0;
}

.name-chinese {
    font-size: 1.375rem;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 2px;
    letter-spacing: 0.02em;
    font-family: 'Inter', sans-serif;
}

.name-english {
    font-size: 0.813rem;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.02em;
    font-family: 'Inter', sans-serif;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 0;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.938rem;
    font-weight: 400;
    transition: all 0.25s ease;
    position: relative;
    letter-spacing: 0.01em;
}

.nav-menu-item:hover {
    color: #0f172a;
    text-decoration: none;
    padding-left: 32px;
}

.nav-menu-item.active {
    color: #0f172a;
    font-weight: 500;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.12) 0%, rgba(251, 191, 36, 0) 100%);
}

.nav-menu-item.active .nav-item-indicator {
    display: block;
}

.nav-item-indicator {
    display: none;
    width: 3px;
    height: 24px;
    background: #fbbf24;
    border-radius: 0 2px 2px 0;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Curated Lists Dropdown */
.nav-menu-item-wrapper {
    display: none;
}

.curated-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.curated-list-item:hover {
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
}

.curated-list-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.curated-list-text {
    flex: 1;
    line-height: 1.3;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 200px;
    margin-right: 200px;
    overflow-y: auto;
    padding: 60px 80px 100px 80px;
}

.content-section {
    max-width: 900px;
    margin: 0 auto;
}

/* Secondary Navigation - Humble Floating Card */
.secondary-nav {
    width: 200px;
    background: transparent;
    position: fixed;
    right: 40px;
    top: 120px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    padding-left: 20px;
}

.secondary-nav-title {
    font-size: 0.688rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px 0;
}

.secondary-nav-section {
    margin-bottom: 28px;
    margin-right: 12px;
}

.secondary-nav-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px 0;
}

.secondary-nav-link {
    display: block;
    padding: 6px 0;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.813rem;
    font-weight: 400;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    border-left: 2px solid transparent;
    padding-left: 12px;
}

.secondary-nav-link:hover {
    color: #64748b;
    text-decoration: none;
    border-left-color: #e5e7eb;
    padding-left: 16px;
}

.secondary-nav-link.active {
    color: #0f172a;
    font-weight: 500;
    border-left-color: #fbbf24;
    padding-left: 16px;
}

/* === EXTERNAL PROJECTS GRID === */
.external-projects-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 16px;
}

.external-project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border-radius: 8px;
    overflow: visible;
    transition: all 0.2s ease;
    position: relative;
    height: auto;
    margin-bottom: 8px;
}

.external-project-card:hover {
    transform: translateY(-2px);
}

.external-project-card:hover .project-info {
    opacity: 1;
    max-height: 100px;
    padding: 12px;
}

.project-thumbnail-wrapper {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: white;
}

.project-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
    background: transparent;
}

.project-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    min-height: 120px;
}

.project-info {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 0 0 8px 8px;
    padding: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.project-tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

/* === PAGE HEADERS (UNIFIED) === */
.page-header {
    margin-bottom: 40px;
}

.page-subtitle {
    font-size: 0.938rem;
    color: #64748b;
    margin: 8px 0 0 0;
}

/* === ABOUT PAGE === */
.about-header {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 48px;
}

.about-profile-picture {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.about-profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text {
    flex: 1;
}

.about-name {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
    font-family: 'Inter', sans-serif;
}

.about-name-chinese {
    font-weight: 200;
    color: #64748b;
    font-size: 1.75rem;
    margin-left: 0px;
    font-family: 'Inter', sans-serif;
}

.about-title {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    letter-spacing: 0.01em;
    font-weight: 500;
}

.about-content p {
    font-size: 0.938rem;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 20px;
}

/* === HOME SECTION === */
.home-section {
    margin-bottom: 40px;
}

.home-section p {
    font-size: 0.938rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 16px;
}

/* === EXPERIENCE SECTION === */
.experience-section {
    margin-bottom: 32px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.experience-section .title-lg {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #fbbf24;
}

.section-icon {
    color: #fbbf24;
    flex-shrink: 0;
}

.experience-item {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.experience-item:last-child {
    border-bottom: none;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    gap: 12px;
}

.experience-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.experience-period {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    font-weight: 500;
    flex-shrink: 0;
}

.experience-institution,
.experience-organization,
.experience-agency {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.experience-location,
.experience-field,
.experience-role {
    font-size: 0.813rem;
    color: #94a3b8;
    margin: 0 0 2px 0;
    line-height: 1.4;
}

.experience-description {
    font-size: 0.813rem;
    color: #64748b;
    margin: 4px 0 0 0;
    line-height: 1.5;
}

.experience-amount {
    font-size: 0.813rem;
    color: #64748b;
    margin: 2px 0;
    font-weight: 500;
}

.experience-thesis,
.experience-advisor {
    font-size: 0.813rem;
    color: #64748b;
    margin: 3px 0;
    line-height: 1.5;
}

/* Professional Service - Grouped Roles List */
.experience-roles-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.experience-role-item {
    font-size: 0.875rem;
    color: #475569;
    margin: 6px 0;
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
}

.experience-role-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #fbbf24;
    font-weight: bold;
}

.experience-period-inline {
    font-size: 0.813rem;
    color: #94a3b8;
    font-weight: normal;
}

.experience-item .title-md {
    font-size: 1rem;
    margin-bottom: 6px;
}

.experience-item .body-text {
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.experience-item .body-text-sm {
    font-size: 0.813rem;
    line-height: 1.5;
}

/* === COMPACT EXPERIENCE ITEMS === */
.experience-item-compact {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f8fafc;
}

.experience-item-compact:last-child {
    border-bottom: none;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    gap: 12px;
}

.exp-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exp-bullet {
    color: #fbbf24;
    flex-shrink: 0;
}

.exp-date {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    font-weight: 500;
}

.exp-org {
    font-size: 0.813rem;
    color: #64748b;
    margin: 0 0 2px 0;
    line-height: 1.5;
}

.exp-detail {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 2px 0 0 0;
    line-height: 1.5;
    font-style: italic;
}

/* Awards */
.award-item {
    font-size: 0.875rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.award-date {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Grants */
.grant-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.grant-detail {
    font-size: 0.813rem;
    color: #64748b;
    margin: 0 0 2px 0;
    line-height: 1.5;
}

.grant-amount {
    font-weight: 600;
    color: #475569;
}

.grant-note {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 2px 0 0 0;
    font-style: italic;
}

/* Service */
.service-item {
    font-size: 0.875rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.service-date {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* === BLOG PAGE === */
.blog-list-container {
    margin-top: 24px;
}

.blog-post-summary {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.blog-post-summary:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.blog-post-summary:last-child {
    margin-bottom: 0;
}

.blog-post-summary h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    font-family: 'Inter', sans-serif;
}

.blog-post-summary h3 a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-post-summary h3 a:hover {
    color: #fbbf24;
    text-decoration: none;
}

.post-meta {
    font-size: 0.813rem;
    color: #64748b;
    margin: 0 0 12px 0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.post-date,
.post-creation-date,
.post-language {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.post-date::before {
    content: "📅";
    font-size: 0.875rem;
}

.post-language::before {
    content: "🌐";
    font-size: 0.875rem;
}

.blog-post-meta {
    font-size: 0.938rem;
    color: #64748b;
    margin: 12px 0 32px 0;
    padding: 16px 20px;
    background: #f8fafc;
    border-left: 3px solid #fbbf24;
    border-radius: 8px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.blog-post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.blog-post-meta .post-date::before {
    content: "📅";
}

.blog-post-meta .post-creation-date::before {
    content: "✏️";
}

.blog-post-meta .post-language::before {
    content: "🌐";
}

.post-excerpt {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #64748b;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.813rem;
    color: #94a3b8;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: #fbbf24;
}

.breadcrumbs .separator {
    color: #cbd5e1;
}

.breadcrumbs .current {
    color: #0f172a;
}

/* Blog post page specific */
.blog-post-header {
    margin-bottom: 32px;
}

.blog-post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #1e293b;
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-post-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 32px 0 16px 0;
    color: #0f172a;
}

.blog-post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: #0f172a;
}

.blog-post-content p {
    margin: 0 0 16px 0;
}

.blog-post-content a {
    color: #3182ce;
    text-decoration: none;
    border-bottom: 1px solid #bee3f8;
    transition: all 0.2s ease;
}

.blog-post-content a:hover {
    color: #2c5aa0;
    border-bottom-color: #3182ce;
}

/* Old navbar styles - deprecated */

/* === BUTTONS === */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #2c5aa0;
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    /* Stack secondary nav below content on tablets and mobile */
    body {
        flex-direction: column;
    }
    
    .left-navigation {
        width: 100%;
        position: relative;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        min-height: auto;
    }
    
    .left-nav-header {
        border-bottom: none;
        border-right: 1px solid #e2e8f0;
        padding: 12px 16px;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: row;
        padding: 0;
        flex: 1;
    }
    
    .nav-menu-item {
        flex: 1;
        justify-content: center;
        padding: 12px 8px;
    }
    
    .nav-item-indicator {
        border-left: none;
        border-right: none;
        border-top: 3px solid #fbbf24;
        border-left: 0;
        border-right: 0;
        bottom: 0;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
    }
    
    .left-nav-footer {
        border-top: none;
        border-left: 1px solid #e2e8f0;
    }
    
    .nav-profile-picture {
        width: 60px;
    }
    
    .main-content {
        margin-left: 0;
        margin-right: 0;
        padding: 30px 24px;
    }
    
    .secondary-nav {
        position: relative;
        width: 100%;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding: 24px 20px;
    }
}

@media (max-width: 1024px) {
    /* Fix left navigation to horizontal top bar */
    .left-navigation {
        width: 100%;
        height: auto;
        min-height: 60px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        flex-direction: column;
        padding: 0;
        border-bottom: 1px solid #e2e8f0;
        z-index: 1000;
    }
    
    .left-nav-header {
        padding: 8px 16px;
        min-width: auto;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .site-logo {
        font-size: 0.75rem;
        margin-bottom: 0;
    }
    
    /* Hide full name on mobile */
    .site-name {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: row;
        flex: 1;
        padding: 0;
        align-items: stretch;
        min-height: 48px;
    }
    
    .nav-menu-item {
        padding: 0 8px;
        font-size: 0.875rem;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        min-height: 48px;
    }
    
    /* Active indicator points downward on mobile */
    .nav-menu-item.active .nav-item-indicator {
        display: block;
        width: 24px;
        height: 3px;
        background: #fbbf24;
        border-radius: 2px 2px 0 0;
        position: absolute;
        left: 50%;
        bottom: 0;
        top: auto;
        transform: translateX(-50%);
    }
    
    /* Keep text visible and properly sized on mobile */
    .nav-menu-item .nav-item-text {
        font-size: 0.875rem;
    }
    
    /* Add home icon before index text */
    .nav-menu-item[data-page="index.html"] .nav-item-text::before {
        content: "🏠 ";
        font-size: 1rem;
    }
    
    /* Hide curated lists dropdown wrapper on mobile */
    .nav-menu-item-wrapper {
        flex: 1;
    }
        
    /* Adjust main content for top navigation */
    .main-content {
        margin-left: 0;
        margin-top: 80px;
        padding: 20px 16px;
    }
    
    .secondary-nav {
        padding: 20px 16px;
    }
    
    /* Content section as flex container for ordering (only on output page) */
    .page-output .content-section {
        display: flex;
        flex-direction: column;
    }
    
    /* Order elements properly on mobile for output page */
    .page-output .breadcrumbs {
        order: 1;
    }
    
    .page-output .page-header-row {
        order: 2;
    }
    
    .page-output .curated-list-icons {
        order: 3;
        display: none; /* Hide old inline icons on mobile */
    }
    
    .page-output .curated-icons-sidebar {
        order: 3; /* Show sidebar icons under H1 */
    }
    
    .page-output .curated-list-info-box {
        order: 4;
    }
    
    .page-output .output-tab-container {
        order: 5;
    }
    
    /* Breadcrumbs styling for all pages */
    .breadcrumbs {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
    
    /* Reduce page title size on mobile */
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    /* Hide secondary nav on mobile */
    .secondary-nav {
        position: static;
        width: 100%;
        max-height: none;
        right: auto;
        top: auto;
        padding: 20px 16px;
        margin-top: 24px;
    }
}
