/**
 * Copyright © INSIS d.o.o. All rights reserved.
 *
 * Newsletter popup.
 *
 * Ships as its own stylesheet rather than an addition to the theme's
 * css/custom_pocenipc.css, which carries a large body of edits made directly on
 * the server — the same reason Pocenipc_CategorySeo keeps its CSS separate.
 * Every selector is namespaced .pp-nlpopup so nothing here can reach the theme.
 *
 * Colours follow the PoceniPC palette: Dark Navy #284460, Action Blue #0071dc,
 * matching the #046cbc button already used inside the Brevo form.
 */

.pp-nlpopup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pp-nlpopup[hidden] {
    display: none;
}

.pp-nlpopup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(40, 68, 96, 0.62);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pp-nlpopup.is-open .pp-nlpopup__backdrop {
    opacity: 1;
}

.pp-nlpopup__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(40, 68, 96, 0.32);
    padding: 22px 22px 12px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pp-nlpopup.is-open .pp-nlpopup__dialog {
    opacity: 1;
    transform: translateY(0);
}

/*
 * The Brevo form carries its own heading, so ours is for screen readers and for
 * the iframe title only. Hidden visually, never with display:none, which would
 * take it out of the accessibility tree as well.
 */
.pp-nlpopup__title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pp-nlpopup__close {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 26px;
    line-height: 1;
    color: #284460;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pp-nlpopup__close:hover,
.pp-nlpopup__close:focus {
    color: #ffffff;
    background: #0071dc;
    border-color: #0071dc;
}

.pp-nlpopup__close:focus-visible {
    outline: 2px solid #0071dc;
    outline-offset: 2px;
}

.pp-nlpopup__frame {
    min-height: 120px;
}

.pp-nlpopup__iframe {
    display: block;
    width: 100%;
    border: 0;
}

.pp-nlpopup__loading {
    margin: 0;
    padding: 40px 10px;
    font-size: 14px;
    text-align: center;
    color: #666666;
}

/* Stops the page behind from scrolling while the dialog is up. */
body.pp-nlpopup-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .pp-nlpopup {
        padding: 10px;
    }

    .pp-nlpopup__dialog {
        max-height: calc(100vh - 20px);
        padding: 18px 12px 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pp-nlpopup__backdrop,
    .pp-nlpopup__dialog {
        transition: none;
    }

    .pp-nlpopup__dialog {
        transform: none;
    }
}
