/* A registry's badge (#15): the registry's own logo when it has let us show it,
   else its initials, and the registry's name on hover and on a tap (the badge
   takes focus). One stylesheet for every surface: the app imports it
   (apps/equidetails_web/src/main.tsx), EquiSocial and EquiMarket link
   /shell-kit/badge.css from their base.html. The markup is the Jinja macro in
   jinja/_registry_badge.html and its React twin,
   apps/equidetails_web/src/components/horse/RegistryBadge.tsx. */
.eqd-rbadge {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--eqd-rbadge-size, 24px);
  height: var(--eqd-rbadge-size, 24px);
  vertical-align: middle;
  outline: none;
  cursor: default;
}
.eqd-rbadge > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20%;
}
.eqd-rbadge > span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0 2px;
  overflow: hidden;
  border-radius: 20%;
  border: 1px solid var(--eqd-line, #ded7c9);
  background: var(--eqd-surface-soft, #fcfaf4);
  color: var(--eqd-muted, #5c6672);
  /* --eqd-rbadge-font: set per badge from the length of the initials (TB is roomier than TWHBEA). */
  font: 600 var(--eqd-rbadge-font, calc(var(--eqd-rbadge-size, 24px) * 0.3)) / 1.05 var(--eqd-font-sans, Inter, system-ui, sans-serif);
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}
/* The name, below the badge, while the pointer is on it or it has focus. */
.eqd-rbadge::after {
  content: attr(data-name);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 30;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--eqd-ink, #16202a);
  color: var(--eqd-ground, #f7f3ea);
  font: 500 12px / 1.2 var(--eqd-font-sans, Inter, system-ui, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.eqd-rbadge:hover::after,
.eqd-rbadge:focus::after {
  opacity: 1;
}
.eqd-rbadge:focus-visible > img,
.eqd-rbadge:focus-visible > span {
  box-shadow: 0 0 0 2px var(--eqd-focus-ring, rgba(183, 138, 67, 0.5));
}
