/* Blog styles — IAForge */
@import url('./shared.css');

body {
    background: #fff;
    line-height: 1.6;
}

/* ── Header ── */
header {
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.brand {
    font-weight: 800;
    font-size: 1.15rem;
    text-decoration: none;
    color: var(--dark);
}

.brand span {
    color: var(--primary);
}

.topbar nav {
    display: flex;
    gap: 1.5rem;
}

.topbar nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.topbar nav a:hover,
.topbar nav a.active {
    color: var(--primary);
}

.back {
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
}

/* ── Container ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

/* ── Blog Hero ── */
.blog-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.blog-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

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

/* ── Filters ── */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* ── Post Grid ── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.75rem;
}

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

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.post-image {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    flex-shrink: 0;
}

.post-emoji {
    font-size: 4rem;
    line-height: 1;
}

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

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-category {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary);
    background: rgba(29, 78, 216, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.post-meta time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-body h2 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.post-body h2 a {
    text-decoration: none;
    color: var(--dark);
    transition: color 0.2s;
}

.post-body h2 a:hover {
    color: var(--primary);
}

.post-body > p {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.65;
    flex: 1;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.read-time {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.read-more {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: gap 0.2s;
}

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

/* ── Blog CTA ── */
.blog-cta {
    text-align: center;
    margin-top: 4rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    border-radius: 16px;
    color: white;
}

.blog-cta h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.blog-cta p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.blog-cta .btn-primary {
    background: white;
    color: var(--primary);
    font-weight: 700;
}

.blog-cta .btn-primary:hover {
    background: var(--light);
    transform: translateY(-2px);
}

/* ── Footer (compact version) ── */
footer {
    background: var(--dark);
    color: white;
    padding: 2.5rem 1.25rem;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.footer-content .brand {
    color: white;
}

.footer-content .brand span {
    color: var(--secondary);
}

.footer-description {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

footer h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #d1d5db;
}

footer ul {
    list-style: none;
}

footer li {
    margin-bottom: 0.4rem;
}

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

footer a:hover {
    color: white;
}

.footer-bottom {
    max-width: 1100px;
    margin: 1.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}

/* ── Animation ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Article Page Styles ── */
.article-header {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 0 1.5rem;
}

.article-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.article-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.article-breadcrumb a:hover {
    text-decoration: underline;
}

.article-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 1rem;
}

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

.article-content {
    max-width: 760px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.article-content h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    color: var(--dark);
}

.article-content h3 {
    font-size: 1.2rem;
    margin: 2rem 0 0.75rem;
    color: var(--dark);
}

.article-content p {
    margin-bottom: 1.25rem;
    color: #374151;
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    color: #374151;
    line-height: 1.8;
}

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

.article-content blockquote {
    border-left: 4px solid var(--primary);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #eef2ff;
    border-radius: 0 10px 10px 0;
    color: #1e3a8a;
    font-style: italic;
}

.article-content code {
    background: rgba(17, 24, 39, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.9em;
}

.article-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1.25rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

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

.article-content .callout {
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 1px solid;
}

.article-content .callout-tip {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.article-content .callout-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.article-tag {
    background: var(--light);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
}

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

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

    .footer-content {
        grid-template-columns: 1fr;
    }

    .topbar nav {
        display: none;
    }

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

@media (max-width: 480px) {
    .blog-hero {
        padding: 2rem 0.5rem 1.5rem;
    }

    .post-image {
        height: 140px;
    }

    .blog-cta {
        padding: 2rem 1rem;
    }

    .blog-cta h2 {
        font-size: 1.4rem;
    }
}

