@charset "utf-8";

/* Req 3: browser window background */
html {
    background-color: #1a1440;
}

/* Req 4 */
body {
    font-family: Verdana, Geneva, sans-serif;
    color: #000000;
    background-color: #f2f2f2;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* Req 5 */
header {
    text-align: center;
    padding: 20px;
}

/* Req 6 */
h1, h2 {
    text-shadow: gray 4px 6px 5px;
}

h2 {
    font-size: 1.3em;
}

/* Req 7 - old single-line navigation, replaced by the list layout below */
/*
nav {
    background-color: rgb(94, 94, 94);
    padding: 15px;
    text-align: center;
}

nav a {
    padding-left: 10px;
    padding-right: 10px;
    text-decoration: none;
    color: rgb(94, 94, 94);
}

nav a:hover {
    text-decoration: underline;
    color: rgb(94, 94, 94);
}
*/

/* Req 7: five column navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav li {
    display: block;
    width: 20%;
    float: left;
}

nav a {
    display: block;
    background-color: #000000;
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
    color: #f2f2f2;
}

nav a:hover {
    background-color: #5b4b9e;
    color: #ffffff;
}

/* Req 10 */
main {
    padding: 20px;
    margin-top: 35px;
}

/* Req 11 */
main > img {
    width: 25%;
    padding: 25px;
    float: right;
}

header img {
    width: 100%;
}

/* Req 12 */
body > footer {
    clear: both;
    background-color: #000000;
    color: #f2f2f2;
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
}

body > footer a {
    color: #ffffff;
}

/* Req 13 */
main ul {
    list-style-type: square;
}

/*Flexbox styles for Vacation images */
div.gallery {
    display: flex;
    flex-flow: wrap;
}

div.imgGallery {
    box-sizing: border-box;
    flex: 25%;
    max-width: 25%;
    padding: 0 4px;
}

div.imgGallery img {
    width: 100%;
}

/* Family table */
table {
    width: 100%;
    border: 2px solid #000000;
    border-collapse: collapse;
    background-color: #ffffff;
}

caption {
    font-size: 1.3em;
    font-weight: bold;
    text-align: left;
    margin-bottom: 8px;
}

col.colName {
    width: 18%;
}

col.colRelation {
    width: 16%;
}

col.colBirthday {
    width: 16%;
}

col.colFact {
    width: 50%;
}

th, td {
    border: 1px solid #000000;
    padding: 8px;
    text-align: left;
}

thead {
    background-color: #000000;
    color: #f2f2f2;
}

tbody {
    background-color: #ffffff;
}

tfoot {
    background-color: #5b4b9e;
    color: #ffffff;
    font-weight: bold;
}


/* contact form */
hr {
    clear: both;
}

/* section 7-22a */
input:focus, select:focus, textarea:focus {
    background-color: rgb(245, 245, 140);
}

/* section 7-22b */
input:focus:valid, select:focus:valid, textarea:focus:valid {
    background-color: rgb(220, 255, 220);
}

input:focus:invalid, select:focus:invalid, textarea:focus:invalid {
    background-color: rgb(255, 232, 233);
}

fieldset div {
    position: relative;
    margin-bottom: 10px;
}

label[for="submit"], label[for="reset"] {
    display: none;
}


/* Media Query for Flexbox 50% width */
@media only screen and (max-width: 1100px) {

    div.imgGallery {
        flex: 50%;
        max-width: 50%;
    }
}


/* Media Query for Styles for Tablets - screen sizes 0px - 768px */
@media only screen and (max-width: 768px) {

    body {
        width: 100%;
        margin: 0;
    }

    nav li {
        float: none;
        font-size: x-large;
        width: 100%;
    }

    nav a {
        border-bottom: 1px solid black;
    }

    /* extra credit */
    nav a#navicon {
        display: block;
        font-size: x-large;
    }

    nav ul {
        display: none;
    }

    nav a#navicon:hover + ul, nav ul:hover {
        display: block;
    }

    main > img {
        width: 90%;
        float: none;
    }

    div.imgGallery {
        flex: 100%;
        max-width: 100%;
    }

    /* section 6-11 responsive table */
    table, thead, tbody, tfoot, tr, td {
        display: block;
        width: 100%;
    }

    colgroup {
        display: none;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        margin-bottom: 12px;
        border: 2px solid #000000;
    }

    table td {
        box-sizing: border-box;
        position: relative;
        text-align: left;
        padding: 8px 8px 8px 46%;
        border: none;
        border-bottom: 1px solid #000000;
    }

    table td:before {
        content: attr(data-label);
        position: absolute;
        left: 8px;
        top: 8px;
        width: 40%;
        font-weight: bold;
        text-align: left;
    }

    tfoot td {
        padding: 8px;
        text-align: center;
        border: 1px solid #000000;
    }

    tfoot td:before {
        content: none;
    }

    /* form */
    form {
        width: 100%;
        font-size: large;
    }

    fieldset {
        width: 100%;
        padding: 5px;
        margin: 0;
    }

    input, select, textarea {
        position: inherit;
        display: block;
        height: 50px;
        padding: 5px;
        width: 90%;
    }

    textarea {
        height: auto;
    }

    label {
        position: inherit;
        display: block;
        height: 50px;
        width: 90%;
    }

    input[type="submit"], input[type="reset"] {
        float: none;
        width: 90%;
        margin: 10px;
        font-size: 1.2em;
    }

    input[type="radio"] {
        display: inline;
        width: auto;
        height: auto;
    }

    label.radio {
        display: inline;
        width: auto;
        height: auto;
    }

    select[multiple] {
        height: auto;
    }
}


/* Media Query for Styles for Desktops - screen sizes greater than 768px */
@media only screen and (min-width: 769px) {

    html {
        background-image: url("background.jpg");
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: center center;
        background-size: cover;
    }

    nav a#navicon {
        display: none;
    }

    /* form */
    form {
        width: 90%;
    }

    fieldset {
        position: relative;
        width: 90%;
        padding: 5px;
        margin-right: 10px;
        margin-bottom: 10px;
        overflow: auto;
    }

    input, select, textarea {
        display: block;
        position: relative;
        left: 30%;
        padding: 5px;
        height: auto;
        width: 60%;
        box-sizing: border-box;
    }

    label {
        display: block;
        position: absolute;
        padding: 5px;
        width: 30%;
        box-sizing: border-box;
    }

    input[type="radio"] {
        display: inline;
        position: inherit;
        left: 0;
        width: auto;
    }

    label.radio {
        display: inline;
        position: inherit;
        width: auto;
        height: auto;
    }

    div.recommend span {
        display: block;
        position: relative;
        left: 30%;
        width: 60%;
        padding: 5px;
    }

    input[type="submit"], input[type="reset"] {
        display: block;
        float: left;
        left: 0;
        text-align: center;
        width: 40%;
        padding: 10px;
        margin-left: 5%;
        margin-right: 5%;
        margin-bottom: 10px;
    }
}
