/**
 * Blog article pages — theme-aware, 1080p px baseline (readable at all viewport sizes).
 * Requires /css/themes.css, /newindex.css, html[data-theme].
 */

body.blog-page {
    background: var(--blog-page-bg) !important;
    color: var(--blog-body-text) !important;
}

body.blog-page #Home {
    background: var(--blog-page-bg) !important;
    min-height: auto !important;
    padding-top: 88px;
    padding-bottom: 64px;
}

body.blog-page .blog-article-shell {
    margin-top: 24px;
}

body.blog-page #articlediv {
    font-size: 18px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 32px;
    text-align: left;
    box-sizing: border-box;
}

#articlediv h2 {
    color: var(--blog-heading) !important;
    font-family: 'Khand', 'Inter', sans-serif;
    font-size: 40px;
    line-height: 1.2;
    margin-bottom: 20px;
}

.blog-article-header {
    text-align: center;
    margin-bottom: 28px;
}

#articlediv .blog-article-title {
    text-align: center;
    margin-bottom: 16px;
}

#articlediv .blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin: 0 0 1.2em;
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.5;
    color: var(--blog-body-text) !important;
    text-align: center;
}

#articlediv .blog-article-meta-sep {
    opacity: 0.45;
    user-select: none;
}

#articlediv p {
    color: var(--blog-body-text) !important;
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.85;
    margin-bottom: 1.2em;
    text-align: left;
}

#articlediv strong {
    color: var(--blog-strong) !important;
    font-weight: 600;
}

nav.navbar.fixed-top {
    background: var(--blog-navbar-bg) !important;
}

#articlediv .blogimage {
    display: block;
    margin: 24px auto;
    width: auto;
    height: auto;
    max-width: 100% !important;
    max-height: 720px !important;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--blog-image-border);
    background-color: var(--blog-image-bg);
}

#articlediv .blogimage.blogimage--small {
    max-width: min(100%, 480px) !important;
    max-height: 360px !important;
}

.blog-video-wrap {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

#youtubevideo {
    width: 648px !important;
    height: 432px !important;
    max-width: 100% !important;
    border: 0 !important;
    border-radius: 12px !important;
}

.blog-section-heading {
    color: var(--blog-heading) !important;
    font-family: 'Khand', 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.25;
    margin: 2em 0 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--blog-section-border);
}

#articlediv code {
    background: var(--blog-code-inline-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 17px;
    color: var(--blog-code-inline-fg);
}

#articlediv a {
    color: var(--blog-link);
    text-decoration: none;
}

#articlediv a:hover {
    text-decoration: underline;
}

.blog-component-table-wrapper {
    overflow-x: auto;
    margin: 1.6em 0 2em;
    border-radius: 10px;
    border: 1px solid var(--blog-table-wrap-border);
}

.blog-component-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Khand', 'Inter', sans-serif;
    font-size: 17px;
}

.blog-component-table thead {
    background: var(--blog-table-head-bg);
}

.blog-component-table th {
    padding: 12px 16px;
    text-align: left;
    color: var(--blog-table-head-fg);
    font-weight: 600;
    font-size: 18px;
    border-bottom: 2px solid var(--blog-table-head-border);
    white-space: nowrap;
}

.blog-component-table td {
    padding: 10px 16px;
    color: var(--blog-table-cell-fg);
    border-bottom: 1px solid var(--blog-table-row-border);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 17px;
}

.blog-component-table tbody tr:hover {
    background: var(--blog-table-row-hover);
}

.blog-component-table tbody tr:last-child td {
    border-bottom: none;
}

.blog-component-table .part-num {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: var(--blog-table-part-fg);
    background: var(--blog-table-part-bg);
    padding: 1px 5px;
    border-radius: 3px;
}

.blog-component-table .tbd {
    color: var(--blog-table-tbd-fg);
    font-style: italic;
}

.qubi-code-block {
    background: var(--blog-code-block-bg);
    border: 1px solid var(--blog-code-block-border);
    border-radius: 10px;
    margin: 1.4em auto 1.6em;
    max-width: min(100%, 560px);
    overflow: hidden;
    text-align: left;
}

.qubi-code-header {
    background: var(--blog-code-header-bg);
    padding: 9px 16px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--blog-code-header-fg);
    border-bottom: 1px solid var(--blog-code-block-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.qubi-code-lang {
    background: var(--blog-code-lang-bg);
    color: var(--blog-code-lang-fg);
    font-size: 13px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}

.qubi-code-body {
    padding: 16px 20px;
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 16px;
    line-height: 1.65;
    color: var(--blog-code-body-fg);
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

.hl-gate { color: #c084fc; font-weight: 600; }
.hl-keyword { color: #9295ff; font-weight: 600; }
.hl-bracket { color: #63d4b6; }
.hl-paren { color: #60a5fa; }
.hl-number { color: #fbbf24; }
.hl-comment { color: #96addb; font-style: italic; }
.hl-py-kw { color: #ff7b72; }
.hl-py-fn { color: #d2a8ff; }
.hl-py-str { color: #a5d6ff; }
.hl-py-comment { color: #8b949e; font-style: italic; }

html[data-theme="light"] .hl-gate { color: #7c3aed; }
html[data-theme="light"] .hl-keyword { color: #4f46e5; }
html[data-theme="light"] .hl-comment,
html[data-theme="light"] .hl-py-comment { color: #64748b; }

/* Compact desktop / 720p landscape — same readable type, tighter gutters only */
@media (min-width: 768px) and (max-width: 1280px) {
    body.blog-page #Home {
        padding-top: 80px;
        padding-bottom: 56px;
    }

    body.blog-page #articlediv {
        padding: 0 24px;
    }
}

@media (max-width: 767.98px) {
    body.blog-page #Home {
        padding-top: 72px;
        padding-bottom: 48px;
    }

    body.blog-page #articlediv {
        max-width: 100%;
        padding: 0 18px;
        font-size: 17px;
    }

    #articlediv h2 {
        font-size: 32px;
    }

    #articlediv p {
        font-size: 18px;
        line-height: 1.8;
    }

    .blog-section-heading {
        font-size: 26px;
    }

    #articlediv code {
        font-size: 16px;
    }

    .blog-component-table {
        font-size: 16px;
    }

    .blog-component-table th {
        font-size: 17px;
        padding: 10px 12px;
    }

    .blog-component-table td {
        font-size: 16px;
        padding: 9px 12px;
    }

    .qubi-code-block {
        max-width: 100%;
    }

    .qubi-code-body {
        font-size: 15px;
    }

    #youtubevideo {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }
}
