/* Articles (/article). Loaded after css/home-modern.css and
   docs/assets/docs.css: the theme tokens (--brand, --ink, --muted, --line),
   the buttons, breadcrumb, "on this page" list and the whole article
   typography (.doc-body) come from those two. This file adds the list grid,
   the cards and the article frame around the body. */

.article-page { --ar-w: 1180px; }

/* ---------- Shared ---------- */
.article-page .ar-pill { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: #1d4ed8; background: #eff6ff; border: 1px solid #dbeafe; padding: 4px 11px; border-radius: 999px; }
.article-page a.ar-pill:hover { background: var(--brand); border-color: var(--brand); color: #fff; text-decoration: none; }
.article-page .dx-btn.ghost-light { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.35); color: #fff; }
.article-page .dx-btn.ghost-light:hover { background: rgba(255,255,255,.2); box-shadow: none; }

/* ---------- List ---------- */
.article-page .ar-hero { padding-bottom: 8px; }
.article-page .ar-lang-note { display: inline-flex; align-items: center; gap: 8px; margin: -8px 0 0; font-size: .9rem; color: #92400e;
    background: #fffbeb; border: 1px solid #fde68a; padding: 6px 14px; border-radius: 999px; }
.article-page .ar-wrap { max-width: var(--ar-w); margin: 0 auto; padding: 18px 20px var(--sec-y); }

.article-page .ar-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 34px; }
.article-page .ar-cats a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; color: #334155; font-weight: 600; font-size: .9rem; transition: border-color .2s, background .2s, color .2s; }
.article-page .ar-cats a i { color: #94a3b8; font-size: .85em; }
.article-page .ar-cats a span { font-size: .75rem; font-weight: 700; color: #94a3b8; background: #f1f5f9; border-radius: 999px; padding: 1px 8px; }
.article-page .ar-cats a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.article-page .ar-cats a.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.article-page .ar-cats a.is-current i, .article-page .ar-cats a.is-current span { color: #fff; }
.article-page .ar-cats a.is-current span { background: rgba(255,255,255,.2); }
.article-page .ar-cats a.ar-rss { border-style: dashed; color: #c2410c; }
.article-page .ar-cats a.ar-rss i { color: #f97316; }
.article-page .ar-none { text-align: center; color: var(--muted); padding: 40px 0; }

.article-page .ar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.article-page .ar-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,23,42,.05); transition: box-shadow .3s, transform .3s, border-color .3s; position: relative; }
.article-page .ar-card:hover { box-shadow: 0 18px 40px rgba(37,99,235,.12); transform: translateY(-3px); border-color: #cbd5e1; }
.article-page .ar-card-img { display: block; aspect-ratio: 1200 / 630; background: #0f172a; overflow: hidden; }
.article-page .ar-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.article-page .ar-card:hover .ar-card-img img { transform: scale(1.03); }
.article-page .ar-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.article-page .ar-card-title { font-size: 1.14rem; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; margin: 0; text-transform: none; }
.article-page .ar-card-title::after { display: none; }
/* style.css sizes every link at 16px; the title link takes the heading's size. */
.article-page .ar-card-title a { color: var(--ink); font: inherit; }
/* The whole card is clickable: the title link stretches over it. */
.article-page .ar-card-title a::before { content: ''; position: absolute; inset: 0; }
.article-page .ar-card-title a:hover { color: var(--brand); text-decoration: none; }
.article-page .ar-card-desc { color: var(--muted); font-size: .92rem; line-height: 1.55; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-page .ar-card-meta { margin: auto 0 0; padding-top: 4px; font-size: .8rem; color: #94a3b8; display: flex; gap: 8px; flex-wrap: wrap; }

/* The newest article on page one: image beside the text, full width. */
.article-page .ar-card.is-featured { grid-column: 1 / -1; flex-direction: row; }
.article-page .ar-card.is-featured .ar-card-img { flex: 0 0 56%; aspect-ratio: auto; min-height: 320px; }
.article-page .ar-card.is-featured .ar-card-body { justify-content: center; padding: 34px 38px; gap: 14px; }
.article-page .ar-card.is-featured .ar-card-title { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.article-page .ar-card.is-featured .ar-card-desc { font-size: 1rem; -webkit-line-clamp: 4; }
.article-page .ar-card.is-featured .ar-card-meta { margin-top: 6px; }

.article-page .ar-pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 40px 0 0; color: var(--muted); font-weight: 600; }
.article-page .ar-pager a { border: 1px solid var(--line); border-radius: 10px; padding: 9px 16px; color: var(--brand); }
.article-page .ar-pager a:hover { border-color: var(--brand); text-decoration: none; }

@media (max-width: 1000px) {
    .article-page .ar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .article-page .ar-card.is-featured { flex-direction: column; }
    .article-page .ar-card.is-featured .ar-card-img { flex: none; aspect-ratio: 1200 / 630; min-height: 0; }
    .article-page .ar-card.is-featured .ar-card-body { padding: 24px 24px 26px; }
}
@media (max-width: 640px) {
    .article-page .ar-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .article-page .ar-wrap { padding-left: 16px; padding-right: 16px; }
    .article-page .ar-cats { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px;
        padding: 0 16px 6px; scrollbar-width: none; }
    .article-page .ar-cats a { flex: none; }
}

/* ---------- One article ---------- */
.article-page .ar-article { max-width: var(--ar-w); margin: 0 auto; padding: 34px 20px 0; }
.article-page .ar-head { max-width: 820px; margin: 0 auto 26px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.article-page .ar-head .dx-crumbs { justify-content: center; margin-bottom: 20px; }
.article-page .ar-head h1 { font-size: clamp(1.8rem, 4.2vw, 2.75rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--ink);
    margin: 16px 0 14px; text-transform: none; text-shadow: none; text-align: inherit; }
.article-page .ar-head h1::after { display: none; }
.article-page .ar-desc { font-size: 1.14rem; color: var(--muted); line-height: 1.6; margin: 0 0 18px; max-width: 64ch; }
.article-page .ar-meta { justify-content: center; }
.article-page .ar-langs { margin: 14px 0 0; font-size: .86rem; color: var(--muted); }
.article-page .ar-langs i { margin-right: 4px; color: #94a3b8; }
.article-page .ar-langs a { font-weight: 700; color: var(--brand); }
/* Chinese: Inter has no CJK glyphs, so name the system Chinese fonts after it
   (Latin and digits still come from Inter), and loosen the line a little. */
body.article-zh { font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; }
.article-zh .doc-body { line-height: 1.85; }
.article-zh .ar-head h1, .article-zh .ar-card-title { letter-spacing: 0; }
.article-page .ar-cover { margin: 0 auto 44px; max-width: 1040px; }
.article-page .ar-cover img { display: block; width: 100%; height: auto; border-radius: 22px; background: #0f172a;
    box-shadow: 0 24px 60px rgba(15,23,42,.18); }

.article-page .ar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 56px; max-width: 1040px; margin: 0 auto; }
.article-page .ar-content { min-width: 0; max-width: 740px; }
.article-page .ar-body h2 { scroll-margin-top: 90px; }
.article-page .ar-aside { min-width: 0; }
.article-page .ar-toc { padding-top: 0; top: 90px; }

/* Numbered "big step" headings used by the step-by-step articles. */
.article-page .doc-body .num { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: .45em; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: .8em; vertical-align: .1em; }
/* A worked example or formula, set apart from the prose. */
.article-page .doc-body .formula { background: #0f172a; color: #e2e8f0; border-radius: 14px; padding: 18px 22px; font-weight: 600; line-height: 1.6; }
.article-page .doc-body .formula strong { color: #7dd3fc; }
.article-page .doc-body .key-points { background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px 18px 44px; }
.article-page .doc-body .key-points li::marker { color: var(--brand); }
.article-page .doc-body .ar-faq h3 { margin-top: 1.4em; }
/* Photos in the body. docs.css styles figures as zoomable screenshots; here
   they are plain illustrations, full column width, no zoom cursor. */
.article-page .doc-body figure.ar-photo { margin: 2em 0; }
.article-page .doc-body figure.ar-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; cursor: default; border: 0;
    border-radius: 16px; box-shadow: 0 16px 40px rgba(15,23,42,.12); }
.article-page .doc-body figure.ar-photo figcaption { text-align: left; }
/* A to-do list: an empty box per line, to tick off on a printout. */
.article-page .doc-body ul.checklist { list-style: none; padding-left: 0; }
.article-page .doc-body ul.checklist > li { position: relative; padding-left: 34px; }
.article-page .doc-body ul.checklist > li::before { content: ''; position: absolute; left: 0; top: .28em; width: 18px; height: 18px;
    border: 2px solid #93c5fd; border-radius: 5px; background: #fff; }

.article-page .ar-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 44px 0 0; padding: 18px 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-page .ar-share-label { font-weight: 700; color: var(--ink); margin-right: 4px; }
.article-page .ar-share a, .article-page .ar-share button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px;
    min-width: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: #334155; font: inherit;
    font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.article-page .ar-share a:hover, .article-page .ar-share button:hover { color: #fff; text-decoration: none; }
.article-page .ar-share a.wa:hover { background: #25d366; border-color: #25d366; }
.article-page .ar-share a.fb:hover { background: #1877f2; border-color: #1877f2; }
.article-page .ar-share a.x:hover { background: #0f172a; border-color: #0f172a; }
.article-page .ar-share a.in:hover { background: #0a66c2; border-color: #0a66c2; }
.article-page .ar-share button:hover { background: var(--brand); border-color: var(--brand); }

.article-page .ar-related { max-width: var(--ar-w); margin: 0 auto; padding: var(--sec-y-sm) 20px var(--sec-y); }
.article-page .ar-related-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 22px;
    border-top: 1px solid var(--line); padding-top: var(--sec-y-sm); }
.article-page .ar-related-head h2 { font-size: 1.5rem; font-weight: 800; color: var(--ink); margin: 0; text-transform: none; }
.article-page .ar-related-head h2::after { display: none; }
.article-page .ar-related-head a { font-weight: 700; color: var(--brand); white-space: nowrap; }

@media (max-width: 1000px) {
    .article-page .ar-layout { grid-template-columns: minmax(0, 1fr); }
    .article-page .ar-aside { display: none; }
    .article-page .ar-content { max-width: 760px; margin: 0 auto; }
}
@media (max-width: 640px) {
    .article-page .ar-article { padding: 22px 16px 0; }
    .article-page .ar-head { text-align: left; align-items: flex-start; }
    .article-page .ar-head .dx-crumbs, .article-page .ar-meta { justify-content: flex-start; }
    .article-page .ar-cover { margin: 0 -16px 30px; }
    .article-page .ar-cover img { border-radius: 0; box-shadow: none; }
    .article-page .ar-related { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Try-free and ebook boxes ---------- */
.article-page .ar-promo { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin: 44px 0 0; }
.article-single .ar-promo { grid-template-columns: minmax(0, 1fr); }
.article-page .ar-promo-card { border-radius: 20px; padding: 28px 30px; }
.article-page .ar-promo-card h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 8px; text-transform: none; line-height: 1.3; }
.article-page .ar-promo-card h2::after { display: none; }
.article-page .ar-promo-card p { margin: 0 0 18px; line-height: 1.6; }
.article-page .ar-promo-cta { background: linear-gradient(120deg, #0b1220, #1e3a8a 60%, #0369a1); color: #cbd5e1;
    box-shadow: 0 20px 50px rgba(15,23,42,.18); }
.article-page .ar-promo-cta h2 { color: #fff; }
.article-page .ar-promo-cta .dx-btn:not(.ghost-light) { background: #fff; color: #1d4ed8; }
.article-page .ar-promo-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.article-page .ar-promo-ebook { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.article-page .ar-promo-ebook .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; color: #fff;
    background: linear-gradient(135deg, #f59e0b, #f97316); margin-bottom: 12px; }
.article-page .ar-promo-ebook h2 { color: #78350f; }
.article-page .ar-promo-ebook ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.article-page .ar-promo-ebook a { display: inline-flex; align-items: center; gap: 9px; color: #b45309; font-weight: 700; }
.article-page .ar-promo-ebook a i { color: #ea580c; }
@media (max-width: 860px) { .article-page .ar-promo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .article-page .ar-promo-card { padding: 22px; } }

@media print {
    .article-page .ar-share, .article-page .ar-promo, .article-page .ar-related, .article-page .ar-aside { display: none !important; }
}
