@import 'sitewide_constants.css';

/*
 * FONTS
 */

@import url(https://fonts.googleapis.com/css?family=Droid+Sans:400,700|EB+Garamond|Convergence);


html, body {
    font-family: 'Droid Sans', sans-serif;
    font-size: 16px;
    line-height: 21px;
    font-weight: 400;
    color: var(--nearblack);
}

html[lang] {
    margin-top: 0 !important;  /* work around WP admin bar pushing everything down */
}
#wpadminbar {
    opacity: 0.5;  /* work around WP admin bar being in the way */
    display: none;
}

p, li {
  font-family: 'Droid Sans', sans-serif;
  font-size:14px;
  line-height:20px;
}

i, em {
    color: var(--lightblue);
}

h1 {
    font-size: 30px;
    color: var(--header1color);
    font-weight: var(--bold);
}

h2 {
    font-size: 21px;
    color: var(--header2color);
    font-weight: var(--bold);
}

h3 {
    font-size: 18px;
    color: var(--header3color);
    font-weight: var(--bold);
}



/*
 * HOME and YOUR WATER constants
 */
	
.container-fluid {
    max-width: 1140px;
}



/*
 * RESPNOSIVENESS at small screen sizes
 */

@media screen and (max-width: 767px) {
    .container-fluid {
        padding-right: 0;
        padding-left: 0;
    }
}



/*
 * HEADER
 * INCLUDING A SUBTITLE THAT ISN'T PART OF THE HEADER BUT LOOKS LIKE IT IS
 * AND THE TRANSLATION WIDGET
 */

nav.navbar {
    @media screen and (max-width: 600px) {
        margin-bottom: 0;
        padding: 0;
    }

    a.navbar-brand {
        text-decoration: none !important;

        img {
            max-width: 320px;  /* scale it down, esp on mobile where it can crowd the navbar hamburger */
        }
    }
}

nav.navbar {
    div.gtranslate-embed-here {
        position: absolute;
        top: .5em;
        right: 1.5em;
        text-align: right;

        @media screen and (max-width: 500px) {
            top: 0;
            right: .75em;
        }

        a {
          text-decoration: none !important;
        }
    }
}

nav.navbar {
    @media screen and (min-width: 992px) {  /* wide mode, as a sideways bar and pop-out menu */
        .dropdown-menu {
            border-top-width: 0;
            margin-top: -15px;
            padding-top: 0;
            border: 1px solid var(--lighterblue);
            border-radius: 0;
            border-bottom-left-radius: 25px;
            border-bottom-right-radius: 25px;
        }

        li.menu-item-has-children.show {
        }
    }

    @media screen and (max-width: 991px) {  /* hamburger mode, text-align right, remove border but add indentation, etc. */
        text-align: right;

        .dropdown-menu {
            border: 0 transparent none;
            text-align: right;
            margin: 0;
            padding: 0;
            background-color: transparent;
        }

        .dropdown-item {
            padding: 3px 15px 3px 0;
        }

        .nav-link {
            padding: 5px 0 5px 0 !important;
        }
    }
}

.navbar-light .navbar-toggler {
    color: rgba(0,0,0,.5);
    border: 0;
}

.navbar-light .navbar-toggler:focus {
    outline:0;
}

div.subtitle {
    color: var(--midgreen);
    font-size: 12px;

    @media screen and (max-width: 500px) {  /* long sentence = pushes nav menu */
        display: none;
    }

    /* we may not have a subtitle on every page, so we get a bit dicey about margin: up to be close to the nav logo, then instate some margin below for spacing */
    margin-top: -1em;
    margin-bottom: 1em;
}



/*
 * FOOTER AND FOOTER LINKS
 */

html {
    position: relative;  /* sticky footer */
    min-height: 100%;
}

div.footer {
    position: absolute;  /* sticky footer */
    width: 100%;
    bottom: 0;

    background-color: black;
    color: white;
    font-size: 12px;
    font-family: 'Droid Sans';

    padding-top: 0.25in;
    padding-bottom: 0.25in;

    a {
        color: var(--lighterblue);
        font-size: 14px;
        text-transform: uppercase;

        &:active, &:hover {
            color: var(--midgreen);
        }
    }

    .social-links {
        a {
            text-decoration: none !important;
            color: var(--midgreen);
            font-size: 24px;
            float: right;

            margin-left: 0.5em;
            &:first-child {
                margin-left: .75em;
            }

            &.social-join {
                background-color: var(--midgreen) !important;
                color: white;
                font-size: 14px;
                border-radius: 5px;
                padding: 2px 10px 2px 10px;
                display: inline-block;
            }
        }
    }
}



/*
 * WORDPRESS HACKS
 * their annoying admin bar pushes site content down,
 * but then below X px width, the bar moves to the bottom of the screen,
 * leaving only "mysterious" empty space at the top and obscuring the site footer
 */

@media screen and (max-width: 600px) {
    html[lang="en"] {  /* including attribute, makes this rule more specific than WP's rule which is also !important */
        margin-top: 0px !important;
    }
    #wpadminbar {
        display: none !important;
    }
}



/*
 * UTILITY CLASSES
 */

.right {
    text-align: right;
}
.left {
    text-align: left;
}
.center {
    text-align: center;
}
.pointer {
    cursor: pointer;
}
.small {
    font-size: 75%;
}
.bold {
    font-weight: bold;
}
.boxshadow {
    box-shadow: rgb(134, 134, 134) 0px 0px 9px 0px;
}
@media screen and (max-width: 767px) {
    .boxshadow {
        box-shadow: none;
    }
}
.pointer {
    cursor: pointer;
}
.clearfix:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
}

.clearfix {display: inline-block;}

* html .clearfix {height: 1%;}
.clearfix {display: block;}



/*
 * LINKS
 */

a {
    color: var(--lightblue);
    text-decoration: none;

    &:active, &:hover {
        color: var(--midgreen);
        text-decoration: underline;
    }
}

.navbar-light .navbar-nav .nav-link {
        text-decoration: none !important;
        color: var(--darkblue);
        text-transform: uppercase;
        font-weight: 700;
        font-size: 15px;
        padding: 15px 10px 15px 10px;
        display: block;
        margin-left: 0.2em;
        &:last-child {
            margin-left: 0;
        }
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--wavetop-blue);
}



/*
 * BOXES WITH WAVY BORDER AND BLUE BACKGROUND
 */

div.wavybox {
    /*
    background-image: url(#{var(--theme-url}/images/white-bg-pattern.jpg))
    background-color: white;
    padding: 35px 35px 35px 35px;

    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    */

    div.wavybox-content {
        background-image: none;
        background-color: white;
/*
        padding: 30px 30px 30px 30px;
*/

        a {
            color: #000;
            text-decoration: underline;

            &:hover {
                color: #000;
            }
        }
    }

    position: relative;  /* so ul.tablinks  can do that hide-behind visual effect */

    @media screen and (max-width: 767px) {  /* but o mobile throw out all this hard work: drop the border etc. cuz it wastes space */
        background-image: none;
        padding: 0;

        div.wavybox-content {
            padding: 0 0 0 0;
        }
    }
}



/*
 * DID YOU KNOW
 * POPDOWN LISTS OF LINKS
 */

div.didyouknow {
    background-color: var(--lighterblue);

    h1, h2, h3 {
        color: white !important;
    }

    h1 {
        font-size: 18px;
        font-weight: 400;

        cursor: pointer;

        margin: 0;
        padding: 15px 15px 15px 15px;

        i {  /* the chevron */
            font-size: 25px;
            float: right;
        }
    }

    ul {
        display: none;  /* shown in code when h1 is clicked */

        list-style-type: none;

        padding-left: 15px;
        padding-bottom: 15px;

        li {
            line-height: 2;

            a {
                color: white !important;
                &:active, &:hover {
                    text-decoration: underline;
                }
            }
        }
    }

    i {
        color: inherit;
    }
}



/*
 * SCROLLBAR HACKS
 * per issue 144 Mac users can turn off scrollbars... then complain that it's not clear when things are scrollable
 */

--scrollbar-bg-color: white; 
--scrollbar-handle-color: rgba(0, 0, 0, .5);
--scrollbar-thickness: 12px;
--scrollbar-border-radius: 8px;

::-webkit-scrollbar {
    -webkit-appearance: none;
}

::-webkit-scrollbar:vertical {
    width: var(--scrollbar-thickness);
}

::-webkit-scrollbar:horizontal {
    height: var(--scrollbar-thickness);
}

::-webkit-scrollbar-thumb {
    border-radius: var(--scrollbar-border-radius);
    border: 1px solid var(--scrollbar-bg-color);
    background-color: var(--scrollbar-handle-color);
    cursor: pointer;
}

::-webkit-scrollbar-track { 
    background-color: var(--scrollbar-bg-color);
    border-radius: var(--scrollbar-border-radius);
    cursor: pointer;
}

::-webkit-scrollbar-corner {
    opacity: 0;
}



/*
 * PRETTY SLIDER CHECKBOXES courtesy of W3schools
 * 
 * <!-- Rectangular switch -->
 * <label class="switch"><input type="checkbox" name="X" value="Y" /><span class="slider"></span></label>
 * 
 * <!-- Rounded switch -->
 * <label class="switch"><input type="checkbox" name="X" value="Y" /><span class="slider round"></span></label>
 *
 * If you want a visible text label too, wrap this whole thing in a second <label> element.
 */

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 3em;
    height: 1em;
    vertical-align: text-top;

    input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--lighterblue);
        -webkit-transition: .2s;
        transition: .2s;
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 0.8em;
        width: 0.8em;
        bottom: 0.25em;
        left: 4px;
        background-color: var(--wavetop-blue);
        -webkit-transition: .2s;
        transition: .2s;
    }

    input:checked + .slider {
        background-color: white;
        outline: 1px solid #999999;
    }

    input:focus + .slider {
        box-shadow: 0 0 1px white;
    }

    input:checked + .slider:before {
        -webkit-transform: translateX(26px);
        -ms-transform: translateX(26px);
        transform: translateX(26px);
    }

    .slider.round {
        border-radius: 34px;
        height: 1.28em;
        width: 2.8em;
    }

    .slider.round:before {
        border-radius: 50%;
    }
}



/*
 * PRETTY CHECKBOXES which can be styled, unlike real ones
 *
 * <label class="fake-checkbox"><input type="checkbox" name="X" value="Y" /><span></span></label>
 *
 * If you want a visible text label too, wrap this whole thing in a second <label> element.
 */

label.fake-checkbox {
    --fake-checkbox-url: url(/wp-content/themes/watertool/images/checkbox.svg);

    input {  /* hide the real checkboxes */
        position: relative;
        z-index: -9999;
    }
    span {
        width: 20px;
        height: 20px;
        display: inline-block;
        cursor: pointer;

        background: white;

        border: 1px solid #CCCCCC;
        border-radius: 0;
    }
    input:checked + span {
        background-image: var(--fake-checkbox-url);
        background-size: contain;
    }
}



/*
 * COLORED RANGE SLIDERS
 * thank you Daniel Stern and Range CSS http://danielstern.ca/range.css/#/
 */

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    margin: 7.5px 0;
}
input[type=range]:focus {
    outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    box-shadow: 0px 0px 0px var(--nearblack), 0px 0px 0px var(--grey);
    background: var(--grey);
    border-radius: 1px;
    border: 0px solid var(--white);
}
input[type=range]::-webkit-slider-thumb {
    box-shadow: 0px 0px 0px var(--nearblack), 0px 0px 0px var(--grey);
    border: 1px solid var(--grey);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--wavetop-blue);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7.5px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
    background: var(--grey);
}
input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    box-shadow: 0px 0px 0px var(--nearblack), 0px 0px 0px var(--grey);
    background: var(--grey);
    border-radius: 1px;
    border: 0px solid var(--white);
}
input[type=range]::-moz-range-thumb {
    box-shadow: 0px 0px 0px var(--nearblack), 0px 0px 0px var(--grey);
    border: 1px solid var(--grey);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--wavetop-blue);
    cursor: pointer;
}
input[type=range]::-ms-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    color: transparent;
}
input[type=range]::-ms-fill-lower {
    background: var(--grey);
    border: 0px solid var(--white);
    border-radius: 2px;
    box-shadow: 0px 0px 0px var(--nearblack), 0px 0px 0px var(--grey);
}
input[type=range]::-ms-fill-upper {
    background: var(--grey);
    border: 0px solid var(--white);
    border-radius: 2px;
    box-shadow: 0px 0px 0px var(--nearblack), 0px 0px 0px var(--grey);
}
input[type=range]::-ms-thumb {
    box-shadow: 0px 0px 0px var(--nearblack), 0px 0px 0px var(--grey);
    border: 1px solid var(--grey);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--wavetop-blue);
    cursor: pointer;
    height: 6px;
}
input[type=range]:focus::-ms-fill-lower {
    background: var(--grey);
}
input[type=range]:focus::-ms-fill-upper {
    background: var(--grey);
}



/*
 * LOADING SPINNER
 * <div class="lds-facebook"><div></div><div></div><div></div></div>
 */

.lds-facebook {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
}
.lds-facebook div {
    display: inline-block;
    position: absolute;
    left: 6px;
    width: 13px;
    background: var(--darkblue);
    animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}
.lds-facebook div:nth-child(1) {
    left: 6px;
    animation-delay: -0.24s;
}
.lds-facebook div:nth-child(2) {
    left: 26px;
    animation-delay: -0.12s;
}
.lds-facebook div:nth-child(3) {
    left: 45px;
    animation-delay: 0;
}
@keyframes lds-facebook {
    0% {
      top: 6px;
      height: 51px;
    }
    50%, 100% {
      top: 19px;
      height: 26px;
    }
}
