/* BP Business Organization Badge CSS */

/* Base styles for the badge container */
.bp-business-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 */
    width: 24px; /* Default size for badges */
    height: 24px;
    position: relative; /* Allows for fine-tuning vertical alignment */
    top: -2px; /* Adjust this value as needed for vertical alignment */
}

.bp-business-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 Single Business Profile Header (bp-business-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 single profile header */
.bp-business-org-badge-profile {
    width: 30px; /* Larger size for single profile header */
    height: 30px;
    top: -4px; /* Adjust this value (negative moves up, positive moves down) */
}

/* --- Styles for Archive/Listing Titles (bp-business-org-badge-archive) --- */
/* These will be applied when the badge is added via the 'the_title' filter */
.bp-business-org-badge-archive {
    width: 20px; /* Slightly smaller size for archive listings */
    height: 20px;
    top: -1px; /* Adjust as needed for archive context */
}

/* Ensure other badges (like host badge) don't create extra unwanted margins */
/* You might need to add specific rules here based on your theme's other badge styles */
/* For example, if .bp-host-badge has a default margin-left, you might need to override it */
.bp-host-badge {
    margin-right: 0 !important; /* Let the parent's gap handle spacing */
    vertical-align: middle;
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 782px) {
    /* Adjust profile header badge size for smaller screens */
    .bp-business-org-badge-profile {
        width: 26px; /* Smaller on mobile */
        height: 26px;
        top: -2px; /* Slight adjustment for mobile vertical alignment */
    }

    /* Adjust archive badge size for mobile */
    .bp-business-org-badge-archive {
        width: 18px; /* Even smaller for activity/archive on mobile */
        height: 18px;
        top: 0px; /* Adjust as needed */
    }

    /* Adjust gap for flex containers on smaller screens */
    h2.user-nicename,
    .activity-list .activity-avatar .activity-author a, /* Assuming activity author is also a flex container */
    .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) {
    .bp-business-org-badge-profile {
        width: 24px;
        height: 24px;
        top: -1px;
    }
    .bp-business-org-badge-archive {
        width: 16px;
        height: 16px;
        top: 0px;
    }
}