/* Entity chips in wiki prose. Colours match the graph legend. Calm by design:
   type-coloured label inside a faint type-coloured outline that strengthens on
   hover, a small trailing type emoji, no bullet dot, never underlined.
   Renderer: build-time rustkyll `chips` extension.

   NOTE: the theme colours/underlines prose links via `.knowledge-page p a`
   (specificity 0,1,2) and `.knowledge-page p a:hover` (0,2,2). The doubled
   `.chip.chip` selectors below out-rank those so chips keep their type colour
   and never underline. */

.chip {
  --chip: #64748b;
  display: inline;
  font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--chip) 12%, transparent);
  border-radius: 0.4em;
  padding: 0.02em 0.3em;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* type colour for text + never underline, in every state
   (doubled class out-ranks the theme's prose-link rules) */
.chip.chip,
.chip.chip:hover,
.chip.chip:focus,
.chip.chip:active {
  color: var(--chip);
  text-decoration: none;
}

.chip.chip:hover,
.chip.chip:focus {
  border-color: color-mix(in srgb, var(--chip) 60%, transparent);
  background: color-mix(in srgb, var(--chip) 9%, transparent);
}

/* trailing type emoji — makes the entity kind obvious at a glance.
   wiki (the vast majority) stays calm with no emoji. */
.chip::after {
  margin-left: 0.22em;
  font-size: 0.8em;
  opacity: 0.55;
  vertical-align: 0.02em;
}
.chip--podcast::after { content: "\1F399\FE0F"; } /* studio microphone */
.chip--person::after  { content: "\1F464"; }      /* bust in silhouette */
.chip--book::after    { content: "\1F4D6"; }      /* open book */

/* podcast timestamp badge — sits after the emoji */
.chip .chip-time {
  margin-left: 0.3em;
  color: var(--chip);
  font-weight: 700;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.chip .chip-time::before {
  content: "\00B7 ";
  opacity: 0.55;
}

/* per-type accent (matches graph node colours) */
.chip--wiki { --chip: #2c573e; }
.chip--podcast { --chip: #b26a04; }
.chip--person { --chip: #7c3aed; }
.chip--book { --chip: #2563eb; }

html.dark .chip--wiki { --chip: #8ed8ad; }
html.dark .chip--podcast { --chip: #e0a34b; }
html.dark .chip--person { --chip: #c4a2f5; }
html.dark .chip--book { --chip: #7fb0ff; }
