/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px;
}

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

h1 {
    font-size: 2.5rem;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 2rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: #555;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

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

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

.site-branding {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.site-title {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
    color: #2c3e50;
}

.site-title a {
    text-decoration: none;
    color: inherit;
}

.site-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    color: #7f8c8d;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.social-links a:hover {
    color: #333;
}

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

/* Navigation */
.site-nav {
    margin: 0;
}

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

.site-nav a {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    color: #555;
    text-decoration: none;
}

.site-nav a:hover {
    background-color: #f8f9fa;
    color: #333;
}

/* Post Card Styles */
.post-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    margin-bottom: 3rem;
    border: none;
}

.post-content {
    padding: 0;
}

.post-header {
    margin-bottom: 2rem;
    max-width: 700px;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #1f2937;
    max-width: 700px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    max-width: 700px;
}

.post-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.reading-time::before {
    content: "•";
    margin-right: 0.5rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 700px;
}

.tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.tag:hover {
    background: #e5e7eb;
}

.post-body {
    line-height: 1.8;
    color: #374151;
}

.post-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
    color: #1f2937;
}

.post-body h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    color: #1f2937;
}

.post-body p {
    margin-bottom: 1.25rem;
}

/* Legacy article styles for compatibility */
.article {
    margin-bottom: 3rem;
}

.article-header {
    margin-bottom: 2rem;
}

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

.article-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-content {
    line-height: 1.8;
}

/* Images */
img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
    cursor: pointer;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    margin: auto;
    display: block;
    animation: scaleIn 0.3s ease;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    color: #ccc;
}

/* Lightbox animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Figure elements */
figure {
    margin: 1.5rem 0;
    text-align: center;
}

figure img {
    margin-bottom: 0.5rem;
}

figcaption {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Lists */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #3498db;
    padding: 1rem 1rem 0.5rem 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #666;
    background-color: #f8f9fa;
    border-radius: 0 5px 5px 0;
}

/* Mac Terminal-style Code Blocks */
pre {
    background-color: #1e1e1e;
    border-radius: 10px;
    padding: 0;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Mac window chrome */
pre::before {
    content: "";
    display: block;
    height: 30px;
    background: linear-gradient(135deg, #434343 0%, #2d2d2d 100%);
    border-radius: 10px 10px 0 0;
    position: relative;
}

pre::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff5f56;
    box-shadow: 
        18px 0 0 #ffbd2e,
        36px 0 0 #27ca3f;
}

code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 0.9rem;
    background-color: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #d63384;
}

pre code {
    display: block;
    padding: 1.5rem;
    background: none;
    color: #f8f8f2;
    overflow-x: auto;
    border-radius: 0;
    line-height: 1.5;
}

/* Syntax highlighting colors (similar to Mac terminal) */
.highlight .c { color: #75715e; } /* Comment */
.highlight .k { color: #66d9ef; } /* Keyword */
.highlight .s { color: #a6e22e; } /* String */
.highlight .nv { color: #f92672; } /* Variable */
.highlight .nb { color: #ae81ff; } /* Built-in */
.highlight .nc { color: #a6e22e; } /* Class */
.highlight .nf { color: #a6e22e; } /* Function */
.highlight .nn { color: #f8f8f2; } /* Namespace */
.highlight .nt { color: #f92672; } /* Tag */
.highlight .na { color: #a6e22e; } /* Attribute */
.highlight .no { color: #66d9ef; } /* Constant */
.highlight .mi { color: #ae81ff; } /* Number */
.highlight .mf { color: #ae81ff; } /* Float */

/* Inline code in pre blocks */
pre code .hljs-comment { color: #75715e; }
pre code .hljs-keyword { color: #66d9ef; }
pre code .hljs-string { color: #a6e22e; }
pre code .hljs-variable { color: #f92672; }
pre code .hljs-built_in { color: #ae81ff; }
pre code .hljs-title { color: #a6e22e; }
pre code .hljs-number { color: #ae81ff; }

/* Post Grid and Preview Styles */
.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.post-card-preview {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    border: none;
    transition: none;
}

.post-card-preview:hover {
    transform: none;
    box-shadow: none;
}

.post-preview-content {
    padding: 1rem 0;
}

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

.post-preview-title a {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    line-height: 1.3;
}

.post-preview-title a:hover {
    color: #3498db;
}

.post-preview-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.post-preview-summary {
    color: #6b7280;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Post list */
.post-list {
    list-style: none;
    margin-left: 0;
}

.post-list-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.post-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-list-title {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.post-list-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-list-summary {
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-nav ul {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .social-links {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    
    pre code {
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    .post-card {
        margin: 0;
        border-radius: 0;
        border: none;
    }
    
    .post-content {
        padding: 0;
    }
    
    body {
        padding: 20px;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    /* Mobile lightbox adjustments */
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    .lightbox-close {
        top: 20px;
        right: 30px;
        font-size: 30px;
    }
}
