/* CSS Variables (Colors & Styles) */
:root {
    --modal-background: #0f4b91;
    --modal-h3-color: #fff;
    --modal-content-color: #fff;
    --modal-a-color: #99ca3c;
    --modal-a-color-hover: #7b93ae;
    --modal-close-button-color: #99ca3c;
    --modal-close-button-color-hover: #7b93ae;
    --modal-focus-color: #ccc;
}

/* CSS Variables (Font Size) */
:root {
    --modal-h3-font: 36px;        /* Desktop -- Above 1024px */
    --modal-h3-font-tablet: 32px; /* Tablet -- Below 1025px */
    --modal-h3-font-mobile: 28px; /* Mobile -- Below 768px */
}

/*===========================================================================*/

/* disable scrolling for main body when modal is active */
html.disable-scroll,
body.disable-scroll {
    overflow: hidden;
}

/* adjust for 17px scrollbar width */
html.disable-scroll {
    padding: 0 17px 0 0;
}

.off {
    pointer-events: none;
    cursor: not-allowed;
}

.location-modals {
    padding: 0 !important; /* over-ride site CSS, especially for the <section> tag  */
    margin: 0 !important; /* over-ride site CSS, especially for the <section> tag  */

    .location-page-modal-container {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        justify-content: center;
        align-items: center;
        z-index: 10000000000;

        .location-page-modal-content {
            background: var(--modal-background);
            border-radius: 10px;
            position: relative;
            max-width: 1000px;
            width: calc(100% - 40px); /* add padding at the left & right sides */
            max-height: calc(95% - 40px); /* add padding at the top & bottom */
            overflow: auto;
            margin: auto;
            padding: 20px 20px 10px;
            box-sizing: border-box;
            top: 50%;
            transform: translateY(-50%);

            h3 {
                color: var(--modal-h3-color);
                font-size: var(--modal-h3-font);
                line-height: 1.25;
                margin: 0 auto 25px;
                max-width: calc(100% - 40px);
                text-align: center;
            }

            /* Content color, excluding the HTML elements within the "not()" varirable */
            *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(a):not(button):not(input):not(select):not(textarea) {
                color: var(--modal-content-color);
            }

            /* <a> color & hover color, except for <a class="btn"> elements */
            a:not(.btn):not(.btn-alt) {
                color: var(--modal-a-color);

                &:hover {
                    color: var(--modal-a-color-hover);
                }
            }

            ul,
            ol {
                overflow: visible; /* prevent from cropping or hiding on certain screen widths & heights */
                margin-bottom: 0;
            }

            .btn,
            .btn-alt {
                max-width: max-content;
                margin: 10px 0;

                &.center {
                    margin: 10px auto;
                }
            }

            /* Show outline for tab & shift-tab key events */
            & :focus-visible {
                outline: 2px solid var(--modal-focus-color) !important; /* over-ride site or default color */
                outline-offset: 2px;
                transition: none;
            }

            /* Hide outline for mouse click events  */
            & :focus:not(:focus-visible) {
                outline: none !important;
                transition: none;
            }

            /* Fallback for older browsers that don't support "focus-visible" */
            & :focus {
                outline: 2px solid var(--modal-focus-color) !important; /* over-ride site or default color */
                outline-offset: 2px;
                transition: none;
            }

            .close-location-page-modal {
                position: absolute;
                background: transparent;
                top: 10px;
                right: 10px;
                font-size: 30px;
                cursor: pointer;
                line-height: 1;
                border: none;
                color: var(--modal-close-button-color);

                &:hover {
                    color: var(--modal-close-button-color-hover);
                }
            }
        }
    }
}

/*===========================================================================*/
/* Responsiveness */
/*===========================================================================*/

@media screen and (max-width: 1024px) {

    .location-modals {
        .location-page-modal-container {
            .location-page-modal-content {
                h3 {
                    font-size: var(--modal-h3-font-tablet);
                }   
            }
        }
    }
}

@media screen and (max-width: 767px) {

    .location-modals {
        .location-page-modal-container {
            .location-page-modal-content {
                h3 {
                    font-size: var(--modal-h3-font-mobile);
                }   
            }
        }
    }
}
