/* Blog-specific styles */

/* Blog Header */
.blog-header {
    padding: 120px 0 60px;
    background-color: var(--bg-primary);
}

.terminal-window.compact {
    max-width: 600px;
    margin: 0 auto;
}

.terminal-window.compact .terminal-content {
    padding: 20px;
}

.code-line {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.code-line.indent {
    padding-left: 20px;
}

.code-string {
    color: var(--accent-green);
}

/* Blog Filter */
.blog-filter {
    padding: 40px 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.filter-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 20px;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-mono);
}

.filter-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.filter-tab.active {
    background-color: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Blog Grid */
.blog-grid {
    padding: 80px 0;
    min-height: 600px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

/* Post Card */
.post-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
}

.post-category {
    color: var(--accent-blue);
    font-family: var(--font-mono);
    font-weight: 500;
}

.post-date {
    color: var(--text-tertiary);
}

.post-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.3;
}

.post-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-link:hover {
    color: var(--accent-blue);
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    flex: 1;
}

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

.read-time {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.read-more {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 8px;
}

.arrow {
    transition: transform 0.3s ease;
}

/* Loading Skeletons */
.post-skeleton {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-header,
.skeleton-title,
.skeleton-excerpt,
.skeleton-footer,
.skeleton-meta,
.skeleton-content {
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 16px;
}

.skeleton-header {
    height: 20px;
    width: 60%;
}

.skeleton-title {
    height: 32px;
    width: 80%;
}

.skeleton-title.large {
    height: 48px;
    width: 90%;
}

.skeleton-excerpt {
    height: 60px;
}

.skeleton-footer {
    height: 20px;
    width: 40%;
}

.skeleton-meta {
    height: 24px;
    width: 50%;
}

.skeleton-content {
    height: 100px;
    margin-bottom: 24px;
}

.post-skeleton-full {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Load More */
.load-more-container {
    text-align: center;
}

/* Blog Post Page */
.blog-post {
    padding: 120px 0 80px;
    min-height: 80vh;
}

.blog-post .container {
    max-width: 800px;
}

.blog-post .post-header {
    margin-bottom: 48px;
    text-align: center;
}

.blog-post .post-meta {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 14px;
    flex-wrap: wrap;
}

.blog-post .post-title {
    font-size: clamp(36px, 6vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
}

.post-author {
    font-size: 16px;
    color: var(--text-secondary);
}

.author-prefix {
    color: var(--text-tertiary);
}

.author-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* Post Body */
.post-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-body h1,
.post-body h2,
.post-body h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 48px 0 24px;
    line-height: 1.3;
}

.post-body h1 {
    font-size: 36px;
}

.post-body h2 {
    font-size: 28px;
}

.post-body h3 {
    font-size: 24px;
}

.post-body p {
    margin-bottom: 24px;
}

.post-body ul,
.post-body ol {
    margin-bottom: 24px;
    padding-left: 32px;
}

.post-body li {
    margin-bottom: 12px;
}

.post-body pre {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.post-body code {
    font-family: var(--font-mono);
    font-size: 14px;
}

.inline-code {
    background-color: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 16px;
    color: var(--accent-blue);
}

.post-body blockquote {
    border-left: 4px solid var(--accent-blue);
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
}

/* Post Footer */
.blog-post .post-footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.post-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.tag {
    padding: 6px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Share Buttons */
.post-share {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 500;
    color: var(--text-primary);
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-button {
    padding: 8px 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.share-button:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.share-button.twitter:hover {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.share-button.linkedin:hover {
    border-color: #0A66C2;
    color: #0A66C2;
}

/* Related Posts */
.related-posts {
    margin-top: 80px;
    padding-top: 80px;
    border-top: 1px solid var(--border);
}

.related-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.related-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.related-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
}

.related-category {
    display: block;
    font-size: 12px;
    color: var(--accent-blue);
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.related-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-date {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Back to Blog */
.back-to-blog {
    padding: 40px 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--text-primary);
    gap: 12px;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 80px 0;
}

.error-message h2 {
    font-size: 36px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.error-message p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 18px;
}

/* Category Specific Colors */
.post-card.category-ios .post-category,
.post-card.category-ios .read-more {
    color: #007AFF;
}

.post-card.category-swiftui .post-category,
.post-card.category-swiftui .read-more {
    color: #FA7343;
}

.post-card.category-ai .post-category,
.post-card.category-ai .read-more {
    color: var(--accent-purple);
}

.post-card.category-tutorial .post-category,
.post-card.category-tutorial .read-more {
    color: var(--accent-green);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 24px;
        -webkit-overflow-scrolling: touch;
    }
    
    .blog-post .post-title {
        font-size: 32px;
    }
    
    .post-body {
        font-size: 16px;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}