/* ===========================
   Blog Detail Page - blog.css
   =========================== */

/* ---------- Back button in navbar ---------- */
.btn-outline-blog {
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.3s;
}

.btn-outline-blog:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

/* ---------- Blog Hero ---------- */
.blog-hero {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    margin-top: 80px;
    /* navbar height offset */
}

.blog-hero-img-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #0d1117 0%, #1a1040 100%);
}

.blog-hero-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    filter: blur(2px) brightness(0.7);
}

.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0d1117 0%, transparent 60%);
}

.blog-hero-content {
    position: relative;
    z-index: 1;
    padding: 4rem 1.5rem 3rem;
    max-width: 860px;
}

.blog-hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.blog-hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    max-width: 640px;
}

.blog-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    align-items: center;
}

.blog-hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-hero-meta i {
    color: var(--primary);
}

/* ---------- Article Body ---------- */
.blog-article {
    max-width: 820px;
    margin: 3rem auto;
    padding: 0 1.5rem 6rem;
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1rem;
}

.blog-article section {
    margin-bottom: 3rem;
}

.blog-article p {
    margin-bottom: 1rem;
}

.blog-article h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-article h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-article strong {
    color: var(--text-main);
}

.blog-article code {
    background: rgba(31, 111, 235, 0.15);
    color: #58a6ff;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ---------- Table of Contents ---------- */
.blog-toc {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 3rem;
}

.blog-toc h4 {
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-toc h4 i {
    color: var(--primary);
}

.blog-toc ol {
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.blog-toc li a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: 0.2s;
}

.blog-toc li a:hover {
    color: var(--primary);
}

/* ---------- Code Blocks ---------- */
.code-block {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 1.25rem 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #161b22;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.78rem;
}

.code-header .code-lang {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-header .code-file {
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.code-block pre {
    padding: 1.25rem;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    background: transparent;
    color: #e6edf3;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre;
}

/* ---------- Callouts ---------- */
.callout {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1.25rem 0;
    font-size: 0.92rem;
    align-items: flex-start;
}

.callout i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.callout-info {
    background: rgba(47, 129, 247, 0.08);
    border-left: 3px solid var(--primary);
    color: var(--text-muted);
}

.callout-info i {
    color: var(--primary);
}

.callout-tip {
    background: rgba(63, 185, 80, 0.08);
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

.callout-tip i {
    color: var(--accent);
}

.callout-warning {
    background: rgba(210, 153, 34, 0.08);
    border-left: 3px solid #d29922;
    color: var(--text-muted);
}

.callout-warning i {
    color: #d29922;
}

/* ---------- Architecture Diagram ---------- */
.blog-diagram {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 1rem;
    margin: 1.5rem 0;
}

.diagram-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    min-width: 90px;
}

.diagram-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #0d1117;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.diagram-arrow {
    color: var(--primary);
    font-size: 1.1rem;
    opacity: 0.6;
}

/* ---------- Info Cards Grid ---------- */
.blog-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.info-card {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.3s;
}

.info-card:hover {
    border-color: var(--primary);
}

.info-card i {
    font-size: 1.5rem;
    color: var(--primary);
}

.info-card h4 {
    color: var(--text-main);
    font-size: 0.95rem;
}

.info-card p {
    font-size: 0.82rem;
    margin: 0;
    line-height: 1.5;
}

/* ---------- Blog List ---------- */
.blog-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blog-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.blog-list i {
    color: var(--primary);
    margin-top: 0.2rem;
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* ---------- Author Card ---------- */
.blog-author-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    margin-top: 2.5rem;
}

.author-avatar {
    font-size: 3.5rem;
    color: var(--primary);
    line-height: 1;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.author-info strong {
    font-size: 1.05rem;
    color: var(--text-main);
}

.author-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.author-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
}

.author-links a {
    color: var(--primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: opacity 0.2s;
}

.author-links a:hover {
    opacity: 0.7;
}

/* ---------- Back Nav ---------- */
.blog-back-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* ---------- Comparison Table ---------- */
.blog-table-wrapper {
    overflow-x: auto;
    margin: 1.25rem 0;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.blog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.blog-table th {
    background: #161b22;
    color: var(--text-main);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.blog-table th i {
    margin-right: 0.4rem;
    color: var(--primary);
}

.blog-table td {
    padding: 0.7rem 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    vertical-align: top;
}

.blog-table tr:last-child td {
    border-bottom: none;
}

.blog-table tr:hover td {
    background: rgba(47, 129, 247, 0.04);
}

.blog-table td:first-child {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .blog-hero-content h1 {
        font-size: 1.6rem;
    }

    .blog-diagram {
        gap: 0.3rem;
    }

    .diagram-node {
        min-width: 70px;
        font-size: 0.7rem;
    }

    .diagram-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .blog-cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .blog-author-card {
        flex-direction: column;
        text-align: center;
    }

    .author-links {
        justify-content: center;
    }
}