/* Blog Styles */

/* Hero Section */
.blog-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 80px 20px;
    text-align: center;
    color: #fff;
}

.blog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.blog-hero-description {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.blog-hero-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.blog-hero-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.2s;
}

.blog-hero-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Blog List */
.blog-list {
    padding: 60px 20px;
    background: var(--bg-light, #f8f9fa);
    min-height: 50vh;
}

.blog-container {
    max-width: 1000px;
    margin: 0 auto;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Article Card */
.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.article-image {
    height: 180px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 25px;
}

.article-date {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-dark, #1a1a1a);
    text-decoration: none;
    transition: color 0.3s;
}

.article-title a:hover {
    color: var(--primary);
}

.article-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

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

.no-articles {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 1.1rem;
}

/* Single Article */
.blog-article {
    padding: 60px 20px 80px;
    background: #fff;
    margin-top: 20px;
}

.article-container {
    max-width: 750px;
    margin: 0 auto;
}

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

.back-link:hover {
    opacity: 0.7;
}

.article-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.article-header .article-date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    color: var(--text-dark, #1a1a1a);
    margin-bottom: 20px;
}

.article-intro {
    font-size: 1.2rem;
    color: #555;
    line-height: 1.6;
}

.article-hero-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}

.article-hero-image img {
    width: 100%;
    height: auto;
}

/* Article Body */
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-body h2 {
    font-size: 1.6rem;
    margin: 40px 0 20px;
    color: var(--text-dark, #1a1a1a);
}

.article-body h3 {
    font-size: 1.3rem;
    margin: 30px 0 15px;
    color: var(--text-dark, #1a1a1a);
}

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

.article-body ul {
    margin: 20px 0;
    padding-left: 25px;
}

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

.article-body strong {
    color: var(--text-dark, #1a1a1a);
}

.article-body a {
    color: var(--primary);
    text-decoration: underline;
}

.article-body .article-figure {
    margin: 30px 0;
}

.article-body .article-figure img,
.article-body img.article-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.article-body img.article-img-inline {
    display: inline;
    max-height: 1.5em;
    vertical-align: middle;
    border-radius: 4px;
}

.article-body blockquote,
.article-body em {
    font-style: italic;
    color: #555;
}

/* Article Footer */
.article-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: var(--text-dark, #333);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.pagination-link:hover:not(.disabled):not(.current) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination-link.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.pagination-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-prev,
.pagination-next {
    min-width: auto;
    padding: 0 15px;
}

.pagination-ellipsis {
    color: #888;
    padding: 0 5px;
}

/* Article Meta */
.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.article-meta .article-date {
    margin-bottom: 0;
}

.article-reading-time {
    font-size: 0.9rem;
    color: #888;
}

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tag {
    display: inline-block;
    background: var(--bg-card, #1e3a5f);
    color: var(--text-white, #ffffff);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tag:hover {
    background: var(--accent-green, #00E5A0);
    color: var(--bg-primary, #182C44);
    border-color: var(--accent-green, #00E5A0);
}

/* Table of Contents */
.table-of-contents {
    background: var(--bg-light, #f8f9fa);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 40px;
}

.table-of-contents h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-dark, #1a1a1a);
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 8px;
}

.table-of-contents li a {
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.table-of-contents li a:hover {
    color: var(--primary);
}

.table-of-contents .toc-level-3 {
    padding-left: 20px;
}

/* Social Sharing */
.social-sharing {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.sharing-label {
    font-size: 0.95rem;
    color: #666;
}

.sharing-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light, #f0f0f0);
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

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

.share-facebook:hover {
    background: #1877f2;
    color: #fff;
}

.share-email:hover {
    background: var(--primary);
    color: #fff;
}

/* Article Navigation */
.article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.nav-prev,
.nav-next {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-light, #f8f9fa);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-prev:hover,
.nav-next:hover {
    background: #eee;
}

.nav-prev.disabled,
.nav-next.disabled {
    visibility: hidden;
}

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

.nav-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
}

.nav-title {
    font-size: 1rem;
    color: var(--text-dark, #1a1a1a);
    font-weight: 600;
    line-height: 1.4;
}

/* Related Articles */
.related-articles {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.related-articles h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: var(--text-dark, #1a1a1a);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    display: block;
    background: var(--bg-light, #f8f9fa);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.2s;
}

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

.related-image {
    height: 120px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 15px;
}

.related-content h4 {
    font-size: 0.95rem;
    color: var(--text-dark, #1a1a1a);
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-content time {
    font-size: 0.8rem;
    color: #888;
}

/* Code Blocks */
.article-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.article-body code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

.article-body p code,
.article-body li code {
    background: var(--bg-light, #f0f0f0);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e83e8c;
}

/* Search */
.search-form {
    max-width: 500px;
    margin: 25px auto 0;
}

.search-input-wrapper {
    display: flex;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 15px 25px;
    font-size: 1rem;
    outline: none;
}

.search-button {
    background: var(--primary);
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
}

.search-button:hover {
    background: var(--primary-dark);
}

.search-results-info {
    color: #666;
    margin-bottom: 25px;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-result-card {
    display: flex;
    gap: 20px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-result-image {
    width: 150px;
    flex-shrink: 0;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    padding: 20px;
    flex: 1;
}

.search-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.search-excerpt mark {
    background: #fff3cd;
    padding: 1px 3px;
    border-radius: 2px;
}

/* RSS Link in Blog Index */
.blog-rss-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: color 0.2s;
}

.blog-rss-link:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-hero-description {
        font-size: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 1.8rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .pagination {
        gap: 8px;
    }

    .pagination-link {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .pagination-prev,
    .pagination-next {
        padding: 0 10px;
        font-size: 0.85rem;
    }

    .social-sharing {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-navigation {
        grid-template-columns: 1fr;
    }

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

    .related-grid {
        grid-template-columns: 1fr;
    }

    .search-result-card {
        flex-direction: column;
    }

    .search-result-image {
        width: 100%;
        height: 150px;
    }
}
