/* ==========================================
   WRITOHOLICS - HOMEPAGE PROMOTIONAL POPUP
   FINAL RESPONSIVE VERSION
   ========================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ------------------------------------------
   OVERLAY
------------------------------------------ */

.wh-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100dvh;

    padding: 18px;

    background: rgba(6, 8, 12, 0.78);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    opacity: 0;
    visibility: hidden;

    overflow: hidden;

    transition:
        opacity .28s ease,
        visibility .28s ease;
}

.wh-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}


/* ------------------------------------------
   MAIN POPUP
------------------------------------------ */

.wh-popup {
    position: relative;

    width: min(500px, calc(100vw - 36px));
    max-width: 500px;

    /*
     * Entire popup always stays inside screen.
     */
    max-height: calc(100dvh - 36px);

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, .35),
        0 8px 25px rgba(0, 0, 0, .18);

    transform:
        translateY(18px)
        scale(.98);

    transition:
        transform .3s ease;
}

.wh-popup-overlay.is-open .wh-popup {
    transform:
        translateY(0)
        scale(1);
}


/* ------------------------------------------
   CLOSE BUTTON
------------------------------------------ */

.wh-popup-close {
    position: absolute;

    top: 12px;
    right: 12px;

    z-index: 10;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, .75);
    color: #ffffff;

    font-size: 25px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, .18);

    transition:
        transform .2s ease,
        background .2s ease;
}

.wh-popup-close:hover {
    background: #000000;
    transform: rotate(5deg);
}

.wh-popup-close:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}


/* ------------------------------------------
   PROMOTIONAL IMAGE
------------------------------------------ */

.wh-popup-media {
    position: relative;

    width: 100%;

    /*
     * Image section can shrink when browser
     * height becomes smaller.
     */
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #111111;

    border-radius: 18px 18px 0 0;
}

.wh-popup-media img {
    display: block;

    width: 100%;
    height: 100%;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;
    object-position: center center;

    margin: 0;
}


/* ------------------------------------------
   FORM CONTENT
------------------------------------------ */

.wh-popup-content {
    position: relative;

    flex: 0 0 auto;

    width: 100%;

    padding: 20px 24px 22px;

    background: #ffffff;
}


/* ------------------------------------------
   HEADING
------------------------------------------ */

.wh-popup-heading {
    margin: 0 0 5px;

    color: #171717;

    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;

    text-align: center;
}


/* ------------------------------------------
   DESCRIPTION
------------------------------------------ */

.wh-popup-description {
    margin: 0 0 16px;

    color: #666666;

    font-size: 14px;
    line-height: 1.5;

    text-align: center;
}


/* ------------------------------------------
   FORM
------------------------------------------ */

.wh-popup-form {
    width: 100%;
    margin: 0;
}

.wh-popup-form-row {
    display: flex;
    align-items: stretch;

    width: 100%;

    gap: 10px;
}


/* ------------------------------------------
   EMAIL FIELD
------------------------------------------ */

.wh-popup-email {
    flex: 1 1 auto;

    width: 100%;
    min-width: 0;

    height: 50px;

    padding: 0 15px;

    border: 1px solid #d9d9d9;
    border-radius: 9px;

    outline: none;

    background: #ffffff;
    color: #181818;

    font: inherit;
    font-size: 15px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.wh-popup-email::placeholder {
    color: #999999;
}

.wh-popup-email:hover {
    border-color: #bdbdbd;
}

.wh-popup-email:focus {
    border-color: #222222;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, .07);
}


/* ------------------------------------------
   SUBMIT BUTTON
------------------------------------------ */

.wh-popup-submit {
    flex: 0 0 auto;

    min-width: 170px;
    min-height: 50px;

    padding: 0 20px;

    border: 0;
    border-radius: 9px;

    background: #171717;
    color: #ffffff;

    font: inherit;

    font-size: 13px;
    font-weight: 700;

    letter-spacing: .25px;

    white-space: nowrap;

    cursor: pointer;

    transition:
        transform .2s ease,
        background .2s ease,
        opacity .2s ease;
}

.wh-popup-submit:hover {
    background: #000000;

    transform:
        translateY(-1px);
}

.wh-popup-submit:disabled {
    opacity: .6;

    cursor: not-allowed;

    transform: none;
}

.wh-popup-submit:focus-visible {
    outline: 3px solid rgba(0, 0, 0, .20);
    outline-offset: 2px;
}


/* ------------------------------------------
   HONEYPOT
------------------------------------------ */

.wh-popup-hp {
    position: absolute !important;

    left: -9999px !important;

    width: 1px !important;
    height: 1px !important;

    overflow: hidden !important;

    opacity: 0;

    pointer-events: none;
}


/* ------------------------------------------
   RESPONSE MESSAGE
------------------------------------------ */

.wh-popup-message {
    display: none;

    width: 100%;

    margin-top: 12px;

    padding: 11px 13px;

    border-radius: 8px;

    font-size: 13px;
    line-height: 1.4;

    text-align: center;
}

.wh-popup-message.is-visible {
    display: block;
}

.wh-popup-message.is-success {
    color: #176b39;

    background: #eefaf2;

    border: 1px solid #c9ebd5;
}

.wh-popup-message.is-error {
    color: #a52727;

    background: #fff1f1;

    border: 1px solid #f1cccc;
}


/* ------------------------------------------
   BODY LOCK
------------------------------------------ */

body.wh-popup-lock {
    overflow: hidden !important;
}


/* ------------------------------------------
   REMOVE POPUP SCROLLBARS
------------------------------------------ */

.wh-popup,
.wh-popup-media,
.wh-popup-content {
    scrollbar-width: none;
}

.wh-popup::-webkit-scrollbar,
.wh-popup-media::-webkit-scrollbar,
.wh-popup-content::-webkit-scrollbar {
    width: 0;
    height: 0;

    display: none;
}


/* ==========================================
   SHORTER DESKTOP / LAPTOP SCREENS
   ========================================== */

@media (max-height: 800px) and (min-width: 576px) {

    .wh-popup-overlay {
        padding: 12px;
    }

    .wh-popup {
        max-height: calc(100dvh - 24px);
    }

    .wh-popup-content {
        padding:
            16px
            22px
            18px;
    }

    .wh-popup-heading {
        font-size: 18px;
    }

    .wh-popup-description {
        margin-bottom: 12px;

        font-size: 13px;
    }

    .wh-popup-email,
    .wh-popup-submit {
        height: 47px;
        min-height: 47px;
    }

    .wh-popup-message {
        margin-top: 9px;

        padding: 9px 11px;
    }
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 768px) {

    .wh-popup-overlay {
        padding: 14px;
    }

    .wh-popup {
        width: min(
            500px,
            calc(100vw - 28px)
        );

        max-height:
            calc(100dvh - 28px);
    }

    .wh-popup-content {
        padding:
            17px
            18px
            19px;
    }
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 575.98px) {

    .wh-popup-overlay {
        padding: 10px;
    }

    .wh-popup {
        width:
            calc(100vw - 20px);

        max-width: 100%;

        max-height:
            calc(100dvh - 20px);

        border-radius: 14px;
    }

    .wh-popup-media {
        border-radius:
            14px
            14px
            0
            0;
    }

    .wh-popup-close {
        top: 8px;
        right: 8px;

        width: 34px;
        height: 34px;

        font-size: 22px;
    }

    .wh-popup-content {
        padding:
            14px
            14px
            15px;
    }

    .wh-popup-heading {
        margin-bottom: 4px;

        font-size: 17px;
        line-height: 1.25;
    }

    .wh-popup-description {
        margin-bottom: 11px;

        font-size: 12.5px;
        line-height: 1.4;
    }

    .wh-popup-form-row {
        flex-direction: column;

        gap: 8px;
    }

    .wh-popup-email,
    .wh-popup-submit {
        width: 100%;

        min-width: 0;

        height: 47px;
        min-height: 47px;
    }

    .wh-popup-submit {
        padding:
            0
            15px;
    }

    .wh-popup-message {
        margin-top: 8px;

        padding:
            9px
            10px;

        font-size: 12px;
    }
}


/* ==========================================
   VERY SMALL MOBILE
   ========================================== */

@media (max-width: 359px) {

    .wh-popup-overlay {
        padding: 7px;
    }

    .wh-popup {
        width:
            calc(100vw - 14px);

        max-height:
            calc(100dvh - 14px);
    }

    .wh-popup-content {
        padding:
            11px
            12px
            12px;
    }

    .wh-popup-heading {
        font-size: 16px;
    }

    .wh-popup-description {
        font-size: 12px;
    }

    .wh-popup-email,
    .wh-popup-submit {
        height: 44px;
        min-height: 44px;
    }
}


/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    .wh-popup-overlay,
    .wh-popup,
    .wh-popup-close,
    .wh-popup-submit {
        transition: none;
    }
}