/* ============================================================
   Post Popup — global notice modal whose content comes from a
   fixed WP post (POPUP_POST_SLUG, main site only).
   Same look & feel as the header form modal (header.css), but a
   separate component: the card follows the site theme and the
   post body (WP blocks) keeps the page's typography.
   ============================================================ */

.post-popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    overscroll-behavior: none;
}

.post-popup-modal[aria-hidden="false"] {
    display: flex;
}

.post-popup-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    touch-action: none;
}

body.post-popup-open {
    overflow: hidden;
}

.post-popup-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    animation: post-popup-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-popup-modal-close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    margin-bottom: -44px;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}

.post-popup-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.post-popup-modal-logo {
    display: block;
    width: 180px;
    height: auto;
    margin-bottom: 16px;
}

@keyframes post-popup-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.post-popup-modal-title {
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: #1a2b3c;
    margin: 0 0 12px;
    line-height: 1.2;
}

.post-popup-modal-body {
    color: #4a5568;
    font-size: 0.98rem;
    line-height: 1.6;
}

.post-popup-modal-body > :first-child {
    margin-top: 0;
}

.post-popup-modal-body > :last-child {
    margin-bottom: 0;
}

.post-popup-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* --- Dark theme: the card follows the site theme; the WP block
      content inside inherits the site's dark-mode block styles --- */

[data-theme="dark"] .post-popup-modal-content {
    background: #161b22;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .post-popup-modal-close {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .post-popup-modal-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .post-popup-modal-title {
    color: #f0f6fc;
}

[data-theme="dark"] .post-popup-modal-body {
    color: #e6edf3;
}

/* --- Mobile --- */

@media (max-width: 600px) {
    .post-popup-modal-content {
        padding: 28px 20px;
    }
}
