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

:root {
    --primary-color: #2e7d32;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-color: #fff;
    --sidebar-bg: #fff;
    --link-color: #1976d2;
    --link-hover: #1565c0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Header Styles */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 0;
}

.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.site-title a:hover {
    text-decoration: none;
    color: var(--primary-color);
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text-color);
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0.25rem 0;
}

.site-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid var(--primary-color);
}

/* Page Wrapper */
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Sidebar Styles */
.sidebar {
    position: sticky;
    top: 80px;
    background-color: var(--sidebar-bg);
    padding: 2rem 1.5rem;
    border-radius: 8px;
    height: fit-content;
}

.sidebar-content {
    text-align: center;
}

.author-avatar {
    margin-bottom: 1.5rem;
}

.profile-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Maintains square aspect ratio */
    overflow: hidden;
}

.profile-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.9s ease-in-out;
}

.profile-img.active {
    opacity: 1;
}

/* Double blinking animation - two slow blinks with gradual opacity changes */
/* COMMENTED OUT - Using simple crossfade instead
@keyframes doubleBlink {
    0% {
        opacity: 1;
    }
    20% {
        opacity: 0.15;
    }
    40% {
        opacity: 1;
    }
    60% {
        opacity: 0.15;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

.profile-img.blink {
    animation: doubleBlink 0.8s ease-in-out;
}
*/

.author-name {
    margin-bottom: 1rem;
}

.author-name h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.author-bio {
    margin-bottom: 1.5rem;
    text-align: left;
}

.author-bio p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

.author-links {
    text-align: left;
}

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

.author-links li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-links i,
.author-links svg,
.author-links img {
    width: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.author-links a {
    color: var(--text-color);
    font-size: 0.9rem;
    text-decoration: none;
}

.author-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Main Content Styles */
.main-content {
    min-width: 0;
}

.page-content {
    max-width: 800px;
}

.page-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 1.2;
}

.page-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.page-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.page-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

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

.page-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.page-content a {
    color: var(--link-color);
    text-decoration: underline;
}

.page-content a:hover {
    color: var(--link-hover);
}

/* Education Section Styles */
.education-section {
    margin-top: 1.5rem;
}

.education-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.education-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.education-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.education-content {
    flex: 1;
}

.education-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.education-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.education-location {
    font-size: 0.95rem;
    color: var(--text-color);
}

.education-details {
    margin-left: 0;
}

.education-details p {
    margin-bottom: 0.15rem !important;
    margin-top: 0 !important;
}

.education-degree {
    margin-bottom: 0.15rem !important;
    margin-top: 0 !important;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.3;
}

.education-coursework {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.3;
}

.education-coursework strong {
    font-weight: 600;
}

/* Projects (reference-style) */
#projects {
    scroll-margin-top: 70px; /* Account for sticky header when scrolling to anchor */
}

.projects {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.project-card {
    display: flex;
    gap: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    background: var(--bg-color);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.06);
    align-items: center;
    transition: box-shadow 0.1s ease, transform 0.1s ease, border-color 0.1s ease;
    cursor: pointer;
}

.project-card:hover {
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.2);
}

.project-card__media {
    flex: 0 0 200px;
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.project-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-card__placeholder {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0) 55%),
        linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #eff6ff 100%);
}

.project-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
}

.project-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    margin-top: -1rem;
    padding: 0;
}

.project-card__title {
    margin: 0;
    margin-bottom: 0;
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--text-color);
}

.project-card__meta {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    align-self: flex-end;
    margin-top: 1.5rem;
}

.project-card__year {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    color: #6b7280;
    font-size: 0.85rem;
    white-space: nowrap;
    line-height: 1;
    vertical-align: middle;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: -0.5rem 0 0 0;
    padding: 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 10px;
    background: #eef2ff;
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1;
}

.project-card__desc {
    margin: 0;
    color: #374151;
    font-size: 1rem;
    line-height: 1.55;
    max-width: 68ch;
}

.project-card__body ul {
    margin: 0;
    margin-top: 0.5rem;
    padding-left: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-card__body li {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.project-card__link {
    margin-top: 0.05rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    width: fit-content;
}

.project-card__link:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

@media (max-width: 900px) {
    .project-card {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .project-card__media {
        flex: none;
        width: 100%;
        aspect-ratio: 1 / 1; /* Keep square on mobile too */
    }

    .project-card__title {
        font-size: 1.5rem;
    }
}

/* Footer Styles */
.site-footer {
    background-color: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.footer-content p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-wrapper {
        grid-template-columns: 240px 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .sidebar {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }
    
    .sidebar {
        position: relative;
        top: 0;
        text-align: center;
    }
    
    .author-bio,
    .author-links {
        text-align: center;
    }
    
    .author-links li {
        justify-content: center;
    }
    
    .header-wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .site-nav ul {
        justify-content: center;
        gap: 1rem;
    }
    
    .page-content h1 {
        font-size: 1.75rem;
    }
    
    .page-content h2 {
        font-size: 1.35rem;
    }
}

@media (max-width: 480px) {
    .site-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .page-content {
        padding: 0;
    }
}

/* Academic Icons Support */
.ai {
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    display: inline-block;
    font-family: Arial, sans-serif;
    width: 20px;
    text-align: center;
}

.ai-google-scholar:before {
    content: "G";
    font-weight: bold;
    color: #4285F4;
    font-size: 1.1rem;
}

.ai-orcid:before {
    content: "O";
    font-weight: bold;
    color: #A6CE39;
    font-size: 1.1rem;
}

.ai-pubmed:before {
    content: "P";
    font-weight: bold;
    color: #3366CC;
    font-size: 1.1rem;
}

