/* ==================== BLOG STYLES ==================== */
/* Dark theme blog styling for moderatezy */

/* ── Blog Hero ── */
.blog-hero {
    padding: 8rem 1.5rem 4rem;
    text-align: center;
    background: var(--color-bg);
}

.blog-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: var(--tracking-tight);
    margin-bottom: 0.75rem;
}

.blog-hero-subtitle {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .blog-hero-title {
        font-size: 3rem;
    }
}

/* ── Post Grid ── */
.blog-container {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 1.5rem 6rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Post Card ── */
.post-card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

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

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

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.post-card-image-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-image-placeholder svg {
    width: 48px;
    height: 48px;
    color: rgba(59,130,246,0.4);
}

.post-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3b82f6;
    background: rgba(59,130,246,0.12);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    margin-bottom: 0.75rem;
    width: fit-content;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: var(--tracking-tight);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.post-card-title a:hover {
    color: #3b82f6;
}

.post-card-excerpt {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.post-card-date {
    color: var(--color-text-faint);
    font-size: 0.8125rem;
}

.post-card-readmore {
    font-size: 0.875rem;
    font-weight: 500;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s;
}

.post-card-readmore:hover {
    gap: 0.5rem;
}

/* ── Pagination ── */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-btn);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    transition: all 0.2s;
}

.blog-pagination a:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.blog-pagination .current {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.blog-pagination .prev,
.blog-pagination .next {
    width: auto;
    padding: 0 1rem;
}

/* ── No Posts ── */
.blog-no-posts {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--color-text-muted);
    font-size: 1.0625rem;
}

/* ==================== SINGLE POST ==================== */

/* ── Article Container ── */
.article-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 8rem 1.5rem 4rem;
}

/* ── Article Header ── */
.article-header {
    margin-bottom: 2.5rem;
}

.article-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3b82f6;
    background: rgba(59,130,246,0.12);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: var(--tracking-tight);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.article-meta-separator {
    color: var(--color-border-strong);
}

/* ── Featured Image ── */
.article-featured-image {
    width: 100%;
    border-radius: var(--radius-card);
    margin-bottom: 2.5rem;
    max-height: 420px;
    object-fit: cover;
}

/* ── Table of Contents ── */
.article-toc {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.article-toc-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.article-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc li {
    padding: 0.25rem 0;
}

.article-toc a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.article-toc a:hover {
    color: #3b82f6;
}

.article-toc li.toc-h3 {
    padding-left: 1.25rem;
}

/* ── Article Content ── */
.article-content {
    color: #d1d5db;
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: var(--tracking-tight);
}

.article-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 3px solid #3b82f6;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--color-surface);
    border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
    color: var(--color-text-muted);
    font-style: italic;
}

.article-content a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: #60a5fa;
}

.article-content img {
    border-radius: 8px;
    margin: 1.5rem 0;
    max-width: 100%;
    height: auto;
}

.article-content code {
    background: var(--color-surface);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e5e7eb;
}

.article-content pre {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-btn);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

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

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.article-content th,
.article-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.article-content th {
    background: var(--color-surface);
    font-weight: 600;
    color: var(--color-text);
}

/* ── Author Bio ── */
.author-bio {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 2rem;
    margin-top: 3rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(59,130,246,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.author-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    padding: 6px;
}

.author-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.author-description {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ── Related Posts ── */
.related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.related-posts-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    letter-spacing: var(--tracking-tight);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

.related-post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.related-post-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-border-strong);
}

.related-post-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.related-post-image-placeholder {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%);
}

.related-post-content {
    padding: 1rem;
}

.related-post-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.related-post-title a:hover {
    color: #3b82f6;
}

.related-post-date {
    font-size: 0.75rem;
    color: var(--color-text-faint);
}

/* ── Top CTA Bar (above the fold, between header and content) ── */
.article-top-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.18) 0%, rgba(59,130,246,0.06) 100%);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: var(--radius-card);
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.article-top-cta:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.article-top-cta-text {
    flex: 1;
    color: var(--color-text);
    font-weight: 500;
}

.article-top-cta-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.9rem;
    background: #3b82f6;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .article-top-cta {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .article-top-cta-btn {
        text-align: center;
    }
}

/* ── Article CTA Banner ── */
.article-cta {
    margin-top: 4rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(59,130,246,0.04) 100%);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-card);
    text-align: center;
}

.article-cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    letter-spacing: var(--tracking-tight);
}

.article-cta-text {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.article-cta .btn {
    display: inline-flex;
}

/* ── Blog Language Switcher (nav) ── */
.nav-lang-switcher {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin-left: 1rem;
}
.nav-lang-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: all 0.2s;
}
.nav-lang-btn:hover { color: #fff; }
.nav-lang-btn.active {
    background: rgba(59,130,246,0.2);
    color: #3b82f6;
}

/* ── Article Translation Switcher ── */
.article-translations {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}
.article-trans-link {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: all 0.2s;
}
.article-trans-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.article-trans-link.active { color: #3b82f6; background: rgba(59,130,246,0.15); }

/* ── Category Page ── */
.blog-hero-category {
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .article-container {
        padding: 6rem 1rem 3rem;
    }

    .article-title {
        font-size: 1.75rem;
    }

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

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }

    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .article-cta {
        padding: 2rem 1.5rem;
    }

    .blog-hero {
        padding: 6rem 1rem 3rem;
    }
}

@media (max-width: 480px) {
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .article-meta-separator {
        display: none;
    }
}
