/* Lightweight Popup — popup.css */

/* ── Overlay ──
   pointer-events: none lets mouse wheel / keyboard scroll pass through to the
   page while the popup is open. The popup itself restores pointer-events so
   it remains fully interactive. */
#lwp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 2147483647; /* maximum possible CSS z-index */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none; /* allows scroll through the dim background */
}
#lwp-overlay.lwp-active {
    display: flex;
    animation: lwpFadeIn .22s ease;
}
@keyframes lwpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Popup container ── */
#lwp-popup {
    position: relative;
    background: #fff;
    border-radius: 6px;
    width: 100%;
    max-height: 90vh;       /* never overflows the viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden;       /* clips content to rounded corners; inner div scrolls */
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
    animation: lwpSlideIn .24s ease;
    pointer-events: auto;   /* restore full interaction on the popup */
}
@keyframes lwpSlideIn {
    from { transform: translateY(-18px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ── Scrollable content area ──
   The close button is absolute-positioned on #lwp-popup (outside this div)
   so it stays fixed at top-right regardless of scroll position. */
#lwp-popup-inner {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
    flex: 1;
    min-height: 0; /* required for flex children to scroll correctly in all browsers */
    padding: 36px 28px 28px; /* top padding extra to clear the close button */
}

/* ── Close button ── */
#lwp-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition: background .15s;
    flex-shrink: 0;
}
#lwp-close:hover { background: rgba(0,0,0,.85); }

/* Reset any theme-level SVG margin rules that can shift the X icon */
#lwp-close svg {
    margin: 0;
    display: block;
}

@media (max-width: 480px) {
    #lwp-overlay { padding: 12px; }
}
