/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    font-size: 20px; /* Increased from 18px */
}

:root {
    --sidebar-width: 260px;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Unified main column styles (home + inner pages) */
.main-content,
.page-container {
    flex: 1;
    padding: 60px 40px;
    max-width: none;
    /* Removed margin-right reservation since sidebar is now in normal flow */
}

/* Sidebar */
/* Sidebar converted to normal flex column (Option D) and visually emphasized (Option C) */
.sidebar {
    flex: 0 0 var(--sidebar-width); /* Uniform width via CSS variable */
    width: var(--sidebar-width); /* Explicit width to avoid flex rounding differences */
    max-width: var(--sidebar-width);
    flex-shrink: 0;
    background-color: #f2f4f7;
    padding: 60px 34px; /* Slightly more horizontal padding */
    border-left: 1px solid #d5d9dd; /* Slightly higher contrast */
    display: flex;
    flex-direction: column;
    position: sticky; /* Sticks while scrolling main content */
    top: 0;
    min-height: 100vh; /* Ensures full vertical column feel */
}

/* Reserve space for vertical scrollbar so pages without overflow don't shift layout */
html { scrollbar-gutter: stable both-edges; }

.sidebar-name {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-name strong {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
}

.sidebar h2 {
    font-size: 1.3rem; /* Increased from 1.1rem */
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    color: #0066cc;
    text-decoration: none;
    padding: 0.5rem 0;
    font-size: 1.1rem; /* Increased from 0.95rem */
    font-weight: 600; /* Added emphasis */
}

/* Active link state */
.sidebar-link.active {
    color: #003f73;
    position: relative;
    font-weight: 700;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    width: 6px;
    height: 6px;
    background: #0066cc;
    border-radius: 50%;
    transform: translateY(-50%);
}

.sidebar-link:hover {
    color: #004499;
    text-decoration: underline;
}

/* Header */
.header {
    margin-bottom: 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-text {
    flex: 1;
}

.header-image {
    flex-shrink: 0;
}

.profile-pic {
    width: 240px;
    height: 240px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.name {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.title {
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.4;
}

.keywords {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2rem;
}

/* Welcome Section */
.welcome {
    margin-bottom: 3rem;
}

.description {
    font-size: 1.3rem; /* Increased from 1.1rem */
    margin-bottom: 1.5rem;
    color: #333;
}

.bio {
    font-size: 1.1rem; /* Increased from 1rem */
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #444;
}

.disclaimer {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-bottom: 2rem;
}

/* Quick Links */
.quick-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.link-item {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid #0066cc;
    border-radius: 4px;
}

.link-item:hover {
    background-color: #0066cc;
    color: #fff;
}

/* Page-specific styles (layout properties unified above) */

.page-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #1a1a1a;
}

.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 1.7rem; /* Increased from 1.5rem */
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.section h3 {
    font-size: 1.4rem; /* Increased from 1.2rem */
    font-weight: 500;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Education, Experience, etc. */
.education-item,
.experience-item {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.education-item strong,
.experience-item strong {
    font-weight: 700;
    color: #1a1a1a;
}

.institution {
    color: #666;
    font-style: italic;
}

/* Research items */
.research-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.research-item:last-child {
    border-bottom: none;
}

.paper-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.paper-details {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.paper-abstract {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.paper-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.paper-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.paper-link:hover {
    background-color: #f0f0f0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        border-left: none;
        border-top: 1px solid #e9ecef;
        padding: 30px;
        position: static; /* Disable sticky on narrow screens */
        min-height: auto;
    }

    .sidebar-nav {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }

    .main-content,
    .page-container {
        padding: 40px 20px;
    }
}

@media (max-width: 768px) {
    .name {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-pic {
        width: 200px;
        height: 200px;
        margin-bottom: 1rem;
    }
    
    .quick-links {
        gap: 1rem;
    }
    
    .link-item {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .sidebar-nav {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 1.8rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .main-content,
    .page-container {
        padding: 30px 16px;
    }
}

/* Typography improvements */
p {
    margin-bottom: 1rem;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Clean spacing and visual hierarchy */
.section:last-child {
    margin-bottom: 0;
}

/* CV specific styles */
.cv-download {
    margin-bottom: 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.skill-category h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.skill-category p {
    margin: 0;
    line-height: 1.5;
    color: #666;
}

.experience-item ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.experience-item li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.details {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Focus states for accessibility */
.link-item:focus,
.sidebar-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}