/**
 * Popup-Hinweis – visual port of the euroweb.de notification module (size-3, background-default).
 * All selectors are scoped to the plugin's own container/ID so neither the theme
 * nor the notificationsjs base styles (also using .notification-area) interfere.
 */

:root {
    --wwwe-notification-color: #000000;
    --wwwe-notification-background: #ededed;
    --wwwe-notification-border-radius: 3px;
    --wwwe-notification-shadow: 0 0 5px 0 rgba(0, 0, 0, .35);
    --wwwe-notification-close-color: #ffffff;
    --wwwe-notification-close-background: #000000;
    --wwwe-notification-badge-color: #ffffff;
    --wwwe-notification-badge-background: #91012c;
}

/* ================================================================
   CONTAINER
   ================================================================ */
.wwwe-notification-area.notification-area {
    position: fixed;
    bottom: 1rem;
    left: 2.5rem;
    z-index: 999999;
    display: block;
    visibility: visible;
    pointer-events: none;
}

@media (min-width: 960px) {
    .wwwe-notification-area.notification-area {
        left: 3.75rem;
    }
}

/* ================================================================
   NOTIFICATION
   ================================================================ */
#wwwe-notification {
    display: block;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin-left: -6.25rem;
    padding: 0;
    overflow: hidden;
    background: var(--wwwe-notification-background);
    color: var(--wwwe-notification-color);
    font-size: .75rem;
    line-height: 1rem;
    border-radius: var(--wwwe-notification-border-radius);
    box-shadow: var(--wwwe-notification-shadow);
    transform-origin: left center;
    pointer-events: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease-in-out, margin-left .3s ease-in-out, visibility .3s ease-in-out;
}

#wwwe-notification[hidden] {
    display: none;
}

#wwwe-notification.transition-in {
    margin-left: 0;
    visibility: visible;
    opacity: 1;
}

#wwwe-notification:focus:not(:focus-visible) {
    outline: none;
}

@media (min-width: 960px) {
    #wwwe-notification {
        font-size: 1rem;
        line-height: 1.375rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #wwwe-notification {
        transition: none;
    }
}

/* ================================================================
   CONTENT
   ================================================================ */
#wwwe-notification .note-content {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: calc(90vw - 2.25rem);
    max-width: calc(90dvw - 2.25rem);
    max-height: min(50vh, 40.625rem);
    max-height: min(50dvh, 40.625rem);
    padding: 3.75rem 1.75rem 1.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

@media (max-width: 759px) {
    #wwwe-notification {
        max-width: 21.0625rem;
    }
}

@media (min-width: 760px) {
    #wwwe-notification .note-content {
        width: max(51rem, 50vw);
        max-height: min(50vh, 50rem);
        max-height: min(50dvh, 50rem);
        padding: 3.75rem 3.75rem 1.75rem 1.75rem;
    }
}

#wwwe-notification .wwwe-notification__title,
#wwwe-notification .wwwe-notification__body h3 {
    margin: 0;
    color: inherit;
    font-weight: 700;
    hyphens: auto;
}

#wwwe-notification .wwwe-notification__title::before,
#wwwe-notification .wwwe-notification__body h3::before {
    content: none;
}

#wwwe-notification .wwwe-notification__title {
    margin-bottom: .7em;
    font-size: clamp(22px, 5vw, 40px);
    line-height: 1.2;
}

#wwwe-notification .wwwe-notification__body > * {
    margin: 0;
}

/* one empty line between blocks, as on euroweb.de */
#wwwe-notification .wwwe-notification__body > * + * {
    margin-top: 1.375em;
}

#wwwe-notification .wwwe-notification__body h3 {
    font-size: inherit;
    line-height: inherit;
}

#wwwe-notification .wwwe-notification__body h3 + * {
    margin-top: 0;
}

#wwwe-notification .wwwe-notification__body ul,
#wwwe-notification .wwwe-notification__body ol {
    padding-left: 1.25em;
}

#wwwe-notification a {
    color: inherit;
    text-decoration: underline;
}

/* ================================================================
   CLOSE BUTTON
   ================================================================ */
#wwwe-notification .wwwe-notification__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 3rem;
    height: 3rem;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--wwwe-notification-close-background);
    box-shadow: none;
    cursor: pointer;
    appearance: none;
    transition: opacity 350ms;
}

#wwwe-notification .wwwe-notification__close:hover,
#wwwe-notification .wwwe-notification__close:focus {
    opacity: .8;
}

/* the notification clips overflow, so the focus ring has to sit inside the button */
#wwwe-notification .wwwe-notification__close:focus-visible {
    outline-offset: -6px;
}

#wwwe-notification .wwwe-notification__close::before,
#wwwe-notification .wwwe-notification__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: .125rem;
    background: var(--wwwe-notification-close-color);
}

#wwwe-notification .wwwe-notification__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

#wwwe-notification .wwwe-notification__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ================================================================
   BADGE (reopens the notification)
   ================================================================ */
.wwwe-notification-badge {
    position: fixed;
    bottom: 12.5rem;
    left: 0;
    z-index: 1000;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: .375rem;
    border: 0;
    border-radius: 0 .25rem .25rem 0;
    background: var(--wwwe-notification-badge-background);
    box-shadow: none;
    fill: var(--wwwe-notification-badge-color);
    font-size: 1rem;
    line-height: 0;
    cursor: pointer;
    appearance: none;
    transition: opacity 350ms;
}

.wwwe-notification-badge[hidden],
body.wwwe-notification-open .wwwe-notification-badge {
    display: none;
}

.wwwe-notification-badge:hover,
.wwwe-notification-badge:focus {
    opacity: .8;
}

.wwwe-notification-badge svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
}
