/* Zora Organization Badge CSS - Mobile & Activity Page Support */

/* Base styles for the badge */
.zora-org-badge {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    box-sizing: border-box;
    flex-shrink: 0; /* Important if parent is flex, prevents shrinking */
    flex-grow: 0;   /* Important if parent is flex, prevents growing */
    margin-left: 5px; /* Default spacing for all badges */
}

.zora-org-badge img {
    width: 100%;
    height: 100%; /* Make image fill the container */
    object-fit: cover; /* Ensures image covers the area without distortion */
    display: block; /* Remove extra space below image */
    border-radius: 50%; /* Keep it circular */
    border: 1px solid #ddd; /* Subtle border */
    box-shadow: 0 0 3px rgba(0,0,0,0.1); /* Subtle shadow */
}

/* --- Styles for the Main Profile Header (zora-org-badge-profile) --- */

/* Parent h2.user-nicename needs inline-flex for better alignment with username and other badges */
h2.user-nicename {
    display: inline-flex; /* Use inline-flex to nicely align internal elements */
    align-items: center; /* Vertically align all items within the h2 */
    gap: 3px; /* Small gap between items */
    flex-wrap: wrap; /* Allow wrapping on very small screens */
    /* Ensure no fixed width or overflow: hidden that would clip content */
    overflow: visible;
}

/* Specific styling for the badge in the profile header */
.zora-org-badge-profile {
    width: 30px; /* Desired size for profile header */
    height: 30px;
    position: relative; /* Keep relative to fine-tune vertical alignment without absolute positioning */
    top: -4px; /* Adjust this value (negative moves up, positive moves down) */
}

/* Adjust the existing bp-host-badge if it has its own margin */
.bp-host-badge {
    margin-right: 0 !important; /* Let the parent's gap handle spacing */
    vertical-align: middle;
}

/* --- Styles for Activity Stream Entries (zora-org-badge-activity) --- */

/* The activity author's name in the activity loop is often wrapped in a strong tag or link */
/* We need to target the badge *after* the author name */
.activity-list .activity-avatar .activity-author a,
.activity-list .activity-avatar .activity-author strong {
    display: inline-flex; /* Make the author name container flex to align badge */
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
    overflow: visible;
}

.zora-org-badge-activity {
    width: 24px; /* Slightly smaller size for activity feed */
    height: 24px;
    position: relative;
    top: 0px; /* Adjust for activity stream context, often needs less vertical adjustment */
    /* margin-left is handled by the parent's gap */
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 782px) {
    /* Adjust profile header badge size for smaller screens */
    .zora-org-badge-profile {
        width: 26px; /* Smaller on mobile */
        height: 26px;
        top: -2px; /* Slight adjustment for mobile vertical alignment */
        /* You may need to fine-tune 'top' for mobile independently in dev tools */
    }

    /* Adjust activity stream badge size for mobile */
    .zora-org-badge-activity {
        width: 20px; /* Even smaller for activity on mobile */
        height: 20px;
        top: 0px; /* Adjust as needed */
    }

    /* Ensure flex container properties on h2.user-nicename and activity author links */
    h2.user-nicename,
    .activity-list .activity-avatar .activity-author a,
    .activity-list .activity-avatar .activity-author strong {
        gap: 2px; /* Reduce gap on mobile if desired */
    }
}

/* Further smaller mobile screens, e.g., typically phone portrait */
@media screen and (max-width: 480px) {
    .zora-org-badge-profile {
        width: 24px;
        height: 24px;
        top: -1px;
    }
    .zora-org-badge-activity {
        width: 18px;
        height: 18px;
        top: 0px;
    }
}