/* Fix for overlapping bubble/pill text on sitemap page */

/* Main pages bubble links container */
.wp-block-group:has(> p > a[class*="wp-element-button"]) {
    flex-wrap: wrap;
}

/* Sitemap page bubble/pill links styling */
.wp-element-button,
[class*="button"],
a[role="button"] {
    /* Ensure proper spacing */
    min-height: 44px;
    padding: 8px 16px !important;
    white-space: normal !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 4px;
}

/* Prevent text overlap on sitemap */
.sitemap,
[data-type*="sitemap"],
[class*="sitemap"] {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Flex container for bubble links */
p > a[class*="button"],
.wp-block-group > p > a {
    display: inline-block;
    max-width: 200px;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
}

/* Alternative: stretch bubbles to prevent wrapping */
@media (min-width: 768px) {
    .wp-element-button,
    a[class*="wp-element-button"] {
        min-width: 120px;
    }
}
