/**
 * External Link Warning Popup
 *
 * Self contained on purpose: the Bootstrap .modal styles are only loaded when Bootstrap is enabled
 * in the Visual Composer Theme Options, so this popup cannot rely on them.
 *
 * Colours are the theme tokens from assets/scss/_variables.scss and must be kept in sync with it:
 * #0E5744 $primary, #F17423 $orange, #CF5A33 $dark-orange, #4D4D4D $text-grey.
 */
.niu-ext-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001; /* Above the energy saver overlay */
    display: none;
    padding: 20px;
    overflow-y: auto;
}

.niu-ext-modal.is-open {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

/* Defensive: the attribute always wins so the popup cannot flash before the script runs */
.niu-ext-modal[hidden] {
    display: none;
}

.niu-ext-modal .niu-ext-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 87, 68, 0.85);
}

.niu-ext-modal .niu-ext-modal__dialog {
    position: relative;
    background: #fff;
    color: #4D4D4D;
    font-family: 'Mulish', sans-serif;
    width: 100%;
    max-width: 520px;
    padding: 45px 30px 35px;
    border-radius: 8px;
    -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.niu-ext-modal .niu-ext-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    font-size: 28px;
    color: #0E5744;
    cursor: pointer;
    opacity: 0.7;
}

.niu-ext-modal .niu-ext-modal__close:hover,
.niu-ext-modal .niu-ext-modal__close:focus {
    opacity: 1;
}

.niu-ext-modal .niu-ext-modal__title {
    color: #0E5744;
    font-family: 'Gotham Rounded', 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 32px;
    margin: 0 0 15px;
}

.niu-ext-modal .niu-ext-modal__message {
    font-size: 16px;
    line-height: 26px;
    margin: 0 0 30px;
}

.niu-ext-modal .niu-ext-modal__actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.niu-ext-modal .niu-ext-modal__btn {
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.05em;
    padding: 9px 37px;
    margin: 0 7px 10px;
    border-radius: 30px;
    display: inline-block;
    text-decoration: none;
    -webkit-transition: ease 0.5s;
    transition: ease 0.5s;
    cursor: pointer;
}

/* The theme sets outline:none in several places so the focus ring is enforced here */
.niu-ext-modal .niu-ext-modal__btn:focus {
    outline: 2px solid #0E5744 !important;
    outline-offset: 2px;
}

.niu-ext-modal .niu-ext-modal__btn--primary {
    color: #fff;
    background: #F17423;
    border: 1px solid #F17423;
}

.niu-ext-modal .niu-ext-modal__btn--primary:hover,
.niu-ext-modal .niu-ext-modal__btn--primary:focus {
    background: #CF5A33;
    border-color: #CF5A33;
    color: #fff;
    text-decoration: none;
}

.niu-ext-modal .niu-ext-modal__btn--secondary {
    color: #0E5744;
    background: #fff;
    border: 1px solid #0E5744;
}

.niu-ext-modal .niu-ext-modal__btn--secondary:hover,
.niu-ext-modal .niu-ext-modal__btn--secondary:focus {
    background: #0E5744;
    color: #fff;
    text-decoration: none;
}

/* Screen reader only, used when the popup has no visible heading */
.niu-ext-modal .niu-ext-modal__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Stop the page behind the popup from scrolling */
html.niu-ext-modal-active,
html.niu-ext-modal-active body {
    overflow: hidden;
}

@media (max-width: 575px) {
    .niu-ext-modal .niu-ext-modal__dialog {
        padding: 40px 20px 30px;
    }

    .niu-ext-modal .niu-ext-modal__btn {
        width: 100%;
        margin: 0 0 10px;
    }
}
