/* ============================================================
   Comican Popups — Stylesheet
   Covers: homepage popup, comic popup, exit intent popup
   Uses brand tokens from :root (comican-navy, comican-white,
   comican-accent, comican-card) and Prompt font for headings.
   ============================================================ */

/* --- Overlay base --- */
.comican-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 26, 61, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.comican-popup-overlay.comican-popup-active {
    display: flex;
    animation: comican-fade-in 0.35s ease;
}

@keyframes comican-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Popup box base --- */
.comican-popup-box {
    background: var(--comican-navy);
    border-radius: 16px;
    position: relative;
    overflow: hidden;           /* no scrollbars on any axis ever */
    box-sizing: border-box;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: comican-slide-up 0.35s ease;
    max-height: 88vh;           /* hard cap — content must fit inside */
    max-width: calc(100vw - 40px); /* never wider than viewport */
}

@keyframes comican-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Kill page scrollbar when any popup is open */
body.comican-popup-open {
    overflow: hidden;
}

/* --- Close button --- */
.comican-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--comican-white);
    font-size: 1.4rem;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.comican-popup-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* --- Shared typography --- */
.comican-popup-eyebrow {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--comican-accent);
    margin: 0 0 8px;
    font-weight: 600;
}

.comican-popup-heading {
    font-family: 'Prompt', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--comican-white);
    margin: 0 0 12px;
    line-height: 1.2;
}

.comican-popup-sub {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
    margin: 0 0 20px;
}

/* --- Form --- */
.comican-popup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comican-popup-input {
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(14, 175, 255, 0.4); /* comican-accent at 40% */
    background: rgba(255, 255, 255, 0.06);
    color: var(--comican-white);
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s;
}
.comican-popup-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.comican-popup-input:focus { border-color: var(--comican-accent); }

.comican-popup-btn {
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    background: var(--comican-accent);
    color: var(--comican-card); /* black text on accent = high contrast */
    font-family: 'Prompt', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.comican-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 175, 255, 0.35);
}
.comican-popup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- Messages --- */
.comican-popup-msg {
    font-size: 0.83rem;
    min-height: 18px;
    margin: 4px 0 0;
    text-align: center;
}
.comican-msg-success { color: #6ee7b7; }
.comican-msg-error   { color: #fca5a5; }

/* --- Skip link --- */
.comican-popup-skip {
    background: none;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent; /* kills mobile red/pink tap highlight */
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
    cursor: pointer;
    text-align: center;
    margin-top: 10px;
    padding: 4px 0;
    display: block;
    width: 100%;
    transition: color 0.2s;
    box-shadow: none !important;
}
.comican-popup-skip:hover  { color: rgba(255, 255, 255, 0.6); }
.comican-popup-skip:focus  { outline: none; box-shadow: none; color: rgba(255, 255, 255, 0.6); }
.comican-popup-skip:active { outline: none; box-shadow: none; background: none; color: rgba(255, 255, 255, 0.6); }


/* ============================================================
   1. HOMEPAGE POPUP — split layout (image left, copy right)
   ============================================================ */

.comican-popup-collage {
    width: 100%;
    max-width: 820px;
}

.comican-popup-split {
    display: flex;
    min-height: 480px;
}

.comican-popup-image-side {
    flex: 0 0 45%;
    overflow: hidden;
    border-radius: 16px 0 0 16px;
}

.comican-collage-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.comican-popup-copy-side {
    flex: 1;
    padding: 44px 36px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


/* ============================================================
   2. COMIC POPUP — centered, image top, constrained height
   ============================================================ */

.comican-popup-comic {
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    text-align: center;
    overflow: hidden;
}

.comican-comic-hero-img {
    width: 100%;
    height: 180px;          /* compressed — leaves room for content below */
    object-fit: cover;
    object-position: center 20%;
    display: block;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;         /* never squish the image */
}

.comican-popup-comic .comican-popup-eyebrow {
    padding: 12px 28px 0;
    margin-bottom: 4px;
}

.comican-popup-comic .comican-popup-heading {
    padding: 0 28px;
    font-size: 1.35rem;     /* slightly smaller to save height */
    margin-bottom: 6px;
}

.comican-popup-comic .comican-popup-sub {
    padding: 0 28px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.comican-popup-comic .comican-popup-form {
    padding: 0 28px;
    gap: 8px;               /* tighter gap between input and button */
}

.comican-popup-comic .comican-popup-input {
    padding: 9px 16px;      /* shorter input */
}

.comican-popup-comic .comican-popup-btn {
    padding: 9px 20px;      /* shorter button */
}

.comican-popup-comic .comican-popup-skip {
    padding: 8px 28px 16px; /* enough breathing room at bottom */
    margin-top: 4px;
}


/* ============================================================
   3. EXIT INTENT POPUP — horizontal, image left (portrait hero_GG)
   ============================================================ */

.comican-popup-exit {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.comican-exit-hero-img {
    flex: 0 0 42%;
    width: 42%;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-radius: 16px 0 0 16px;
}

.comican-exit-copy {
    flex: 1;
    padding: 40px 32px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


/* ============================================================
   MOBILE — all popups stack vertically
   ============================================================ */

@media (max-width: 640px) {

    .comican-popup-overlay {
        padding: 20px 12px; /* equal top & bottom — floating card not bottom tab */
        align-items: center; /* centred vertically, not pinned to bottom */
    }

    /* Homepage: stack vertically */
    .comican-popup-collage {
        max-width: 100%;
        border-radius: 16px; /* full radius on all corners — it's floating */
    }

    .comican-popup-split {
        flex-direction: column;
        min-height: unset;
    }

    .comican-popup-image-side {
        flex: 0 0 auto;
        height: 200px;
        border-radius: 16px 16px 0 0;
    }

    .comican-popup-copy-side {
        padding: 24px 20px 28px;
    }

    .comican-popup-heading {
        font-size: 1.3rem;
    }

    /* Comic: full width */
    .comican-popup-comic {
        max-width: 100%;
        border-radius: 16px; /* full radius — floating */
    }

    /* Exit: stack vertically on mobile */
    .comican-popup-exit {
        flex-direction: column;
        max-width: 100%;
        border-radius: 16px;
    }

    .comican-exit-hero-img {
        width: 100%;
        flex: 0 0 auto;
        height: 200px;
        border-radius: 16px 16px 0 0;
    }

    .comican-exit-copy {
        padding: 24px 20px 28px;
    }
}