/* Generic Components */

/* Scroll to Top Button */
#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: var(--weyel-color-white);
    color: var(--weyel-color-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--weyel-shadow-mega);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#scroll-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scroll-to-top:hover {
    background: var(--weyel-color-blue);
    color: var(--weyel-color-white);
    box-shadow: 0 15px 40px rgba(7, 104, 177, 0.4);
    transform: translateY(-5px);
}

#scroll-to-top svg:not(.scroll-progress-circle svg) {
    position: relative;
    z-index: 2;
    transition: transform var(--weyel-transition-base);
}

#scroll-to-top:hover svg:not(.scroll-progress-circle svg) {
    transform: translateY(-3px);
}

.scroll-progress-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.scroll-progress-circle svg {
    display: block;
    width: 100%;
    height: 100%;
}

.scroll-progress-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.05);
    stroke-width: 4;
}

.scroll-progress-bar {
    fill: none;
    stroke: var(--weyel-color-green);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

/* ==========================================================================
   Gutenberg Button Block
   ========================================================================== */

/* Button Container (Flex Layout) */
.wp-block-buttons {
    display: flex;
    gap: var(--weyel-space-3);
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: var(--weyel-space-5);
}

/* Horizontal Alignments */
.wp-block-buttons.is-content-justification-center {
    justify-content: center;
}

.wp-block-buttons.is-content-justification-right {
    justify-content: flex-end;
}

.wp-block-buttons.is-content-justification-space-between {
    justify-content: space-between;
}

/* Vertical Stacking for small screens */
@media screen and (max-width: 575px) {
    .wp-block-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Single Button Wrapper */
.wp-block-button {
    margin: 0;
}

/* Button Link Styling */
.wp-block-button__link {
    display: inline-block;
    padding: var(--weyel-space-3) var(--weyel-space-6);
    font-size: var(--weyel-font-size-md-plus);
    font-weight: 600;
    font-family: var(--weyel-font-family-base);
    text-decoration: none;
    border-radius: var(--weyel-radius-md);
    transition: all var(--weyel-transition-base);
    cursor: pointer;
    border: none;
    background-color: var(--weyel-color-blue);
    color: var(--weyel-color-white);
    text-align: center;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus {
    background-color: var(--weyel-color-green);
    color: var(--weyel-color-white);
    transform: translateY(-2px);
    box-shadow: var(--weyel-shadow-medium);
}

/* Button Alignment Modifiers within the Link */
.wp-block-button__link.has-text-align-left { text-align: left; }
.wp-block-button__link.has-text-align-center { text-align: center; }
.wp-block-button__link.has-text-align-right { text-align: right; }

/* Gutenberg Color Palette Overrides (if needed) */
.has-blue-background-color { background-color: var(--weyel-color-blue) !important; }
.has-green-background-color { background-color: var(--weyel-color-green) !important; }
.has-red-background-color { background-color: var(--weyel-color-red) !important; }
.has-white-color { color: var(--weyel-color-white) !important; }

.wp-block-custom-icon-text{margin: 20px 0px;} 

/* Newsletter-Modal - das Brevo-Formular wird erst beim Klick nachgeladen */
.newsletter-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--weyel-space-4);
}

.newsletter-modal[hidden] {
    display: none;
}

.newsletter-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--weyel-color-black-alpha-50);
}

.newsletter-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 34px var(--weyel-space-3) var(--weyel-space-3); /* oben Platz für den Schließen-Button */
    background: #eff2f7;
    border-radius: var(--weyel-radius-lg);
    box-shadow: var(--weyel-shadow-mega);
}

.newsletter-modal__close {
    position: absolute;
    top: 4px;
    right: 10px;
    padding: 0 6px;
    border: 0;
    background: transparent;
    font-size: var(--weyel-font-size-2xl);
    line-height: 1;
    color: var(--weyel-color-text-subtle);
    cursor: pointer;
    transition: color var(--weyel-transition-fast);
}

.newsletter-modal__close:hover,
.newsletter-modal__close:focus {
    color: var(--weyel-color-blue);
}

.newsletter-modal__frame {
    display: block;
    width: 100%;
    min-height: 565px;
    border: 0;
}

body.has-modal-open {
    overflow: hidden;
}

/* WhatsApp-Kontaktbutton (Theme-eigen, ohne Fremdskript) */
.weyel-wa {
    --wa-green: #25d366;
    --wa-green-dark: #128c7e;
    --wa-chat-bg: #ece5dd;
    position: fixed;
    right: 95px;
    bottom: 30px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--weyel-space-2);
}

.weyel-wa__button {
    width: 55px;
    height: 55px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--wa-green);
    color: var(--weyel-color-white);
    font-size: var(--weyel-font-size-2xl);
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--weyel-shadow-medium);
    transition: transform var(--weyel-transition-base), box-shadow var(--weyel-transition-base), background var(--weyel-transition-base);
}

.weyel-wa__button:hover,
.weyel-wa__button:focus-visible {
    background: var(--wa-green-dark);
    box-shadow: 0 15px 40px rgba(18, 140, 126, 0.4);
    transform: translateY(-5px);
}

.weyel-wa.is-open .weyel-wa__button {
    background: var(--wa-green-dark);
}

.weyel-wa__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.weyel-wa__panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 320px;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    background: var(--weyel-color-white);
    border-radius: var(--weyel-radius-lg);
    box-shadow: var(--weyel-shadow-mega);
    animation: weyel-wa-in 0.25s ease both;
}

.weyel-wa__panel[hidden] {
    display: none;
}

@keyframes weyel-wa-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.weyel-wa__head {
    display: flex;
    align-items: center;
    gap: var(--weyel-space-2);
    padding: var(--weyel-space-3);
    background: var(--wa-green-dark);
    color: var(--weyel-color-white);
}

.weyel-wa__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    font-size: var(--weyel-font-size-xl-minus);
}

.weyel-wa__head-text {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.weyel-wa__title {
    font-weight: 700;
    font-size: var(--weyel-font-size-sm-plus);
    line-height: 1.3;
}

.weyel-wa__status {
    font-size: var(--weyel-font-size-xs);
    opacity: 0.85;
}

.weyel-wa__close {
    flex: 0 0 auto;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--weyel-color-white);
    font-size: var(--weyel-font-size-xl);
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
}

.weyel-wa__close:hover {
    opacity: 1;
}

.weyel-wa__body {
    padding: var(--weyel-space-4) var(--weyel-space-3);
    background: var(--wa-chat-bg);
}

.weyel-wa__bubble {
    position: relative;
    margin: 0;
    padding: var(--weyel-space-2) var(--weyel-space-3);
    background: var(--weyel-color-white);
    border-radius: 0 var(--weyel-radius-sm) var(--weyel-radius-sm) var(--weyel-radius-sm);
    box-shadow: var(--weyel-shadow-soft);
    font-size: var(--weyel-font-size-sm);
    line-height: var(--weyel-line-height-base);
    color: var(--weyel-color-text);
}

.weyel-wa__bubble::before {
    content: "";
    position: absolute;
    top: 0;
    left: -8px;
    border-width: 0 8px 10px 0;
    border-style: solid;
    border-color: transparent var(--weyel-color-white) transparent transparent;
}

.weyel-wa__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--weyel-space-1);
    padding: var(--weyel-space-3);
    background: var(--wa-green);
    color: var(--weyel-color-white);
    font-weight: 700;
    font-size: var(--weyel-font-size-md);
    text-decoration: none;
    transition: background var(--weyel-transition-fast);
}

.weyel-wa__cta:hover,
.weyel-wa__cta:focus-visible {
    background: var(--wa-green-dark);
    color: var(--weyel-color-white);
}

@media (max-width: 767.98px) {
    .weyel-wa {
        right: 80px;
        bottom: var(--weyel-space-4);
    }

    .weyel-wa__button {
        width: 48px;
        height: 48px;
        font-size: var(--weyel-font-size-xl-minus);
    }

    .weyel-wa__panel {
        bottom: 62px;
        right: -60px;
    }
}
