/* Research kit citations (.rk-cite, .rk-ext-icon, prose favicons). Lane C. */

/*
 * Prose external link composition order (fixed):
 *   [favicon] [link text] [ext glyph]  + trailing  [cite N]
 * Cite lives outside the <a> as <sup class="rk-cite"> to avoid nested interactive content.
 * External only (no favicon on internal #… or chaoslabs hosts).
 */

/* Inline citation superscript */
.research-article sup.rk-cite { line-height: 0; white-space: nowrap; }
.research-article sup.rk-cite a {
  font-family: var(--font-mono);
  font-size: 0.62em;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  padding: 0 0.15em 0 0.25em;
  vertical-align: super;
}
.research-article sup.rk-cite a:hover { text-decoration: underline; }

/* External-link glyph on ANY inline link (source rows override with absolute 12px). */
.research-article a .rk-ext-icon {
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.16em;
  vertical-align: baseline;
  color: var(--color-text-faint);
  display: inline-block;
  flex: none;
}
.research-article a:hover .rk-ext-icon { color: var(--color-accent); }
/* Hero byline already carries a textual ↗, don't double it. */
.research-article .byline a .rk-ext-icon { display: none; }

/* Prose external link: leading local favicon chip */
.research-article a.rk-prose-link {
  text-decoration: none;
  color: inherit;
}
.research-article a.rk-prose-link:hover .rk-prose-link-text {
  color: var(--color-accent);
  text-decoration: underline;
}
.research-article a.rk-prose-link .rk-prose-link-text {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* Inline cite favicon: same plate rules as list chips, smaller. */
.research-article .rk-cite-favicon {
  width: 0.9em;
  height: 0.9em;
  min-width: 14px;
  min-height: 14px;
  border-radius: 2px;
  object-fit: contain;
  display: inline-block;
  vertical-align: -0.12em;
  margin-right: 0.28em;
  box-sizing: border-box;
  padding: 1px;
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-border-soft);
}
.research-article .rk-cite-favicon[data-plate="light"] {
  background: #fff;
}
@media (prefers-color-scheme: light) {
  .research-article .rk-cite-favicon[data-plate="light"] {
    background: var(--color-surface);
  }
}

/* Do not double-favicon source list titles (list already has leading chip). */
.research-article .rk-src-title .rk-cite-favicon,
.research-article .rk-src-link .rk-cite-favicon {
  display: none;
}

/* Footer / site chrome (shared with kit shell; keep with cite for cascade order). */
.research-article footer.site {
  border-top: 1px solid var(--color-border-soft);
  background: var(--color-bg);
  padding-block: var(--space-16);
}
.research-article .foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  align-items: flex-end;
}
.research-article .foot-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  max-width: 52ch;
  line-height: 1.7;
  font-family: var(--font-mono);
}
.research-article .foot-links { display: flex; gap: var(--space-5); }
.research-article .foot-links a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-decoration: none;
}
.research-article .foot-links a:hover { color: var(--color-accent); }
