.woolly-cloud {
    position: relative;
    text-align: center;
    padding: 2em 3em;
    line-height: 2.4;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    margin-left: auto;
    margin-right: auto;
}

.woolly-cloud__svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.woolly-cloud__svg svg {
    width: 100%;
    height: 100%;
}

.woolly-cloud__row {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

.woolly-cloud__term {
    display: inline-block;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.4;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.woolly-cloud__term:hover {
    transform: scale(1.3);
}

/* =========================================================================
   Hover reflow (opt-in via shortcode arg hover_reflow="1").
   Replaces the visual-only transform: scale with a real font-size growth so
   neighbouring words shift to make room. Em-based margins on terms scale
   automatically with font-size, so spacing stays proportional.
   ========================================================================= */

.woolly-cloud--reflow .woolly-cloud__term {
    transition: font-size 0.2s ease;
}

.woolly-cloud--reflow .woolly-cloud__term:hover {
    transform: none;
    font-size: calc(var(--woolly-size) * 1.3) !important;
}

/* =========================================================================
   Underline modifiers — !important to defeat theme-supplied underlines.
   The cloud container always carries one of these two classes.

   Themes draw "underlines" in a surprising number of ways: text-decoration,
   border-bottom, box-shadow with a vertical offset, linear-gradient
   backgrounds, and ::after pseudo-elements. The no-underline ruleset blocks
   all of them so we don't have to identify which one a given theme uses.
   ========================================================================= */

.woolly-cloud--no-underline .woolly-cloud__term,
.woolly-cloud--no-underline .woolly-cloud__term:link,
.woolly-cloud--no-underline .woolly-cloud__term:visited,
.woolly-cloud--no-underline .woolly-cloud__term:hover,
.woolly-cloud--no-underline .woolly-cloud__term:focus,
.woolly-cloud--no-underline .woolly-cloud__term:active {
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}

.woolly-cloud--no-underline .woolly-cloud__term::before,
.woolly-cloud--no-underline .woolly-cloud__term::after,
.woolly-cloud--no-underline .woolly-cloud__term:hover::before,
.woolly-cloud--no-underline .woolly-cloud__term:hover::after {
    display: none !important;
    content: none !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

.woolly-cloud--underlined .woolly-cloud__term,
.woolly-cloud--underlined .woolly-cloud__term:hover {
    text-decoration: underline !important;
}

@media (max-width: 768px) {
    .woolly-cloud {
        padding: 1.5em 0.5em;
        line-height: 2;
        overflow: hidden;
    }

    .woolly-cloud__row {
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    .woolly-cloud {
        padding: 1em 0.5em;
        line-height: 1.8;
    }
}
