﻿/* Site wide. */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    margin: 0px;
    background-color: #DDDDDD;
    /* https://stackoverflow.com/questions/1417934/how-to-prevent-scrollbar-from-repositioning-web-page */
    padding-left: calc(100vw - 100%);
}

body, textarea, input {
    font-family: Verdana, sans-serif;
}

figure, hr {
    margin-left: 0px;
    text-align: center;
}

figcaption {
    font-style: italic;
}

.narrow-research {
    max-width: 850px;
}

.narrow-teaching {
    max-width: 810px;
}

.narrow-teaching-ul {
    max-width: 780px;
}

.narrow-education {
    max-width: 820px;
}

.narrow-weather {
    max-width: 820px;
}

@media (max-width: 1000px) {
    * {
        font-size: 1.4rem;
    }
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.9rem;
    }
    h3 {
        font-size: 1.7rem;
    }
    ol li {
        list-style-position: inside;
    }
}

/* {
    border-width: 2px;
    border-style: solid;
    border-color: red;
}*/

/* Three vertical columns. */
#panes {
    min-height: 100%;
    flex: 1;
    display: flex;
    flex-direction: row;
}

#content-pane {
    background-color: #FFFFFF;
    width: 1000px;
    display: flex;
    flex-direction: column;
    box-shadow: 0px 0px 10px black;
    z-index: 1; /* Forces the box shadow of this div element to 'float' on top of the surrounding div elements. */
}

#left-pane, #right-pane {
    flex: 1;
    background-color: #DDDDDD;
}

@media (max-width: 1000px) {
    #content-pane {
        width: 100%;
    }
    #left-pane, #right-pane {
        display: none;
    }
}

/* Row 1: Header region. */
header {
    height: 100px;
    background-image: url('/images/bicheno-cropped-small.jpg');
    background-repeat: no-repeat;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex: none;
}

@media (max-width: 1000px) {
    header {
        height: 20vw;
        background-size: auto 20vw;
    }
}

header > h1 {
    text-shadow: 5px 5px 10px white, 5px -5px 10px white, -5px 5px 10px white, -5px -5px 10px white;
    margin-left: 30px;
    flex: 1;
}

header > h1:nth-of-type(1) {
    display: initial;
}
header > h1:nth-of-type(2) {
    display: none;
}

@media (max-width: 1000px) {
    header > h1:nth-of-type(1) {
        display: none;
    }
    header > h1:nth-of-type(2) {
        display: initial;
    }
}

@media (max-width: 1000px) {
    header > form {
        display: none;
    }
}

header > form > input {
    box-shadow: 0px 0px 10px white;
}

header > form > input[type=submit] {
    margin-right: 5px;
}

/* Row 1.1: Hamburger flyout. */
/* References:
   http://www.w3schools.com/howto/howto_js_dropdown.asp
   http://stackoverflow.com/questions/25406595/dropdown-menu-works-with-ids-but-not-classes
*/
.dropdown-container {
    position: relative;
    display: none;
}

@media (max-width: 1000px) {
    .dropdown-container {
        display: inline-block;
    }
}

.hamburger-icon-div {
    width: 20vw;
    height: 20vw;
    padding-right: 10px;
    padding-left: 10px;
}

.hamburger-icon {
    height: 100%;
    width: 100%;
}

.dropdown-items {
    display: none;
    position: absolute;
    background-color: #F3F7FE;
    right: 0px;
    z-index: 1;
}

.dropdown-items > a, .dropdown-items > div {
    padding: 20px 20px;
    display: block;
    font-size: 2.5rem;
    text-decoration: none;
    border-top: 2px solid #2E6AF3;
    border-left: 2px solid #2E6AF3;
    border-right: 2px solid #2E6AF3;
    transition: background-color 0.4s;
}

.dropdown-items > a:last-child {
    border-bottom: 2px solid #2E6AF3;
}

.dropdown-items > a:hover, nav > a:hover, aside > a:hover {
    background-color: #9FB9F6;
    transition: background-color 0.4s;
}

.show {
    display: block;
}

/* Row 2: Navigation region. */
nav {
    width: 100%;
    height: 30px;
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #2E6AF3;
    flex: none;
}

@media (max-width: 1000px) {
    nav {
        display: none;
    }
}

nav > a {
    margin: 0px 2px 0px 0px;
    padding: 5px 10px;
    background-color: #F3F7FE;
    width: 100px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.4s;
}

nav > a:hover {
    /* Refer to ".dropdown-items > a:hover, nav > a:hover, aside > a:hover" above. */
}

nav > div:last-of-type {
    background-color: #F3F7FE;
    flex: 1;
    margin: 0px;
}

/* Row 3: Main content region. */
/* Note 1. The relative position of the "article" element, as a parent of the "aside" elements contained within, causes the "aside" elements to obey absolute positioning rules given.
   See also http://stackoverflow.com/questions/20033949/how-exactly-does-absolute-position-element-behaves-inside-a-static-parent
   Answered Nov 17 '13 at 17:53 by gchiconi.
*/
article {
    flex: auto;
    padding-left: 10px;
    padding-right: 10px;
    position: relative; /* Note 1. */
}

/* Contact form styles. */
.contact-row {
    display: flex; 
    flex-direction: row; 
    align-items: flex-start; 
    margin-top: 10px;
}

.contact-label {
    display: inline-block;
    width: 90px;
}

.contact-item {
    border: 1px solid gray;
    padding: 0px;
    width: 250px;
}

/* http://stackoverflow.com/questions/27021801/inputinvalid-css-rule-is-applied-on-page-load  */
/* http://stackoverflow.com/questions/40856305/invalid-pseudo-element-or-pseudo-class */
/*#email_form.submitted input:invalid, #email_form.submitted textarea:invalid {
    border: 2px solid red;
}*/

@media (max-width: 1000px) {
    .contact-label {
        width: 20vw;
    }
    .contact-item {
        width: 75vw;
    }
    #submit_form {
        padding: 10px 30px;
    }
}

/* Badge styles for /education/certifications.html page. */
.badge {
    height: 176px;
    width: 176px;
    margin-bottom: 10px;
}

@media (max-width: 1000px) {
    .badge {
        height: 352px;
        width: 352px;
    }
}

/* Row 3.1: Aside navigation boxes. */
aside {
    float: right;
    display: inline-flex;
    flex-direction: column;
    border: 1px solid #2E6AF3;
    border-radius: 10px;

    /* Positioning. See Note 1 above. */
    position: absolute; 
    top: 10px;
    right: 10px;
}

@media (max-width: 1000px) {
    aside {
        position: initial;
        float: initial;
    }
}

/* Aside: Navigation. */
@media (max-width: 1000px) {
    aside#aside-nav {
        display: flex;
    }
}

aside > div {
    padding: 5px 10px;
    background-color: #F3F7FE;
    text-align: center;
    border-radius: 0px;
}

aside > div:last-of-type {
    border-radius: 0px 0px 10px 10px;
}

aside > div:first-of-type {
    font-weight: bold;
    border-radius: 10px 10px 0px 0px;
}

aside > a {
    padding: 5px 10px;
    background-color: #F3F7FE;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.4s;
}

aside > a:hover {
    /* Refer to ".dropdown-items > a:hover, nav > a:hover, aside > a:hover" above. */
}

aside > a:last-of-type {
    border-radius: 0px 0px 10px 10px;
}

/* Aside: Portrait graphic. */
aside#steven-burrows-portrait > img {
    border-radius: inherit;
    width: 200px;
}

@media (max-width: 1000px) {
aside#steven-burrows-portrait > img {
        width: 328px;
    }
}

/* Aside: Weather. */
aside#weather {
    display: none;
}

aside#weather > div > span:nth-child(1), aside#weather > div > span:nth-child(2) {
    margin-right: 10px;
}

aside#weather > div#weather-forecast1, aside#weather > div#weather-forecast2, aside#weather > div#weather-forecast3 {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; 
    padding-top: 0px;
    padding-bottom: 0px;
}

aside#weather > div#weather-forecast1 > span > img, aside#weather > div#weather-forecast2 > span > img, aside#weather > div#weather-forecast3 > span > img {
    display: block;
}

/* Row 4: Footer region. */
footer {
    background-color: #F3F7FE;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #2E6AF3;
    flex: none;
    height: 26px;
}

@media (max-width: 1000px) {
    footer {
        flex-direction: column;
        height: 100.2px;
    }
}

footer > p:first-child {
    flex: 1;
}

footer > p {
    margin: 0px;
    padding: 5px;
}

footer > p:last-of-type {
    display: flex;
    flex-direction: row;
}

@media (max-width: 1000px) {
    footer > p {
        padding: 5px 5px 0px 5px;
    }
    footer > p:last-of-type {
        padding: 5px 5px 5px 5px;
    }
}

footer > p:first-child, footer > p:first-child > span {
    font-size: 0.75rem;
}

@media (max-width: 1000px) {
    footer > p:first-child, footer > p:first-child > span {
        font-size: 1rem;
    }
}

footer > p > a:first-of-type {
    margin-right: 5px;
}

footer > p > a > img {
    display: block;
}

@media (max-width: 1000px) {
    footer > p > a > img {
        width: 160px;
    }
}
