/**
 * Riftmana User Badges
 *
 * Styles for badges rendered by riftmana_render_user_badges() — see
 * inc/user-badges.php for the registry, helper, and enqueue logic.
 *
 * To add a new badge color: append a `.rm-user-badge.rm-badge-<id>` rule
 * below the Creator block. Match the badge's `id` from the registry.
 */

.rm-user-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    vertical-align: middle;   /* aligns badge with x-height in inline contexts */
    align-self: center;       /* centers vertically when parent is a flex row */
    flex-shrink: 0;
    line-height: 1;
}

/* Sizes — surface sm in dense lists (comments), md for byline/listing rows,
   lg for big page headers like the UM profile h1. */
.rm-user-badge.rm-badge-sm { width: 16px; height: 16px; }
.rm-user-badge.rm-badge-sm svg { width: 11px; height: 11px; }
.rm-user-badge.rm-badge-md { width: 20px; height: 20px; }
.rm-user-badge.rm-badge-md svg { width: 13px; height: 13px; }
.rm-user-badge.rm-badge-lg { width: 26px; height: 26px; }
.rm-user-badge.rm-badge-lg svg { width: 16px; height: 16px; }

/* Creator — emerald circle checkmark */
.rm-user-badge.rm-badge-creator { background: #34d399; }

/* ── Hover tooltip (replaces native title="..."). ─────────────────────── */
.rm-user-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    background: #0f0f10;
    color: #fff;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 9px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.rm-user-badge::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-top-color: #0f0f10;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 100;
}

.rm-user-badge:hover::after,
.rm-user-badge:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.rm-user-badge:hover::before,
.rm-user-badge:focus-visible::before {
    opacity: 1;
}
