/* Cabinhub News — the trust layer's two blocks (js/trust.js).

   Design brief in one sentence: the page's facts about its own making should
   read like the imprint of a printed paper — set small, ruled off, at the end,
   never competing with the story.

   So: no card, no fill, no shadow, no accent colour; one hairline above the
   block, the token type ramp, and the aside's caption treatment reused (the
   reader has already learned that caption voice under "Market data"). The
   byline sits directly under the deck as one quiet line in --ink-soft, the
   disclosure mark in the same line at label size, and the explanatory note
   below it at meta size. The provenance block closes the article at the same
   measure as the body so it reads as part of the sheet, not as a footer.

   Every value is a token; the only literal is the hairline width. CJK is
   tracked to zero by cjk.css already for .panel__label, and the two new caption
   classes follow the same rule at the bottom of this file. */

/* The credit below the head, once only.
   feed.css has always generated a credit under the article head with
   `.detail__head::after { content: "By Ember · AI-generated content" }`, because
   app.js emitted no byline element. The trust layer now emits a real one, so
   that generated caption would print a second, generic credit under the real
   one — same words, different facts (the real byline carries the item's own
   author and ai_label). Suppress it only when the real byline is present, so a
   page where js/trust.js did not run keeps the statutory notice: never missing,
   never printed twice. This rule lives here, in the trust layer's own file,
   rather than editing feed.css; it loads after it and out-specifies it.

   Two rules, not one: feed.css emits the caption in English AND in a
   `html[lang="zh-Hans"]` variant with one more class of specificity, so a bare
   `.detail__head:has(...)` suppression would leave the Chinese caption printing
   under the real Chinese byline. */
.detail__head:has(+ .trust-byline)::after { content: none; }
html[lang="zh-Hans"] .detail__head:has(+ .trust-byline)::after { content: none; }

/* ------------------------------------------------------------- byline ---
   `margin` only, never a border: this line must not read as a new section. */
.trust-byline {
  margin: 0.9rem 0 0;
  max-width: var(--measure);
}
/* The credit continues the masthead rather than floating between two blocks:
   with the head's bottom margin collapsed, the reader sees one block — kicker,
   headline, deck, rule, credit — not a gap that reads as a section break. */
.detail__head:has(+ .trust-byline) { margin-bottom: 0; }
.trust-byline__line {
  font-family: var(--font-ui);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.trust-byline__author { font-weight: 600; }
/* The disclosure mark: a hairline chip, not a badge. It is a notice required by
   the AI-content Measures, so it must be legible, but it must not draw the eye
   away from the story; --rule-strong is the one border weight that survives a
   phone screen in both themes. */
.trust-byline__mark {
  font-size: var(--fs-micro);
  line-height: 1.3;
  color: var(--ink-faint);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-xs);
  padding: 0.05rem 0.32rem;
  white-space: nowrap;
}
.trust-byline__note {
  margin-top: 0.35rem;
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  line-height: 1.55;
  color: var(--ink-faint);
  text-wrap: pretty;
}

/* --------------------------------------------------------- provenance ---
   The imprint. It closes the article: one hairline, a caption, a lede, and a
   two-column fact list that collapses to stacked rows under 34rem. */
.provenance {
  margin-top: var(--sp-6);
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
.provenance__title {
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-faint);
  margin-bottom: 0.55rem;
}
.provenance__lede {
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.provenance__link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.15em;
  /* A citation link lives inside a sentence, so it cannot be 44px tall without
     breaking the line — but vertical padding on an inline box enlarges the
     hit area without moving the text. Measured by the route gate at 186x15
     before this; 0.4rem a side takes it past the 24px target minimum while the
     sentence keeps its line height (WCAG 2.5.8 inline exception). */
  padding-block: 0.4rem;
}
.provenance__link:hover { text-decoration-color: var(--accent); }
.provenance__name { color: var(--ink); }

.provenance__facts {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.2rem;
}
.provenance__fact {
  display: grid;
  grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
  gap: 0.25rem 0.9rem;
  align-items: baseline;
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  line-height: 1.5;
  padding: 0.18rem 0;
}
.provenance__key {
  color: var(--ink-faint);
  letter-spacing: 0;
}
.provenance__val {
  margin: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.provenance__still { color: var(--ink-soft); }
.provenance__count { color: var(--ink-soft); }

/* A phone gets stacked rows: an 8.5rem label column on a 390px screen leaves
   too little for the value, and the value carries the dates. */
@media (max-width: 34rem) {
  .provenance__fact { grid-template-columns: 1fr; gap: 0 0; }
}

/* CJK runs wide: the caption and the labels drop their tracking, the same rule
   cjk.css applies to .panel__label and .section-label. */
html[lang="zh-Hans"] .provenance__title,
html[lang="zh-Hans"] .provenance__key { letter-spacing: 0; }

/* Dark theme needs no override: every value above is a token that tokens.css
   already re-maps, and --rule-strong stays visible on --paper #15110E. */

.trust-actions {display:flex;flex-wrap:wrap;gap:.45rem;align-items:center}
.trust-byline .trust-actions {margin-top:.55rem}
.trust-action,.trust-evidence-marker {
  display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:.35rem .66rem;
  font:600 .82rem/1.25 var(--font-ui);border:1px solid var(--rule);border-radius:3px;
  background:var(--paper);color:var(--ink);cursor:pointer
}
.trust-evidence-marker {font-size:var(--fs-micro);vertical-align:middle;min-height:30px;color:var(--accent);border-color:currentColor}
.trust-action:disabled {opacity:.45;cursor:default}
.trust-action:focus-visible,.trust-evidence-marker:focus-visible {outline:2px solid currentColor;outline-offset:3px}
.trust-about,.timeline .trust-return {display:inline-flex;margin-top:.7rem}
.evidence-drawer {
  position:fixed;inset:0 0 0 auto;width:min(100%,34rem);max-width:100vw;height:100%;
  max-height:100dvh;margin:0;padding:clamp(1.25rem,3.5vw,2.5rem);border:0;
  border-inline-start:1px solid var(--rule);box-shadow:-8px 0 45px #241e171e;
  background:var(--paper);color:var(--ink);overflow-y:auto;overscroll-behavior:contain
}
.evidence-drawer::backdrop {background:rgba(28,25,22,.32)}
.evidence-drawer__bar {display:flex;align-items:center;justify-content:space-between;gap:1rem;border-bottom:1px solid var(--rule);padding-bottom:.75rem}
.evidence-drawer__bar h2 {font:700 clamp(1.6rem,3vw,2.35rem)/1.05 var(--font-display);margin:0}
.evidence-drawer .evidence-drawer__headline {font:500 1.04rem/1.4 var(--font-display);color:var(--ink-soft);margin:.75rem 0 1.85rem}
.evidence-drawer__label,.evidence-drawer__time {font:600 .79rem/1.45 var(--font-ui);color:var(--ink-soft)}
.evidence-drawer__claim {font:600 clamp(1.35rem,2.4vw,1.8rem)/1.18 var(--font-display);margin:.35rem 0 1.65rem}
.evidence-drawer blockquote {font:400 1.16rem/1.48 var(--font-display);border-inline-start:3px solid var(--accent);padding:.4rem 0 .4rem 1rem;margin:.5rem 0 1.25rem}
.evidence-drawer__publisher {display:block;font:600 .96rem/1.4 var(--font-ui)}
.evidence-drawer__time {margin:.2rem 0 .75rem;font-weight:400}
.evidence-drawer>.trust-actions {border-top:1px solid var(--rule);padding-top:1rem;margin:1.5rem 0}
@media(max-width:620px) {
  .evidence-drawer {inset:auto 0 0;width:100%;height:auto;max-height:92dvh;border-inline:0;border-top:2px solid var(--accent);padding-bottom:max(1.4rem,env(safe-area-inset-bottom))}
  .evidence-drawer .evidence-drawer__headline {margin-bottom:1rem}
}
@media(pointer:coarse){.trust-action,.trust-evidence-marker {min-height:44px}}
