/* tatjliebt.de – Wuff-Einwürfe. Farben dürfen vom Theme geerbt werden. */

/* Der Marker fügt dem Textfluss keine zusätzliche Höhe hinzu. */
.wp-block-post-content .tatj-wuff-anchor,
.entry-content .tatj-wuff-anchor {
    display: inline-block;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

/* Shortcode-Block ohne Leeraum: nur Wrapper mit Wuff-Marker. */
.wp-block-post-content .wp-block-shortcode:has(> .tatj-wuff-anchor),
.entry-content .wp-block-shortcode:has(> .tatj-wuff-anchor),
.wp-block-post-content p:has(> .tatj-wuff-anchor:only-child),
.entry-content p:has(> .tatj-wuff-anchor:only-child) {
    height: 0;
    min-height: 0;
    line-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.tatj-wuff-article {
    position: relative;
    overflow: visible;
}

.tatj-wuff-layer {
    position: absolute;
    inset: 0 0 auto;
    height: 0;
    z-index: 25;
    pointer-events: none;
    overflow: visible;
}

.tatj-wuff {
    position: absolute;
    pointer-events: auto;
    line-height: 1;
}

.tatj-wuff.is-left { left: -34px; }
.tatj-wuff.is-right { right: -34px; }

.tatj-wuff-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 3px;
    background: transparent !important;
    color: inherit !important;
    border: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    opacity: .65;
    transition: opacity .2s ease, transform .2s ease;
}
.tatj-wuff-trigger:hover,
.tatj-wuff-trigger:focus-visible {
    opacity: 1;
    transform: rotate(-12deg);
}
.tatj-wuff-trigger:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 2px;
}

.tatj-wuff-bubble {
    position: absolute;
    top: -12px;
    width: 270px;
    max-width: min(270px, calc(100vw - 36px));
    box-sizing: border-box;
    padding: 20px 22px;
    color: #222;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 8px 25px rgba(0,0,0,.12);
    text-align: left;
    line-height: 1.5;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 30;
}

/* Sprechblasen öffnen sich jeweils Richtung Beitrag. */
.tatj-wuff.is-left .tatj-wuff-bubble { left: calc(100% + 8px); }
.tatj-wuff.is-right .tatj-wuff-bubble { right: calc(100% + 8px); }

.tatj-wuff-bubble strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}
.tatj-wuff-message {
    display: block;
    font-size: .8rem;
    line-height: 1.6;
}

.tatj-wuff:hover .tatj-wuff-bubble,
.tatj-wuff:focus-within .tatj-wuff-bubble,
.tatj-wuff.is-open .tatj-wuff-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .tatj-wuff.is-left { left: 0; }
    .tatj-wuff.is-right { right: 0; }
    .tatj-wuff-bubble { width: 230px; padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .tatj-wuff-trigger,
    .tatj-wuff-bubble { transition: none; }
}
