/* Blog layout — extends site tokens from style.css */

.blog-page {
    background: var(--bg-deep);
}

.reading-bar {
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: 0;
    height: 3px;
    z-index: 1001;
    background: transparent;
    pointer-events: none;
}

.reading-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 12px var(--primary-glow);
    transition: width 0.08s linear;
}

.header.scrolled .reading-bar {
    top: var(--header-h);
}

/* Blog hero */
.blog-hero {
    position: relative;
    padding: calc(var(--header-h) + 4.5rem) 0 4rem;
    overflow: hidden;
    z-index: 1;
}

.blog-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 15%, transparent 75%);
    pointer-events: none;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    list-style: none;
    margin-bottom: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.breadcrumb a {
    color: var(--text-faint);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    color: rgba(255, 255, 255, 0.2);
}

.blog-hero .section-badge {
    margin-bottom: 1.1rem;
}

.blog-hero h1 {
    font-size: clamp(1.7rem, 4.4vw, 2.85rem);
    font-weight: 900;
    line-height: 1.35;
    color: #fff;
    letter-spacing: -0.03em;
    max-width: 920px;
    margin-bottom: 1.25rem;
    overflow-wrap: anywhere;
}

.blog-hero h1 .error-phrase {
    display: block;
    margin-top: 0.35rem;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 55%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Segoe UI', Vazirmatn, sans-serif;
    letter-spacing: -0.03em;
}

.blog-lead {
    font-size: 1.08rem;
    color: var(--text-faint);
    max-width: 720px;
    line-height: 2;
    margin-bottom: 1.75rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    color: var(--text-faint);
    font-size: 0.88rem;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.article-meta svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

/* Listing */
.blog-listing {
    background: var(--bg-light);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: -1.5rem;
    padding: 4.5rem 0 5.5rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.blog-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-body);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-card);
}

.blog-card-cover {
    position: relative;
    min-height: 200px;
    background:
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.35), transparent 45%),
        radial-gradient(circle at 20% 90%, rgba(124, 92, 255, 0.35), transparent 50%),
        linear-gradient(160deg, #0a1628, #121f3a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.blog-card-cover span {
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    text-align: center;
    line-height: 1.6;
}

.blog-card-body {
    padding: 1.75rem 1.75rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.blog-card-tag {
    display: inline-flex;
    width: fit-content;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.blog-card h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.55;
}

.blog-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.85;
}

.blog-card-foot {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.blog-card-foot strong {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Article layout */
.article-wrap {
    background: var(--bg-light);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: -1.5rem;
    padding: 3.25rem 0 5rem;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 2.5rem;
    align-items: start;
}

.article-main {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}

.toc {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    padding: 1.35rem 1.2rem;
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
}

.toc h2 {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.9rem;
    letter-spacing: 0.04em;
}

.toc ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.toc a {
    display: block;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.55;
    border-right: 2px solid transparent;
    transition: var(--transition);
}

.toc a:hover,
.toc a.active {
    color: var(--text-dark);
    background: rgba(0, 212, 255, 0.08);
    border-right-color: var(--primary);
}

.answer-box {
    background: linear-gradient(160deg, #0a1628 0%, #121f3a 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.7rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.answer-box .label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.65rem;
    letter-spacing: 0.04em;
}

.answer-box p {
    color: var(--text-light);
    line-height: 2;
    font-size: 1rem;
    margin: 0;
}

.answer-box strong {
    color: #fff;
}

.article-prose {
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    padding: 2.4rem 2.35rem 2.6rem;
}

.article-prose > p {
    font-size: 1.05rem;
    line-height: 2.05;
    color: var(--text-body);
    margin-bottom: 1.2rem;
}

.article-prose h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 2.4rem 0 1rem;
    scroll-margin-top: calc(var(--header-h) + 1.25rem);
    letter-spacing: -0.02em;
}

.article-prose h3 {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 1.6rem 0 0.7rem;
    scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

.article-prose ul,
.article-prose ol.plain {
    margin: 0 0 1.3rem 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.article-prose ul li,
.article-prose ol.plain li {
    position: relative;
    padding: 0.15rem 1.4rem 0.15rem 0;
    color: var(--text-body);
    line-height: 1.9;
}

.article-prose ul li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.85rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.error-quote {
    display: block;
    margin: 1.4rem 0 1.6rem;
    padding: 1.15rem 1.3rem;
    background: #fff6f4;
    border: 1px solid #ffd4cc;
    border-right: 4px solid #e11d48;
    border-radius: var(--radius-md);
    color: #9f1239;
    font-family: 'Segoe UI', Vazirmatn, sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
}

kbd,
.kbd {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 7px;
    background: #0f1729;
    color: #fff;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.86em;
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.answer-box .kbd {
    background: rgba(255, 255, 255, 0.12);
    color: var(--primary);
}

.note,
.tip,
.warn {
    margin: 1.4rem 0 1.6rem;
    padding: 1.1rem 1.2rem;
    border-radius: var(--radius-md);
    line-height: 1.9;
    font-size: 0.95rem;
}

.note {
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 168, 204, 0.2);
    color: var(--text-body);
}

.tip {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.warn {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.cta-download {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
    padding: 1.3rem 1.4rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 92, 255, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: var(--radius-lg);
}

.cta-download p {
    margin: 0;
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.7;
}

.cta-download p span {
    display: block;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cta-download .btn,
.cta-download .btn span {
    color: #041018;
    font-weight: 800;
}

/* Install steps */
.steps {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    margin: 1.4rem 0 2rem;
}

.step-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0.9rem;
    padding: 1.2rem 1.2rem 1.25rem;
    background: #f7fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
}

.step-num {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--primary), #0099cc);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.step-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
}

.step-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text-body);
}

.mock {
    margin-top: 0.95rem;
    background: #0b1220;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    direction: ltr;
    text-align: left;
}

.mock-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: #121a2c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
}

.mock-dot:nth-child(1) { background: #f87171; }
.mock-dot:nth-child(2) { background: #fbbf24; }
.mock-dot:nth-child(3) { background: #34d399; }

.mock-url {
    flex: 1;
    margin-inline-start: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #0b1220;
    color: #94a3b8;
    font-size: 11px;
    font-family: ui-monospace, Consolas, monospace;
}

.mock-body {
    padding: 16px 16px 18px;
    color: #e2e8f0;
    font-family: 'Segoe UI', sans-serif;
}

.mock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mock-title {
    font-size: 14px;
    font-weight: 700;
}

.mock-toggle {
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #0099cc);
    position: relative;
}

.mock-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
}

.mock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 8px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
}

.mock-btn.primary {
    background: linear-gradient(135deg, var(--primary), #0099cc);
    color: #061018;
}

.mock-ext {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mock-ext b {
    font-size: 13px;
}

.mock-ext small {
    display: block;
    color: #94a3b8;
    font-size: 11px;
}

.folder-tree {
    margin: 0.9rem 0 0;
    padding: 0.95rem 1rem;
    background: #0f1729;
    color: #dbeafe;
    border-radius: 12px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.8;
    direction: ltr;
    text-align: left;
    overflow-x: auto;
}

.folder-tree .hi {
    color: var(--primary);
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 1rem 0 0;
}

.faq-item {
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: var(--radius-md);
    background: #fafafe;
    overflow: hidden;
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.12);
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.faq-item[open] summary::after {
    content: '–';
}

.faq-item p {
    padding: 0 1.15rem 1.1rem;
    margin: 0;
    color: var(--text-body);
    line-height: 1.9;
}

.article-footer-cta {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(160deg, #0a1628 0%, #121f3a 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: center;
}

.article-footer-cta h2 {
    margin: 0 0 0.4rem;
    color: #fff;
    font-size: 1.25rem;
}

.article-footer-cta p {
    margin: 0;
    color: var(--text-faint);
    max-width: 480px;
}

.related {
    margin-top: 1.5rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.related a {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.related a:hover {
    text-decoration: underline;
}

.toc-mobile {
    display: none;
    margin-bottom: 1.25rem;
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.9rem 0.7rem;
}

.toc-mobile summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--text-dark);
    padding: 0.7rem 0;
}

.toc-mobile ol {
    list-style: none;
    padding: 0 0 0.4rem;
}

.toc-mobile a {
    display: block;
    padding: 0.4rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

@media (max-width: 980px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .toc,
    .article-main {
        grid-column: auto;
    }

    .toc {
        display: none;
    }

    .toc-mobile {
        display: block;
    }

    .blog-card {
        grid-template-columns: 1fr;
    }

    .blog-card-cover {
        min-height: 160px;
    }
}

@media (max-width: 768px) {
    .article-prose {
        padding: 1.4rem 1.15rem 1.7rem;
    }

    .step-card {
        grid-template-columns: 1fr;
    }

    .cta-download,
    .article-footer-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-download .btn,
    .article-footer-cta .btn {
        width: 100%;
    }

    .blog-hero {
        padding: calc(var(--header-h) + 3rem) 0 3.2rem;
    }
}

@media (max-width: 480px) {
    .article-meta {
        gap: 0.55rem;
    }

    .blog-hero h1 {
        font-size: 1.55rem;
    }
}
