/* =========================================================
   Documentation articles — reading workspace
   ========================================================= */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    height: 3px;
    background: transparent;
}

.reading-progress-bar {
    width: 0;
    height: 100%;
    background: var(--gradient);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.45);
    transition: width 0.1s linear;
}

/* Hero */
.article-wrap {
    padding: 20px 0 90px;
}

.article-hero {
    padding: 0 0 30px;
}

.article-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 20px;
    align-items: stretch;
}

.article-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 92% 8%, rgba(37, 99, 235, 0.07), transparent 36%),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.article-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.article-breadcrumb a {
    color: var(--muted-strong);
    transition: color var(--fast);
}

.article-breadcrumb a:hover {
    color: var(--blue);
}

.article-breadcrumb i {
    color: var(--line-strong);
    font-size: 8px;
}

.article-breadcrumb .current {
    color: var(--blue);
}

.article-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-bottom: 14px;
    padding: 6px 11px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: var(--radius-pill);
    background: rgba(37, 99, 235, 0.06);
    color: var(--blue);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.article-title {
    max-width: 18ch;
    font-size: clamp(2rem, 3.8vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.article-intro {
    max-width: 60ch;
    margin-top: 17px;
    color: var(--body);
    font-size: 14px;
    line-height: 1.8;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
    color: var(--muted-strong);
    font-size: 11.5px;
    font-weight: 600;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-meta i {
    color: var(--blue);
    font-size: 10px;
}

.article-hero-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 82% 12%, rgba(124, 58, 237, 0.28), transparent 40%),
        radial-gradient(circle at 10% 92%, rgba(37, 99, 235, 0.3), transparent 42%),
        #0f172a;
    box-shadow: var(--shadow-md);
}

.article-hero-card-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(226, 232, 240, 0.6);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.article-hero-card-label i {
    color: #93c5fd;
}

.article-hero-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.article-fact span {
    display: block;
    color: rgba(226, 232, 240, 0.5);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-fact strong {
    display: block;
    margin-top: 4px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.article-hero-note {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(226, 232, 240, 0.58);
    font-size: 10.5px;
    line-height: 1.6;
}

/* Shell */
.article-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.article-rail {
    min-width: 0;
    position: sticky;
    top: 108px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-anchors {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.anchors-label {
    margin-bottom: 10px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
}

.article-anchors a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px;
    border-radius: 8px;
    color: var(--body);
    font-size: 11.5px;
    line-height: 1.4;
    transition: background var(--fast), color var(--fast);
}

.article-anchors a:hover,
.article-anchors a.active {
    background: rgba(37, 99, 235, 0.07);
    color: var(--blue);
}

.anchor-num {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 9px;
}

.article-anchors a.active .anchor-num {
    color: var(--blue);
}

.rail-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--canvas);
}

.rail-card strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ink);
    font-size: 11px;
}

.rail-card span {
    display: block;
    color: var(--muted-strong);
    font-size: 10.5px;
    line-height: 1.55;
}

/* Body */
.article-body {
    min-width: 0;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.content-section {
    scroll-margin-top: 112px;
    padding-bottom: 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line-soft);
}

.content-section:last-of-type {
    margin-bottom: 0;
}

.content-section h2 {
    position: relative;
    margin-bottom: 14px;
    padding-left: 16px;
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 23px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.3;
}

.content-section h2::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 4px;
    border-radius: 4px;
    background: var(--gradient);
}

.content-section h3 {
    margin: 22px 0 9px;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 700;
}

.content-section p {
    margin-bottom: 11px;
    color: var(--body);
    font-size: 13.5px;
    line-height: 1.82;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.content-section ul li {
    position: relative;
    padding-left: 21px;
    color: var(--body);
    font-size: 13px;
    line-height: 1.7;
}

.content-section ul li::before {
    content: "\f00c";
    position: absolute;
    top: 3px;
    left: 0;
    color: var(--blue);
    font-family: "Font Awesome 6 Free";
    font-size: 9px;
    font-weight: 900;
}

.content-section ol {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 12px 0;
    counter-reset: step;
}

.content-section ol li {
    position: relative;
    padding-left: 32px;
    color: var(--body);
    font-size: 13px;
    line-height: 1.7;
    counter-increment: step;
}

.content-section ol li::before {
    content: counter(step);
    position: absolute;
    top: 1px;
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 7px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--blue);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
}

.content-section strong {
    color: var(--ink);
    font-weight: 700;
}

/* Table */
.docs-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    margin: 14px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    font-size: 12.5px;
}

.docs-table th {
    padding: 11px 14px;
    background: var(--canvas);
    color: var(--muted-strong);
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

.docs-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--line-soft);
    color: var(--body);
    line-height: 1.6;
}

.docs-table tbody tr:hover td {
    background: #fbfcff;
}

.docs-table td:first-child {
    color: var(--ink);
    font-weight: 650;
}

.docs-table .highlight {
    color: var(--blue);
    font-weight: 700;
}

.docs-table .total-row td {
    background: rgba(37, 99, 235, 0.04);
    border-top-color: rgba(37, 99, 235, 0.16);
}

/* Callout */
.docs-callout {
    margin: 16px 0;
    padding: 15px 18px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.055);
}

.docs-callout p {
    margin: 0;
    color: #92400e;
    font-size: 12.5px;
    line-height: 1.7;
}

.docs-callout ul {
    margin: 0;
}

.docs-callout ul li {
    color: #78350f;
}

.docs-callout ul li::before {
    color: var(--amber);
}

/* Feature mini cards */
.feature-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.feature-mini-card {
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--blue);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
}

.feature-mini-card h4 {
    margin-bottom: 5px;
    font-size: 13px;
}

.feature-mini-card p {
    color: var(--body);
    font-size: 12px;
    line-height: 1.65;
}

/* Related */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.related-card {
    display: block;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    transition: transform var(--fast), border-color var(--fast), box-shadow var(--fast);
}

.related-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: var(--shadow-xs);
}

.related-card h4 {
    margin-bottom: 4px;
    color: var(--ink);
    font-size: 12.5px;
}

.related-card p {
    color: var(--muted-strong);
    font-size: 11px;
    line-height: 1.55;
}

/* Feedback */
.feedback-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 30px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 84% 20%, rgba(124, 58, 237, 0.26), transparent 42%),
        radial-gradient(circle at 12% 90%, rgba(37, 99, 235, 0.26), transparent 40%),
        #0f172a;
    color: #fff;
}

.feedback-section h3 {
    margin-bottom: 5px;
    color: #fff;
    font-size: 17px;
}

.feedback-section p {
    color: rgba(226, 232, 240, 0.66);
    font-size: 12px;
}

.feedback-buttons {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    transition: background var(--fast);
}

.feedback-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Article navigation */
.article-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--body);
    font-size: 12px;
    font-weight: 650;
    transition: border-color var(--fast), color var(--fast), background var(--fast);
}

.nav-btn:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--surface);
    color: var(--blue);
}

.nav-btn i {
    color: var(--blue);
    font-size: 9px;
}

.nav-next {
    justify-content: flex-end;
    text-align: right;
}

.nav-btn.disabled {
    justify-content: center;
    color: var(--muted);
    cursor: default;
}

.nav-btn.disabled:hover {
    border-color: var(--line);
    background: var(--canvas);
    color: var(--muted);
}

/* Responsive */
@media (max-width: 1000px) {
    .article-hero-grid {
        grid-template-columns: 1fr;
    }

    .article-hero-copy {
        padding: 30px;
    }

    .article-hero-card {
        min-height: 200px;
    }

    .article-shell {
        grid-template-columns: 1fr;
    }

    .article-rail {
        position: static;
    }

    .article-anchors {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        padding: 14px;
    }

    .anchors-label {
        width: 100%;
        margin-bottom: 2px;
    }

    .article-anchors a {
        padding: 5px 9px;
        border: 1px solid var(--line);
        border-radius: var(--radius-pill);
    }

    .rail-card {
        display: none;
    }
}

@media (max-width: 760px) {
    .feature-card-grid {
        grid-template-columns: 1fr;
    }

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

    .feedback-section {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .article-wrap {
        padding-top: 10px;
    }

    .article-hero-copy {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .article-title {
        font-size: clamp(1.8rem, 8.5vw, 2.4rem);
    }

    .article-hero-card {
        padding: 24px;
        border-radius: 24px;
    }

    .article-body {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .content-section h2 {
        font-size: 20px;
    }

    .docs-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .article-nav {
        grid-template-columns: 1fr;
    }

    .feedback-buttons {
        width: 100%;
        flex-direction: column;
    }

    .feedback-btn {
        width: 100%;
    }
}
