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

html {
    font-size: 16px;
    line-height: 1.6;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #2c3e50;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container and Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1a202c;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.5rem;
    color: #4a5568;
}

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

a:hover {
    color: #2c5aa0;
    text-decoration: underline;
}

/* Header */
.site-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

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

.site-title {
    margin-bottom: 0.5rem;
}

.site-title a {
    color: #1a202c;
    text-decoration: none;
    font-size: 2.5rem;
    font-weight: 700;
}

.site-title a:hover {
    color: #3182ce;
    text-decoration: none;
}

.site-subtitle {
    color: #718096;
    font-size: 1.125rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Navigation */
.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: #4a5568;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #3182ce;
    background-color: #ebf8ff;
    text-decoration: none;
}

/* Homepage */
.homepage {
    max-width: 100%;
}

.intro-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.intro-text {
    font-size: 1.25rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

.section-title {
    font-size: 1.875rem;
    margin-bottom: 2rem;
    color: #1a202c;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

/* Post Cards */
.posts-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 2rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.post-title {
    margin-bottom: 1rem;
}

.post-title a {
    color: #1a202c;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
}

.post-title a:hover {
    color: #3182ce;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #718096;
}

.post-meta time {
    font-weight: 500;
}

.reading-time,
.word-count {
    color: #a0aec0;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #ebf8ff;
    color: #3182ce;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-large {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.post-excerpt {
    margin-bottom: 1.5rem;
}

.post-excerpt p {
    color: #4a5568;
    line-height: 1.6;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: #3182ce;
    font-weight: 500;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* Individual Post */
.post {
    max-width: 100%;
}

.post-header {
    margin-bottom: 3rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 2rem;
}

.post .post-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.post .post-meta {
    justify-content: center;
    margin-bottom: 0;
}

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

/* Post Content */
.post-content {
    margin-bottom: 3rem;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child {
    margin-top: 0;
}

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

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

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

.post-content blockquote {
    border-left: 4px solid #3182ce;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4a5568;
}

.post-content code {
    background: #f7fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    color: #e53e3e;
}

.post-content pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.post-content th,
.post-content td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    text-align: left;
}

.post-content th {
    background: #f7fafc;
    font-weight: 600;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.nav-previous,
.nav-next {
    display: flex;
    flex-direction: column;
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.nav-link {
    color: #3182ce;
    font-weight: 500;
    text-decoration: none;
}

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

/* Post Actions */
.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 500;
    color: #4a5568;
}

.share-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.share-twitter {
    background: #1da1f2;
    color: white;
}

.share-linkedin {
    background: #0077b5;
    color: white;
}

.share-email {
    background: #4a5568;
    color: white;
}

.share-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

/* Archive Page */
.archive-page {
    max-width: 100%;
}

/* External Posts */
.external-post {
    opacity: 0.85;
    border-left: 3px solid #3182ce;
    padding-left: 1rem;
    margin-left: -1rem;
}

.external-link {
    color: #3182ce !important;
}

.external-indicator {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 0.25rem;
}

.post-source {
    color: #718096;
    font-size: 0.75rem;
    font-style: italic;
    margin-right: 0.5rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-description {
    font-size: 1.125rem;
    color: #718096;
}

.year-section {
    margin-bottom: 3rem;
}

.year-title {
    font-size: 1.5rem;
    color: #3182ce;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.archive-post {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f7fafc;
}

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

.archive-post .post-date {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
    min-width: 60px;
}

.archive-post .post-title {
    margin-bottom: 0.5rem;
}

.archive-post .post-title a {
    font-size: 1.25rem;
}

.archive-post .post-excerpt {
    margin-bottom: 0.5rem;
}

.archive-post .post-meta {
    margin-bottom: 0;
}

/* Tag Cloud */
.tag-cloud {
    display: grid;
    gap: 2rem;
}

.tag-group {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.tag-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-count {
    color: #718096;
    font-size: 0.875rem;
    font-weight: 400;
}

.tag-posts {
    display: grid;
    gap: 0.75rem;
}

.tag-post {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f7fafc;
}

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

.tag-post a {
    font-weight: 500;
}

.tag-post time {
    font-size: 0.875rem;
    color: #718096;
}

/* Legacy Content */
.legacy-content {
    background: #f7fafc;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.legacy-info p {
    margin-bottom: 1.5rem;
}

.legacy-note {
    font-size: 0.875rem;
    color: #718096;
    font-style: italic;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

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

.btn-primary:hover {
    background: #2c5aa0;
    text-decoration: none;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #cbd5e0;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #3182ce;
    border: 2px solid #3182ce;
}

.btn-outline:hover {
    background: #3182ce;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.view-all {
    text-align: center;
    margin-top: 2rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid #e2e8f0;
    padding: 2rem 0;
    margin-top: 3rem;
    background: #f7fafc;
}

.footer-content {
    display: grid;
    gap: 2rem;
    text-align: center;
}

.footer-info p {
    margin-bottom: 0.5rem;
    color: #718096;
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    color: #4a5568;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.social-link:hover {
    color: #3182ce;
    background: #ebf8ff;
    text-decoration: none;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer-links a {
    color: #718096;
    font-size: 0.875rem;
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 3rem 0;
}

.no-posts h2 {
    color: #718096;
    margin-bottom: 1rem;
}

.no-posts p {
    color: #a0aec0;
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .site-header {
        padding: 2rem 0 1.5rem;
    }
    
    .site-title a {
        font-size: 2rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
    
    .post .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .post-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .archive-post {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .tag-post {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .site-title a {
        font-size: 1.75rem;
    }
    
    .post-card {
        padding: 1.5rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-button {
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .main-nav,
    .post-navigation,
    .post-actions,
    .site-footer {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .post-content {
        margin-bottom: 0;
    }
    
    a {
        color: inherit;
        text-decoration: none;
    }
    
    .post-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
} 