/* ===========================================================
   ultrase BASE
   - Keeps widgets stable when placed inside lists or inline text
   =========================================================== */

/* Normalize widget wrapper behavior */
[data-ulse-widget] {
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Unified width across styles (except stick/papyrus) */
[data-ulse-widget]:not(.ulse-stick):not(.ulse-papyrus1):not(.ulse-papyrus2):not(.ulse-papyrus3):not(.ulse-papyrus4):not(.ulse-papyrus5):not(.ulse-papyrus6):not(.ulse-papyrus7):not(.ulse-papyrus8):not(.ulse-soccer1):not(.ulse-soccer2):not(.ulse-soccer3):not(.ulse-book1):not(.ulse-book2):not(.ulse-book3) {
    width: auto;
    max-width: none;
}

/* If a widget is dropped inside a list item, keep it full-width and trim excess spacing */
li > [data-ulse-widget],
li > p > [data-ulse-widget] {
    display: block;
    width: 100%;
    margin: 0.35em 0 0.75em;
}

/* Clean list appearance when a whole widget sits as an li item */
li.ulse-widget-item {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

li.ulse-widget-item > [data-ulse-widget] {
    margin: 0.4em 0 0.8em;
}

/* Remove stray top/bottom gaps inside the widget body */
[data-ulse-widget] article {
    margin: 0;
}

[data-ulse-widget] p:first-child {
    margin-top: 0;
}

[data-ulse-widget] p:last-child {
    margin-bottom: 0;
}

/* Prevent long URLs from breaking layout across all styles */
[data-ulse-widget] a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Safe default for images inside widgets */
[data-ulse-widget] img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px auto;
    border-radius: inherit;
}


