/* ==========================================================================
   HOEM Popup — popup.css
   ========================================================================== */

:root {
    --popup-color-white: #fff;
    --popup-color-black: #111;
    --popup-color-text-body: #444;
    --popup-color-text-muted: #888;
    --popup-color-hover-dark: #333;
    --popup-color-hover-light: #f0f0f0;
    --popup-overlay-bg: rgba(0, 0, 0, 0.6);
    --popup-shadow-color: rgba(0, 0, 0, 0.18);
    --popup-close-bg: rgba(255, 255, 255, 0.85);
}

/* ── Shared overlay base ─────────────────────────────────────────────────── */

.custom-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;                       /* top/right/bottom/left: 0 */
    z-index: 99999;
    background: var(--popup-overlay-bg);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.custom-popup-overlay.is-visible {
    display: flex;
}

/* ── Standard popup card ─────────────────────────────────────────────────── */

.custom-popup {
    position: relative;
    background: var(--popup-color-white);
    border-radius: 8px;
    padding: 2rem;
    max-width: 720px;
    width: 100%;
    box-shadow: 0 8px 32px var(--popup-shadow-color);
}

.custom-popup__heading {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    line-height: 1.25;
}

.custom-popup__body {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--popup-color-text-body);
}

.custom-popup__body p:last-child {
    margin-bottom: 0;
}

.custom-popup__cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--popup-color-black);
    color: var(--popup-color-white);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.custom-popup__cta:hover {
    background: var(--popup-color-hover-dark);
    color: var(--popup-color-white);
}

/* ── Image popup variant ─────────────────────────────────────────────────── */
/* Applied automatically when the popup's image field is set — renders the
   image full-bleed in place of the heading/body/form/CTA fields. */

.custom-popup--image {
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
    max-width: 720px;
}

.custom-popup__image {
    line-height: 0;
}

.custom-popup__image img {
    display: block;
    width: 100%;
    height: auto;
}

.custom-popup--image .custom-popup__close {
    background: var(--popup-close-bg);
    border-radius: 50%;
}

.custom-popup--image .custom-popup__close:hover {
    background: var(--popup-color-white);
}

/* ── Scrollable/form popup variant ───────────────────────────────────────── */
/* Add alongside .custom-popup for taller content (e.g. embedded forms). */

.custom-popup--scrollable {
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
}

.custom-popup__form h2 {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    line-height: 1.25;
}

/* ── Close button ─────────────────────────────────────────────────────────── */

.custom-popup__close {
    position: absolute;
    top: 1rem;
    right: 3rem;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1.2;
    cursor: pointer;
    color: var(--popup-color-text-muted);
    padding: 0.20rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.custom-popup__close:hover {
    color: var(--popup-color-black);
    background: var(--popup-color-hover-light);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .custom-popup {
        padding: 1.25rem;
    }

    .custom-popup__heading,
    .custom-popup__form h2 {
        font-size: 1.25rem;
    }
}
