@charset "utf-8";

body {
    font-family: Verdana, Geneva, sans-serif;
    color: rgb(91, 91, 91);
    background-color: ivory;
    margin: 0;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

#wrapper {
    width: 80%;
    margin: auto;
    background-color: white;
}

header {
    text-align: center;
    padding: 20px;
}

header img {
    width: 100%;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

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

nav a {
    display: block;
    background-color: rgb(45, 70, 160);
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
    color: white;
}

nav a:hover {
    background-color: lightgray;
    color: black;
}

main {
    padding: 20px;
    margin-top: 35px;
}

main > img {
    width: 25%;
    padding: 25px;
    float: right;
}

h1, h2 {
    font-size: 1.3em;
    text-shadow: gray 4px 6px 5px;
}

footer {
    background-color: rgb(45, 70, 160);
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    line-height: 2em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    clear: both;
}

footer a {
    color: yellow;
    text-decoration: none;
}

/* Vacation Gallery */

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.gallery img {
    width: 23%;
    margin-bottom: 10px;
}

/* Family Table Styles */

table {
    width: 90%;
    margin: 20px auto;
    border-collapse: collapse;
    background-color: white;
}

thead {
    background-color: rgb(45, 70, 160);
    color: white;
}

tfoot {
    background-color: lightgray;
    font-style: italic;
}

th, td {
    border: 2px solid black;
    padding: 10px;
    text-align: center;
}

/* Mobile Styles */

@media only screen and (max-width: 768px) {

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

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

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

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

    .gallery img {
        width: 48%;
    }

    table,
    thead,
    tbody,
    tfoot,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    th {
        text-align: center;
    }

    td {
        border-bottom: 1px solid black;
    }
}

/* Desktop Styles */

@media only screen and (min-width: 769px) {

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

/* Phone Styles */

@media only screen and (max-width: 480px) {

    .gallery img {
        width: 100%;
    }
}

/* Contact Form Styles */


/* Focus Style */

input:focus, select:focus, textarea:focus {
    background-color: lightyellow;
}

/* Valid and Invalid Styles */

input:valid {
    background-color: #d9ffd9;
}

input:invalid {
    background-color: #ffd9d9;
}

/* Desktop Form Styles */

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

form {
    width: 90%;
}

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

label {
    display: block;
    position: relative;
    padding: 5px;
    width: 30%;
}

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

label.radio {
    display: inline;
    position: inherit;
}

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;
}

/* Mobile Form Styles */

@media only screen and (max-width: 768px) {

    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%;
    }

    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;
    }
}
