/* ========================================
 * N2X Labs — Blog Styles
 * Extends the main site design tokens
 * ======================================== */

/* ---------- Blog Hero ---------- */
.blog-hero {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    text-align: center;
}
.blog-hero h1 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -.02em;
    color: var(--text-main, #0f172a);
}
.blog-hero p {
    color: var(--text-secondary, #475569);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- Category Filters ---------- */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.blog-filter-btn {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    text-decoration: none;
}
.blog-filter-btn:hover,
.blog-filter-btn.active {
    background: var(--primary-color, #2563eb);
    color: #fff;
    border-color: var(--primary-color, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.2);
}

/* ---------- Blog Card Grid ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ---------- Blog Card ---------- */
.blog-card {
    background: var(--bg-card, #fff);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 2px 4px -1px rgba(0,0,0,0.06));
    transition: all 0.4s cubic-bezier(.4,0,.2,1);
    position: relative;
    display: flex;
    flex-direction: column;
}
.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color, #2563eb), var(--accent-color, #0891b2));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg, 0 10px 25px -5px rgba(0,0,0,0.1));
    border-color: rgba(37,99,235,0.15);
}
.blog-card:hover::before {
    opacity: 1;
}

.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.blog-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 2.5rem;
}

.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color, #2563eb);
    background: #eff6ff;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.blog-card-title {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main, #0f172a);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.blog-card-title a:hover {
    color: var(--primary-color, #2563eb);
}

.blog-card-excerpt {
    color: var(--text-secondary, #475569);
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim, #64748b);
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: auto;
}

/* ---------- Pagination ---------- */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0 3rem;
}
.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary, #475569);
    background: #fff;
}
.blog-pagination a:hover {
    background: #eff6ff;
    border-color: var(--primary-color, #2563eb);
    color: var(--primary-color, #2563eb);
    transform: translateY(-2px);
}
.blog-pagination .active {
    background: var(--primary-color, #2563eb);
    color: #fff;
    border-color: var(--primary-color, #2563eb);
}
.blog-pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ---------- Article Page ---------- */
.article-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 0 0 32px 32px;
    margin-bottom: 3rem;
}
.article-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.2) 60%, transparent 100%);
}
.article-hero-content {
    position: relative;
    z-index: 1;
    padding: 3rem;
    color: #fff;
    max-width: 800px;
}
.article-hero-content h1 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin-bottom: 1rem;
}
.article-hero-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* No-image article header */
.article-header-simple {
    padding: 120px 0 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}
.article-header-simple h1 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -.02em;
    color: var(--text-main, #0f172a);
}

/* Article content */
.article-content {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-main, #0f172a);
}
.article-content h2 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main, #0f172a);
}
.article-content h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.article-content p {
    margin-bottom: 1.25rem;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 1.5rem 0;
}
.article-content blockquote {
    border-left: 4px solid var(--primary-color, #2563eb);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8fafc;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-secondary, #475569);
}
.article-content ul, .article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}
.article-content li {
    margin-bottom: 0.5rem;
}
.article-content a {
    color: var(--primary-color, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.article-content code {
    font-size: 0.9em;
}

/* Back link */
.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    transition: gap 0.2s ease;
}
.blog-back-link:hover {
    gap: 0.75rem;
    color: var(--primary-color, #2563eb);
}

/* Related posts */
.related-posts {
    padding: 3rem 0;
    background: #f8fafc;
    border-radius: 24px;
    margin: 3rem 0;
}
.related-posts h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

/* ---------- Blog Card Tags ---------- */
.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.blog-card-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    background: #f1f5f9;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}

/* ---------- Article Tags ---------- */
.article-tags {
    max-width: 760px;
    margin: 2rem auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.article-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    background: #f1f5f9;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    transition: all 0.2s ease;
}
.article-tag:hover {
    background: #e2e8f0;
}

/* ---------- Social Sharing ---------- */
.article-share {
    max-width: 760px;
    margin: 2rem auto 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.article-share-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main, #0f172a);
}
.article-share-buttons {
    display: flex;
    gap: 0.5rem;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}
.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #fff;
}
.share-twitter { background: #000; }
.share-linkedin { background: #0077b5; }
.share-facebook { background: #1877f2; }
.share-email { background: #6b7280; }

/* ---------- Comments Section ---------- */
.article-comments {
    padding: 3rem 0;
    background: #f8fafc;
    margin-top: 2rem;
}
.comments-wrapper {
    max-width: 760px;
    margin: 0 auto;
}
.comments-wrapper h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-main, #0f172a);
}
.comments-list {
    margin-bottom: 2rem;
}
.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-avatar {
    font-size: 2rem;
    color: #94a3b8;
    flex-shrink: 0;
}
.comment-body {
    flex: 1;
}
.comment-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main, #0f172a);
}
.comment-date {
    font-size: 0.75rem;
    color: var(--text-dim, #64748b);
    margin-bottom: 0.5rem;
}
.comment-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}
.comment-form-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}
.comment-form-wrapper h5 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main, #0f172a);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .blog-hero { padding: 100px 0 40px; }
    .blog-hero h1 { font-size: 2rem; }
    .article-hero { min-height: 320px; }
    .article-hero-content h1 { font-size: 2rem; }
    .article-header-simple { padding: 100px 0 30px; }
    .article-header-simple h1 { font-size: 2rem; }
}

@media (max-width: 767px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .blog-hero h1 { font-size: 1.75rem; }
    .article-hero { min-height: 260px; border-radius: 0; }
    .article-hero-content { padding: 1.5rem; }
    .article-hero-content h1 { font-size: 1.5rem; }
    .article-header-simple h1 { font-size: 1.5rem; }
    .article-content { font-size: 1rem; }
    .blog-card-img, .blog-card-img-placeholder { height: 180px; }
}

@media (max-width: 575px) {
    .blog-filters { gap: 0.35rem; }
    .blog-filter-btn { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
    .article-share { flex-direction: column; text-align: center; }
    .article-share-buttons { justify-content: center; }
}
