/* ==========================================================================
   Article page — layout, breadcrumb, article header, body content,
   TOC sidebar, product recommend block, float widget, responsive
   Depends on: main.css (variables, .container, .btn, .tag-txt, etc.)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Article page layout
   -------------------------------------------------------------------------- */
.article-page-wrap {
    display: grid;
    grid-template-columns: 1fr 288px;
    gap: 64px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 120px 5vw 100px;
    align-items: start;
}

.article-main {
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--c-text);
    margin-bottom: 40px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.breadcrumb a {
    color: var(--c-text);
    font-weight: 600;
    transition: color 0.2s ease;
}

.breadcrumb a:hover { color: var(--c-accent); }

.breadcrumb-sep {
    color: rgba(0, 0, 0, 0.25);
    font-size: 14px;
}

.breadcrumb-current {
    color: var(--c-dark);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Article header — injected by article-recommend.js
   -------------------------------------------------------------------------- */
.article-header {
    margin-bottom: 52px;
    padding-bottom: 44px;
    border-bottom: 2px solid var(--c-dark);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.article-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--c-accent);
    border: 1px solid rgba(255, 74, 74, 0.3);
    padding: 4px 10px;
}

.article-tag--category {
    color: var(--c-text);
    border-color: rgba(0, 0, 0, 0.12);
    background: var(--c-surface);
}

.article-tag--latest {
    background: var(--c-accent);
    color: white;
    border-color: var(--c-accent);
}

.article-title {
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 900;
    color: var(--c-dark);
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 24px;
}

.article-meta-dot { color: rgba(0, 0, 0, 0.2); }

.article-summary {
    font-size: 15px;
    color: #555;
    line-height: 1.85;
    padding: 20px 20px 20px 24px;
    background: var(--c-surface);
    border-left: 3px solid var(--c-accent);
}

/* --------------------------------------------------------------------------
   Article body content
   -------------------------------------------------------------------------- */
.article-body {
    font-size: 16px;
    line-height: 1.9;
    color: #444;
}

.article-body h2 {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 900;
    color: var(--c-dark);
    letter-spacing: -0.5px;
    margin: 64px 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--c-surface);
    position: relative;
}

.article-body h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--c-accent);
}

.article-body h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--c-dark);
    margin: 40px 0 16px;
    letter-spacing: -0.3px;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ul,
.article-body ol {
    list-style: none;
    margin-bottom: 24px;
    padding-left: 0;
}

.article-body ul li,
.article-body ol li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.8;
}

.article-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--c-accent);
    flex-shrink: 0;
}

.article-body ol {
    counter-reset: ol-counter;
}

.article-body ol li {
    counter-increment: ol-counter;
}

.article-body ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    background: var(--c-dark);
    color: white;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.article-body a {
    color: var(--c-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body a:hover { opacity: 0.75; }

.article-body strong {
    color: var(--c-dark);
    font-weight: 800;
}

.article-body code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    background: var(--c-surface);
    padding: 2px 7px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--c-accent);
}

.article-body pre {
    background: #111;
    color: rgba(255, 255, 255, 0.85);
    padding: 28px 32px;
    overflow-x: auto;
    max-width: 100%;
    margin: 28px 0;
    border-left: 3px solid var(--c-accent);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.75;
}

.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.article-body blockquote {
    margin: 28px 0;
    padding: 20px 24px;
    background: rgba(255, 74, 74, 0.04);
    border-left: 4px solid var(--c-accent);
    color: #555;
    font-style: italic;
}

.article-body blockquote p { margin-bottom: 0; }

/* Callout boxes */
.callout {
    margin: 28px 0;
    padding: 18px 24px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid transparent;
}

.callout--tip {
    background: rgba(80, 210, 120, 0.07);
    border-color: rgba(80, 210, 120, 0.25);
}

.callout--warning {
    background: rgba(255, 166, 0, 0.07);
    border-color: rgba(255, 166, 0, 0.25);
}

.callout--info {
    background: rgba(74, 144, 255, 0.06);
    border-color: rgba(74, 144, 255, 0.2);
}

.callout-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.callout-body {
    font-size: 14px;
    line-height: 1.75;
    color: #555;
}

.callout-body strong { color: var(--c-dark); }

/* In-body CTA block */
.article-cta-block {
    margin: 48px 0;
    padding: 36px 40px;
    background: var(--c-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.article-cta-text h3 {
    font-size: 20px;
    font-weight: 900;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.article-cta-text p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0;
    line-height: 1.6;
}

.article-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--c-accent);
    color: white;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none;
}

.article-cta-btn:hover {
    background: white;
    color: var(--c-dark);
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Product recommend block — injected after #article-body by article-recommend.js
   -------------------------------------------------------------------------- */
.product-recommend {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid var(--c-dark);
}

.product-recommend-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: 24px;
    display: block;
}

.product-recommend-inner {
    background: var(--c-dark);
    padding: 56px 60px;
}

.product-recommend-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 24px;
}

.product-recommend-title {
    font-size: clamp(24px, 2.5vw, 36px);
    font-weight: 900;
    color: white;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.product-recommend-title span { color: var(--c-accent); }

.product-recommend-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.8;
    margin-bottom: 32px;
}

.product-recommend-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

.product-recommend-features li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
}

.product-recommend-features li:last-child { border-bottom: none; }

.product-recommend-features li::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--c-accent);
    flex-shrink: 0;
}

.product-recommend-cta {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}

.product-recommend-top .btn-main,
.product-recommend-cta .btn-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--c-accent);
    color: white;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-decoration: none;
}

.product-recommend-top .btn-main:hover,
.product-recommend-cta .btn-main:hover {
    background: white;
    color: var(--c-dark);
}

/* --------------------------------------------------------------------------
   Float widget
   -------------------------------------------------------------------------- */
.float-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 280px;
    background: var(--c-dark);
    color: white;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 500;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    border-bottom: 3px solid var(--c-accent);
}

.float-widget.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.float-widget-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 2px 6px;
    transition: color 0.2s ease;
    font-family: inherit;
}

.float-widget-close:hover { color: white; }

.float-widget-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: 12px;
    display: block;
}

.float-widget-title {
    font-size: 17px;
    font-weight: 900;
    color: white;
    line-height: 1.3;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}

.float-widget-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.7;
    margin-bottom: 20px;
}

.float-widget-btn {
    display: block;
    text-align: center;
    padding: 12px 0;
    background: var(--c-accent);
    color: white;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s ease;
}

.float-widget-btn:hover { background: #e03030; }

/* --------------------------------------------------------------------------
   Sidebar TOC
   -------------------------------------------------------------------------- */
.article-sidebar {
    position: sticky;
    top: 100px;
}

.toc-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.07);
    padding: 28px 24px;
}

.toc-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--c-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toc-list li:last-child { border-bottom: none; }

.toc-list a {
    display: block;
    padding: 9px 0;
    font-size: 13px;
    color: #888;
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.2s ease, padding-left 0.2s ease;
    text-decoration: none;
}

.toc-list a:hover {
    color: var(--c-accent);
    padding-left: 6px;
}

.toc-list a.toc-active {
    color: var(--c-accent);
    font-weight: 700;
    padding-left: 6px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .article-page-wrap {
        grid-template-columns: 1fr;
        padding: 100px 5vw 80px;
    }

    .article-sidebar {
        display: none;
    }

    .product-recommend-inner {
        gap: 36px;
        padding: 40px 36px;
    }

    .product-recommend-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .article-page-wrap {
        padding: 80px 5vw 60px;
    }

    .article-body { font-size: 15px; }
    .article-body h2 { font-size: 22px; margin: 48px 0 18px; }
    .article-body h3 { font-size: 18px; margin: 32px 0 14px; }

    .article-cta-block {
        flex-direction: column;
        padding: 28px 24px;
        gap: 16px;
    }

    .product-recommend-inner {
        padding: 32px 24px;
    }

    .product-recommend-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .float-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .article-title { letter-spacing: -0.5px; }
    .article-body pre { padding: 20px 16px; font-size: 12px; }
}

/* Hide float widget when mobile menu is open to avoid z-index stacking conflicts */
body.mobile-menu-open .float-widget {
    display: none !important;
}

/* SEO utility: visually hidden but readable by screen readers and crawlers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
