/* ============================================================
   Campaign badge — a small pin on the avatar of a user running a
   live campaign. Added by campaign-badge.js to any avatar carrying
   [data-story-user]; sits outside the story ring when both apply.
   ============================================================ */

/* ── Avatar badge corners (site-wide convention) ──
   Each badge owns one fixed corner so they can never stack on top of each other:
     bottom-right : .avatar-badge   (profile emoji — avatar-badge.css)
     top-right    : .pp-bday-badge  (birthday — Profile.cshtml)
     bottom-left  : .pp-share-dot   (share — Profile.cshtml)
     top-left     : .campaign-badge (this file)
   PHYSICAL left/top on purpose: the neighbours use physical properties, and the
   site is RTL, so a logical `inset-inline-start` here resolves to the right edge
   and lands straight on the profile emoji badge. */
.campaign-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    z-index: 4;

    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    height: 40%;
    /* Clamp so the badge stays legible on a 30px list avatar and doesn't
       swallow a 104px profile one. */
    min-width: 16px;
    min-height: 16px;
    max-width: 30px;
    max-height: 30px;

    border-radius: 50%;
    border: 2px solid #fff;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);

    font-size: .62rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;

    /* No fill-mode: the badge's resting state must be the visible one. With
       `both` it holds the 0%-keyframe (scale(0)/opacity:0) whenever the animation
       doesn't actually run — a throttled or backgrounded tab leaves the badge
       permanently invisible even though it is laid out at full size. */
    animation: campaignBadgePop .35s cubic-bezier(.34, 1.56, .64, 1);
}

.campaign-badge:hover {
    transform: scale(1.12);
    text-decoration: none;
}

@keyframes campaignBadgePop {
    from { transform: scale(0); opacity: 0 }
    to   { transform: scale(1); opacity: 1 }
}

@media (prefers-reduced-motion: reduce) {
    .campaign-badge { animation: none }
}
