/* Unified Blog Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

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

.site-description {
    margin: 0.5rem 0 0;
    opacity: 0.7;
    font-size: 1.1rem;
}

/* Filter Styles */
#filters-container {
    margin-bottom: 2rem;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.filter-btn.active {
    background: #007acc;
    color: white;
    border-color: #0066aa;
}

/* Posts Styles */
#posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* For smaller screens, make cards smaller */
@media (max-width: 768px) {
    #posts-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Single post container */
#single-post-container {
    display: none;
}

.single-post-navigation {
    margin-bottom: 2rem;
}

.back-to-posts {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-to-posts:hover {
    background: #e0e0e0;
    color: #333;
}

/* Post summary vs full post styling */
.post-summary {
    cursor: pointer;
    transition: transform 0.2s ease;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.post-summary:hover {
    transform: translateY(-2px);
}

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

.post-summary .post-title a:hover {
    color: #007acc;
}

.single-post .post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.post-content-preview {
    margin: 1rem 0;
    color: #666;
    line-height: 1.6;
    flex-grow: 1;
}

.post-footer {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.read-more {
    color: #007acc;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
}

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

.post {
    padding: 2rem;
    border-radius: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.2s ease;
}

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

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

.post-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

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

.post-date {
    font-weight: 500;
}

.post-category {
    background: #007acc;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-description {
    margin: 1rem 0;
    font-size: 1rem;
    color: #555;
    font-style: italic;
}

.post-content {
    margin: 1rem 0;
    line-height: 1.7;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 1.5rem 0 0.5rem;
    color: #333;
}

.post-content p {
    margin: 1rem 0;
}

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

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

.post-content code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Consolas', monospace;
}

.post-content pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}

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

.post-content blockquote {
    border-left: 4px solid #007acc;
    margin: 1rem 0;
    padding-left: 1rem;
    color: #555;
    font-style: italic;
}

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

.post-tag {
    background: #f0f0f0;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* FIXED: Single post tag readability */
.single-post-tags .single-post-tag {
    background: #333;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    border: 1px solid #555;
}

.single-post-tag:hover {
    background: #555;
    color: #fff;
}

/* Utility Classes */
.no-posts,
.error-message {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

.error-message {
    color: #d32f2f;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .post {
        padding: 1.5rem;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.75rem;
    }
    
    .post-title {
        font-size: 1.25rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}
