/* Article reading page — Medium / Substack inspired.
   One 680px reading column, generous body size, quiet chrome. Uses the type tokens from style.css. */
:root {
  --read-w: 680px;
  --ink: #2E2E2E;
  --ink-2: #434343;       /* body copy, slightly softer than pure black (Medium uses #434343) */
  --ink-3: #5A5A5A;
  --line: #EDEDED;
  --fs-read: 19px; --lh-read: 1.72;
}
@media (max-width: 640px) { :root { --fs-read: 17.5px; --lh-read: 1.7; } }

.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 300; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; background: #FFC342; transform-origin: 0 50%; transform: scaleX(0); }

.article { padding: clamp(28px, 4.5vw, 64px) var(--gx) 0; }
.article > * { max-width: var(--read-w); margin-left: auto; margin-right: auto; }

/* ---------- header ---------- */
.a-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-3); padding: 10px 0; margin-bottom: 18px; }
.a-back:hover { color: var(--ink); }
.a-head { display: block; }
.a-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 12.5px !important; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); line-height: 1.4 !important; }
.a-kicker a { color: var(--accent-text); }
.a-kicker span[aria-hidden] { color: #BDBDBD; }
h1.a-title { font-family: var(--font-text) !important; font-weight: 500 !important; font-size: clamp(30px, 4vw, 44px) !important; line-height: 1.16 !important; letter-spacing: -0.028em !important; margin: 0; color: var(--ink); text-wrap: balance; }
.a-dek { margin: 16px 0 0; font-size: clamp(18px, 1.6vw, 21px) !important; line-height: 1.5 !important; color: var(--ink-3); text-wrap: pretty; }

.a-byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.a-avatar { width: 40px; height: 40px; border-radius: 50%; background: #FFF3D3; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.a-by { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.a-author { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.a-meta { font-size: 13.5px; color: var(--ink-3); }
.a-share { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.a-icon { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); background: none; border: 0; cursor: pointer; position: relative; }
.a-icon:hover { color: var(--ink); background: #F4F2EE; }
.a-icon.is-done::after { content: attr(data-copied); position: absolute; bottom: calc(100% + 6px); right: 0; white-space: nowrap; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: var(--r-md); }
.a-alt { font-size: 13.5px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 14px; margin-right: 6px; white-space: nowrap; }
.a-alt:hover { border-color: var(--ink); color: var(--ink); }

.a-cover { max-width: 1000px !important; margin: 36px auto 0; }
.a-cover img { width: 100%; height: auto; max-height: 520px; object-fit: cover; display: block; border-radius: var(--r-md); }

/* ---------- body ---------- */
.a-body { margin-top: 36px; color: var(--ink-2); font-size: var(--fs-read); line-height: var(--lh-read); overflow-wrap: break-word; }
.a-body > *:first-child { margin-top: 0; }
.a-body p, .a-body li { font-size: var(--fs-read) !important; line-height: var(--lh-read) !important; }
.a-body p { margin: 0 0 1.25em; }
.a-body h2, .a-body h3 { font-family: var(--font-text) !important; color: var(--ink); font-weight: 600 !important; letter-spacing: -0.015em !important; }
.a-body h2 { font-size: 26px !important; line-height: 1.3 !important; margin: 1.8em 0 0.5em; }
.a-body h3 { font-size: 22px !important; line-height: 1.35 !important; margin: 1.7em 0 0.45em; }
.a-body ul, .a-body ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.a-body li { margin: 0.35em 0; }
.a-body li::marker { color: #6A6A6A; }
.a-body a { color: inherit; text-decoration: underline; text-decoration-color: #C9C9C9; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.a-body a:hover { text-decoration-color: currentColor; color: var(--ink); }
.a-body strong, .a-body b { color: var(--ink); font-weight: 600; }
.a-body blockquote { margin: 1.6em 0; padding: 2px 0 2px 22px; border-left: 3px solid #FFC342; color: var(--ink); }
.a-body blockquote p { font-size: calc(var(--fs-read) + 2px) !important; margin: 0; }
.a-body figure { margin: 2em 0; }
.a-body figure img { width: 100%; height: auto; display: block; border-radius: var(--r-md); }
.a-body figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-3); text-align: center; }
.a-body table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 1.5em 0; display: block; overflow-x: auto; }
.a-body td, .a-body th { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.a-body hr { border: 0; text-align: center; margin: 2.4em 0; }
.a-body hr::before { content: "· · ·"; letter-spacing: 0.6em; color: #6A6A6A; }

/* Excerpt: fade the last lines, then a clear hand-off to the publisher */
.a-body.is-excerpt { position: relative; }
.a-body.is-excerpt::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff); pointer-events: none; }
.a-continue { margin-top: 8px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-md); background: #F8F7F4; text-align: center; }
.a-continue p { margin: 0; font-size: 15px !important; color: var(--ink-3); }
.a-continue .a-continue-h { font-size: 13px !important; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.a-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 13px 22px; min-height: 44px; border-radius: var(--r-md); background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 600; }
.a-btn:hover { background: #434343; color: #fff; }

/* ---------- footer of the article ---------- */
.a-source { margin-top: 40px; font-size: 14.5px; color: var(--ink-3); }
.a-source-k { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6A6A6A; margin-bottom: 4px; }
.a-source a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #C9C9C9; }
.a-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.a-tag { font-size: 13.5px; font-weight: 500; color: var(--ink); background: #F4F2EE; border-radius: var(--r-sm); padding: 8px 14px; }
a.a-tag:hover { background: #ECECEC; color: var(--ink); }
.a-tag.is-muted { color: var(--ink-3); }

.a-subscribe { margin-top: 44px; padding: 32px; border-radius: var(--r-md); background: #FFF3D3; text-align: center; }
h2.a-sub-h { font-family: var(--font-text) !important; font-size: 22px !important; font-weight: 600 !important; letter-spacing: -0.015em !important; line-height: 1.3 !important; margin: 0; }
.a-subscribe > p { margin: 8px auto 0; max-width: 440px; font-size: 15px !important; color: #5A5A5A; }
.a-sub-form { display: flex; max-width: 420px; margin: 20px auto 0; padding: 4px; border-radius: var(--r-md); border: 1px solid #E3D3A3; background: #fff; }
.a-sub-form:focus-within { border-color: var(--ink); }
.a-sub-form input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font-size: 15px; color: var(--ink); outline: none; }
.a-sub-form button { border: 0; border-radius: var(--r-md); background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; padding: 0 18px; min-height: 44px; cursor: pointer; }
.a-sub-msg { margin: 12px 0 0 !important; font-size: 14px !important; font-weight: 600; }
.a-sub-msg.err { color: #B42318; }

.a-more { margin-top: 48px; padding-bottom: clamp(48px, 6vw, 88px); }
.a-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 6px; }
h2.a-more-h { font-family: var(--font-text) !important; font-size: 18px !important; font-weight: 600 !important; letter-spacing: -0.01em !important; line-height: 1.4 !important; margin: 0; }
.a-more-head a { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.m-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 20px; align-items: start; padding: 20px 0; border-top: 1px solid var(--line); color: var(--ink); }
.m-row:hover .m-title { color: var(--accent-text); }
.m-txt { display: flex; flex-direction: column; gap: 6px; }
.m-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.m-title { font-size: 17px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; transition: color .2s ease; }
.m-meta { font-size: 12.5px; color: var(--ink-3); }
.m-thumb { width: 112px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); display: block; }
@media (max-width: 640px) {
  .a-byline { flex-wrap: wrap; }
  .a-share { margin-left: auto; }
  .a-continue, .a-subscribe { padding: 24px 18px; }
  .m-row { grid-template-columns: minmax(0, 1fr) 84px; gap: 14px; }
  .m-thumb { width: 84px; aspect-ratio: 1; }
  .m-title { font-size: 16px; }
  .a-icon { width: 36px; height: 36px; }
  .a-share { gap: 0; margin-right: -8px; }
  .a-by { flex: 1 1 auto; }
  .post-card .thumb .cover-type { padding: 8px 9px; }
  .post-card .thumb .cover-type .ct-label { font-size: 8px; letter-spacing: 0.06em; }
  .post-card .thumb .cover-type .ct-name { font-size: 13px; line-height: 1.08; }
}

/* ---------- typographic cover (used when no image was archived) ---------- */
.cover-type { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 14px 16px; overflow: hidden; background: #2E2E2E; color: #fff; border-radius: var(--r-md); }
.cover-type::after { content: ""; position: absolute; right: -18%; bottom: -30%; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 1px solid currentColor; opacity: .14; }
.cover-type .ct-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: .7; position: relative; z-index: 1; }
.cover-type .ct-name { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.02; letter-spacing: -0.02em; position: relative; z-index: 1; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.cover-type .ct-name:lang(zh) { font-family: var(--font-zh); font-weight: 700; letter-spacing: 0.04em; }
.cover-type[data-topic="Markets"] { background: #FFC342; color: #2E2E2E; }
.cover-type[data-topic="Product"] { background: #2E2E2E; color: #FFC342; }
.cover-type[data-topic="Case study"] { background: #EAF3F6; color: #0E3B4A; }
.cover-type[data-topic="Partnerships"] { background: #1E2A3A; color: #FFFFFF; }
.cover-type[data-topic="Insight"] { background: #F1EEE6; color: #2E2E2E; }
.cover-type[data-topic="Awards"] { background: #FFF3D3; color: #2E2E2E; }
.m-thumb.cover-type { padding: 8px 10px; }
.m-thumb.cover-type .ct-label { font-size: 8.5px; }
.m-thumb.cover-type .ct-name { font-size: 13px; line-height: 1.08; }

/* ---------- Chinese articles ---------- */
.article:lang(zh) { --fs-read: 18px; --lh-read: 1.95; }
.article:lang(zh) h1.a-title { font-family: var(--font-zh) !important; font-weight: 700 !important; letter-spacing: 0.01em !important; line-height: 1.35 !important; }
.article:lang(zh) .a-body p { letter-spacing: 0.035em; text-align: justify; text-justify: inter-ideograph; }
.article:lang(zh) .a-body h3 { font-family: var(--font-zh) !important; font-weight: 700 !important; letter-spacing: 0.02em !important; }
.article:lang(zh) .a-kicker, .article:lang(zh) .a-continue-h, .article:lang(zh) .a-source-k { text-transform: none; letter-spacing: 0.08em; }
@media (max-width: 640px) { .article:lang(zh) { --fs-read: 17px; } }

/* News cards: the card already shows a topic pill on desktop, so the cover's own label would duplicate it */
@media (min-width: 641px) {
  .post-card .thumb .cover-type .ct-label { display: none; }
  .post-card .thumb .cover-type { justify-content: flex-end; padding: 20px 22px; }
}


/* ---------- English article body: serif for long-form reading (Medium-style: serif text, sans headings) ---------- */
.article:lang(en) {
  --font-read: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --fs-read: 20px; --lh-read: 1.72;
}
.article:lang(en) .a-body { font-family: var(--font-read); color: #434343; font-optical-sizing: auto; font-kerning: normal; hanging-punctuation: first; }
.article:lang(en) .a-body p, .article:lang(en) .a-body li { font-family: var(--font-read); letter-spacing: -0.003em; }
.article:lang(en) .a-body p { margin: 0 0 1.45em; }
.article:lang(en) .a-body li { margin: 0.5em 0; }
.article:lang(en) .a-body strong, .article:lang(en) .a-body b { font-weight: 600; color: #2E2E2E; }
.article:lang(en) .a-body em, .article:lang(en) .a-body i { font-style: italic; }
.article:lang(en) .a-body blockquote p { font-family: var(--font-read); font-style: italic; font-size: 22px !important; line-height: 1.6 !important; }
/* sub-headings stay sans and get a little more air above */
.article:lang(en) .a-body h2 { margin-top: 2em; }
.article:lang(en) .a-body h3 { font-size: 23px !important; margin: 1.9em 0 0.5em; }
.article:lang(en) .a-body h2 + p, .article:lang(en) .a-body h3 + p { margin-top: 0; }
/* first paragraph a touch larger, as a lead */
.article:lang(en) .a-body > p:first-child { font-size: 21px !important; }
@media (max-width: 640px) {
  .article:lang(en) { --fs-read: 17.5px; --lh-read: 1.68; }
  .article:lang(en) .a-body > p:first-child { font-size: 18.5px !important; }
  .article:lang(en) .a-body h3 { font-size: 20px !important; }
  .article:lang(en) .a-body blockquote p { font-size: 19.5px !important; }
}

/* licensed reprints: credit the publisher right under the title */
.a-repub { margin: 14px 0 0 !important; font-size: 14px !important; line-height: 1.5 !important; color: #5A5A5A; }
.a-repub a { color: #2E2E2E; font-weight: 600; text-decoration: underline; text-decoration-color: #CFCDC8; text-underline-offset: 3px; }
.a-repub a:hover { text-decoration-color: currentColor; color: #2E2E2E; }

/* named author byline */
.a-avatar.is-photo { overflow: hidden; background: #E9E7E2; }
.a-avatar.is-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.a-role { font-weight: 400; color: #5A5A5A; }
