@charset "utf-8";

body {
    font-family: Verdana, Geneva, sans-serif;
    color: rgb(60, 60, 60);
}

header img {
    width: 100%;
    display: block;
}

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

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

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

body > footer {
    background-color: hsl(210, 30%, 75%);
    color: rgba(102, 102, 102, 0.8);
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    clear: both;
}

ul {
    list-style-type: square;
}

nav {
    clear: both;
    position: relative;
}

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

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

nav a {
    display: block;
    background-color: hsl(210, 30%, 75%);
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
    color: hsl(210, 40%, 30%);
    transition: none;
}

nav a:hover {
    background-color: hsl(210, 40%, 55%);
    color: white;
    font-size: 1.2em;
    transition: 
        background-color 0.5s ease-in 0.2s,
        color 0.5s ease-in 0.2s,
        font-size 1s ease;
}

.hamburger {
    display: none;
    font-size: 2em;
    cursor: pointer;
    background-color: hsl(210, 30%, 75%);
    text-align: center;
    padding: 0.2em;
}

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

    main > img {
        width: 90%;
        float: none;
        padding: 10px 0;
    }

    .hamburger {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    nav ul.show {
        display: flex;
    }

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

    .gallery img {
        width: 100%;
        margin: 5px 0;
    }

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

@media screen and (min-width: 769px) {
    body {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        background-image: url("background.png");
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;
    }

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

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

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

    .gallery img {
        width: 22%;
        margin-bottom: 15px;
    }
}

@media screen and (min-width: 500px) and (max-width: 768px) {
    .gallery img {
        width: 45%; 
        margin: 5px;
    }
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

th, td {
    border: 2px solid hsl(210, 30%, 75%);
    padding: 10px;
    text-align: left;
}

thead {
    background-color: hsl(210, 40%, 55%);
    color: white;
}

tfoot {
    background-color: hsl(210, 30%, 85%);
    font-weight: bold;
    text-align: center;
}

@media screen and (max-width: 600px) {
    table, thead, tbody, tfoot, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    td {
        border: none;
        border-bottom: 1px solid #ccc;
        position: relative;
        padding-left: 50%;
    }

    td::before {
        position: absolute;
        left: 10px;
        font-weight: bold;
    }

    td:nth-of-type(1)::before { content: "Name"; }
    td:nth-of-type(2)::before { content: "Relationship"; }
    td:nth-of-type(3)::before { content: "Birthday"; }
    td:nth-of-type(4)::before { content: "Interesting Fact"; }
}

form {
    width: 90%;
}

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

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

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

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

body > footer {
    clear: both;
}

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

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

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