/* Blog Styles */

/* Blog List Page */
#blog {
    padding: 40px 20px;
}

#blog h1 {
    margin-bottom: 10px;
    color: var(--text);
}

#blog .muted {
    margin-bottom: 30px;
}

/* Blog Controls */
.blog-controls {
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Tag Filters */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-filter {
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.tag-filter:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tag-filter.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Blog Card */
.blog-card {
    background: var(--panel-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: bold;
}

.blog-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--text);
    line-height: 1.3;
}

.blog-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--muted);
}

.blog-card-description {
    color: var(--text);
    margin-bottom: 15px;
    line-height: 1.6;
    flex: 1;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.blog-tag {
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 15px;
    font-size: 0.85em;
    color: var(--text);
}

/* Blog Post Detail Page */
#blog-post {
    padding: 40px 20px;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--secondary);
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

#post-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--text);
    line-height: 1.2;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.95em;
}

.post-meta span::before {
    margin-right: 5px;
}

.post-date::before {
    content: "📅 ";
}

.post-author::before {
    content: "✍️ ";
}

.post-reading-time::before {
    content: "⏱️ ";
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tag {
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Post Body */
.post-body {
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 50px;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--text);
}

.post-body h1 {
    font-size: 2em;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.post-body h2 {
    font-size: 1.75em;
}

.post-body h3 {
    font-size: 1.5em;
}

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

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

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

.post-body a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--primary);
    transition: color 0.3s;
}

.post-body a:hover {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.post-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.post-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--muted);
    font-style: italic;
}

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

.post-body hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 40px 0;
}

/* Share Buttons */
.share-buttons {
    margin: 50px 0;
    padding: 30px;
    background: var(--bg);
    border-radius: 10px;
}

.share-buttons h3 {
    margin-bottom: 20px;
    color: var(--text);
}

.share-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s, opacity 0.2s;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-btn.facebook {
    background: #1877f2;
}

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

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

.share-btn.copy {
    background: #6c757d;
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.nav-link {
    flex: 1;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.nav-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.nav-link.prev {
    text-align: left;
}

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

.nav-label {
    font-size: 0.9em;
    color: var(--muted);
    margin-bottom: 8px;
}

.nav-title {
    font-size: 1.1em;
    color: var(--text);
    font-weight: 500;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    #post-title {
        font-size: 2em;
    }

    .post-meta {
        flex-direction: column;
        gap: 10px;
    }

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

    .nav-link.next {
        text-align: left;
    }

    .share-icons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .blog-card {
        background: #2d2d2d;
    }

    .search-input {
        background: #2d2d2d;
        color: white;
    }

    .tag-filter {
        background: #2d2d2d;
        color: white;
    }

    .share-buttons {
        background: #2d2d2d;
    }

    .nav-link {
        background: #2d2d2d;
    }
}
