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

:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --border-color: #ddd;
    --max-width: 800px;
    --spacing: 2rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 18px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: white;
    border-bottom: 2px solid var(--light-gray);
    padding: 1.5rem 0;
    margin-bottom: var(--spacing);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

/* Main Content */
main {
    min-height: calc(100vh - 250px);
    margin-bottom: var(--spacing);
}

/* Homepage */
.home-content {
    padding: 2rem 0;
}

.home-content h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.lead {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.recent-posts {
    margin-top: 3rem;
}

.recent-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Post Lists */
.post-list {
    list-style: none;
}

.post-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list time {
    color: #666;
    font-size: 0.9rem;
    min-width: 100px;
    font-weight: 500;
}

.post-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.post-list a:hover {
    color: var(--accent-color);
}

.post-list .read-time {
    color: #999;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
}

.post-list .read-time svg {
    flex-shrink: 0;
}

.post-item {
    flex-direction: column;
}

.post-item time {
    min-width: auto;
}

.summary {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Single Post */
.post {
    padding: 2rem 0;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.post-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.post-meta {
    color: #666;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-meta .author {
    margin-left: 0;
}

.post-meta .read-time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #999;
}

.post-meta .read-time svg {
    flex-shrink: 0;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.8rem;
}

.post-content h3 {
    font-size: 1.4rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
}

.post-content a:hover {
    border-bottom: 2px solid var(--accent-color);
}

.post-content ul,
.post-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

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

.post-content code {
    background: var(--light-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

.post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: #555;
    font-style: italic;
}

.post-tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.post-tags a {
    display: inline-block;
    background: var(--light-gray);
    color: var(--text-color);
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.post-tags a:hover {
    background: #ddd;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--light-gray);
    padding: 3rem 0 2rem;
    margin-top: var(--spacing);
    color: #666;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-left {
    flex: 1;
    min-width: 250px;
}

.footer-right {
    flex-shrink: 0;
}

.footer-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.footer-affiliation {
    color: #777;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-copyright {
    margin-top: 1rem;
    color: #999;
}

.footer-heading {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    color: #555;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: var(--accent-color);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.tagline {
    margin-top: 1rem;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .home-content h2 {
        font-size: 2rem;
    }
    
    .post-header h1,
    .page-header h1 {
        font-size: 2rem;
    }
    
    .post-list li {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-list time {
        min-width: auto;
    }
    
    .blog-layout {
        flex-direction: column;
    }
    
    .blog-sidebar {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-left,
    .footer-right {
        width: 100%;
    }
    
    .social-links {
        justify-content: flex-start;
    }
}

/* Blog Layout with Sidebar */
.blog-layout {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.blog-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.blog-main {
    flex: 1;
    min-width: 0;
}

.sidebar-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.archive-list {
    list-style: none;
}

.archive-list li {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archive-list a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.archive-list a:hover {
    color: var(--accent-color);
}

.archive-list .count {
    color: #999;
    font-size: 0.9rem;
}

/* Year and Month Headers */
.year-section {
    margin-bottom: 3rem;
}

.year-header {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-color);
}

.month-group {
    margin-bottom: 2rem;
}

.month-header {
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-badge {
    display: inline-block;
    background: var(--light-gray);
    color: var(--text-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tag-badge:hover {
    background: var(--accent-color);
    color: white;
}

.tag-badge .count {
    color: #999;
    font-size: 0.8rem;
    margin-left: 0.3rem;
}

.tag-badge:hover .count {
    color: rgba(255, 255, 255, 0.8);
}

.view-all {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 1rem 0;
}

.tag-item {
    display: inline-block;
    background: var(--light-gray);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.tag-item:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.tag-item .count {
    color: #999;
    font-size: 0.9rem;
    margin-left: 0.4rem;
}

.tag-item:hover .count {
    color: rgba(255, 255, 255, 0.8);
}

/* Post Tags Inline */
.post-tags-inline {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.tag-link {
    font-size: 0.75rem;
    background: var(--light-gray);
    color: #666;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-link:hover {
    background: var(--accent-color);
    color: white;
}

/* Back Link */
.back-link {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.back-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Archives Page */
.archives-layout {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.archives-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.archives-main {
    flex: 1;
    min-width: 0;
}

.year-nav {
    list-style: none;
    margin-bottom: 2rem;
}

.year-nav li {
    margin-bottom: 0.5rem;
}

.year-nav a {
    display: flex;
    justify-content: space-between;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0;
}

.year-nav a:hover {
    color: var(--accent-color);
}

.year-nav .count {
    color: #999;
    font-size: 0.9rem;
}

.archives-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.action-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.action-link:hover {
    text-decoration: underline;
}

.year-archive {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.year-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-color);
}

.month-archive {
    margin-bottom: 2rem;
}

.month-title {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 600;
}

.archive-posts {
    list-style: none;
}

.archive-posts li {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: baseline;
    flex-wrap: wrap;
}

.archive-posts li:last-child {
    border-bottom: none;
}

.archive-posts time {
    color: #999;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 30px;
    text-align: right;
}

.archive-posts a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    min-width: 200px;
}

.archive-posts a:hover {
    color: var(--accent-color);
}

.archive-posts .read-time {
    color: #999;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.archive-posts .read-time svg {
    width: 12px;
    height: 12px;
}

.tags-mini {
    display: flex;
    gap: 0.3rem;
}

.tag-mini {
    font-size: 0.7rem;
    background: var(--light-gray);
    color: #666;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .archives-layout {
        flex-direction: column;
    }
    
    .archives-sidebar {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .year-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .year-nav li {
        margin-bottom: 0;
    }
    
    .archive-posts li {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }
    
    .archive-posts time {
        text-align: left;
    }
}

/* Projects */
.projects-section {
    margin-bottom: 4rem;
}

.section-heading {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--light-gray);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.3rem;
    margin: 0;
    flex: 1;
}

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

.project-title a:hover {
    color: var(--accent-color);
}

.project-status {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-active,
.status-ongoing {
    background: #e3f2fd;
    color: #1976d2;
}

.status-completed {
    background: #e8f5e9;
    color: #388e3c;
}

.status-archived {
    background: #f5f5f5;
    color: #757575;
}

.project-tagline {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-summary {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.meta-item svg {
    flex-shrink: 0;
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tech-badge {
    font-size: 0.75rem;
    background: var(--light-gray);
    color: #555;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.project-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.project-link:hover {
    color: var(--primary-color);
}

.project-link svg {
    flex-shrink: 0;
}

/* Single Project */
.project-single {
    max-width: 800px;
    margin: 0 auto;
}

.project-single-header {
    margin-bottom: 3rem;
}

.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.project-title-row h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0;
}

.project-tagline-large {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.project-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.metadata-item {
    font-size: 0.95rem;
}

.metadata-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.3rem;
}

.project-technologies-large {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.tech-badge-large {
    font-size: 0.9rem;
    background: var(--light-gray);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color);
}

.btn-secondary {
    background: white;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
    background: var(--accent-color);
    color: white;
}

.project-featured-image {
    margin-bottom: 3rem;
    border-radius: 8px;
    overflow: hidden;
}

.project-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.project-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.project-body > p:first-child em {
    display: block;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.project-body h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.project-body h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.project-related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--light-gray);
}

.project-related-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.related-posts-list {
    list-style: none;
}

.related-posts-list li {
    display: flex;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.related-posts-list time {
    color: #999;
    font-size: 0.9rem;
    min-width: 100px;
}

.related-posts-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.related-posts-list a:hover {
    color: var(--accent-color);
}

.project-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light-gray);
}

.back-to-projects {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.back-to-projects:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-title-row {
        flex-direction: column;
    }
    
    .project-metadata {
        grid-template-columns: 1fr;
    }
}
