/* Ensure each <figure> can hold absolutely-positioned badges */
.kgb-badged-gallery figure {
  position: relative;
}

/* Badge overlay wrapper: flex for true content‑based reflow */
.kgb-gallery-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;          /* wrap only when no more room */
  gap: 4px;                 /* fallback spacing—inline gap override still applies */
  align-content: flex-start;/* keep wrapped rows packed at top */
  z-index: 10;
}

/* Optional: tighter gaps on very small phones */
@media (max-width: 480px) {
  .kgb-gallery-badges {
    gap: 2px;
  }
}

/* Badge wrapper: width comes from content, not container */
.kgb-gallery-badge {
  display: inline-flex;     /* shrink‑to‑fit content */
  align-items: center;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;      /* keep icon + text on one line */
  /* background, color, padding, border-radius, etc. all set inline */
}

/* Icon inside badge */
.kgb-badge-emoji {
  display: inline-block;
  vertical-align: middle;
  /* size, margin, fill/color set inline */
}
