/*
 * BLOCK EDITOR STYLES
 */
.block-editor-block-list__block.wp-block-wxblock-newsletter-nag .wx-newsletter-nag-container {
    position: relative;
    top: 0;
    left: 1em;
    padding: 4px;
    animation: none;
}
.block-editor-block-list__block.wp-block-wxblock-newsletter-nag .wx-newsletter-nag__open {
    cursor: default;
    pointer-events: none;
}
.block-editor-block-list__block.wp-block-wxblock-newsletter-nag .wx-newsletter-nag-container:not(.modal-open):hover {
    scale: none;
}


/*
 * FRONTEND STYLES
 */
.wx-newsletter-nag-container {
    --nl-nag-size: 64px;
    --nl-nab-shadow: 6px 4px 24px rgba(0, 0, 0, 0.08);

    position: fixed;
    right: 1em;
    bottom: 1em;
    z-index: 99999;
    width: var(--nl-nag-size);
    height: var(--nl-nag-size);
    max-width: 320px;
    display: flex;
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.wx-newsletter-nag-container.modal-open {
    width: calc(-3em + 100vw);
    height: 210px;
    background-color: var(--wp--preset--color--white);
    border-radius: var(--wp--custom--border-radius--large);
    box-shadow: var(--nl-nab-shadow);
    overflow: hidden;
}
.wx-newsletter-nag-container:not(.modal-open):hover {
    scale: 1.1;
}

.wx-newsletter-nag__open {
    width: var(--nl-nag-size);
    height: var(--nl-nag-size);
    border-radius: var(--nl-nag-size);
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wp--preset--color--white);
    box-shadow: var(--nl-nab-shadow);
    cursor: pointer;
    transition: 
        opacity 0.2s ease-in-out,
        visibility 0.2s ease-in-out;
}
.wx-newsletter-nag__open svg {
    margin-top: 6px;
}
.wx-newsletter-nag__open.hidden {
    opacity: 0;
    visibility: hidden;
}
.wx-newsletter-nag-container.modal-open .wx-newsletter-nag__open {
    display: none;
}

.wx-newsletter-nag__close {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background: none;
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    z-index: 1;
    cursor: pointer;
}
.wx-newsletter-nag__close::after {
    content: "";
    width: 30px;
    height: 30px;
    background-color: var(--wp--preset--color--secondary-005);
    display: block;
    position: absolute;
    top: 0px;
    z-index: -1;
    transform: scale(0);
    margin-top: 7px;
    margin-left: 0px;
    border-radius: 100%;
    transition: transform 0.2s ease-in-out;
}
.wx-newsletter-nag__close:hover::after {
    transform: scale(1);
}

.wx-newsletter-nag__modal {
    padding: 1.5em;
}
.wx-newsletter-nag__modal[aria-expanded="false"] {
    display: none;
}
.wx-newsletter-nag__modal[aria-expanded="true"] {
    display: block;
}


@media (prefers-reduced-motion: no-preference) {
    .wx-newsletter-nag-container {
        animation: 
            fadeinbottom .6s cubic-bezier(.39,.575,.565,1) both, 
            bounce .8s .6s both;
        animation-delay: 600ms;
    }
}
@keyframes fadeinbottom {
    0% {
        transform: translateY(calc(var(--nl-nag-size) + 1.5em));
        opacity: 0
    }
    to {
        transform: translateY(0);
        opacity: 1
    }
}
@keyframes bounce {
    38% {
        transform: scale(1);
        animation-timing-function: ease-out
    }
    55% {
        transform: scale(.96);
        animation-timing-function: ease-in
    }
    72% {
        transform: scale(1);
        animation-timing-function: ease-out
    }
    81% {
        transform: scale(.98);
        animation-timing-function: ease-in
    }
    89% {
        transform: scale(1);
        animation-timing-function: ease-out
    }
    95% {
        transform: scale(.99);
        animation-timing-function: ease-in
    }
    to {
        transform: scale(1);
        animation-timing-function: ease-out
    }
}
