@charset "utf-8";

html {
    background-color: rgb(247, 179, 199);
}

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

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

header img {
    width: 100%;
}

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

h2 {
    font-size: 1.3em;
}

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

nav a {
    display: block;
    background-color: rgb(228, 147, 171);
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
    color: white;

    transition: background-color 0.5s ease-in 0.2s,
                color 0.5s ease-in 0.2s,
                font-size 1s ease;
}

nav a:hover {
    background-color: rgb(247, 179, 199);
    color: rgb(91, 91, 91);
    font-size: 1.2em;
}

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

body > footer {
    clear: both;
    background-color: rgb(228, 147, 171);
    color: rgba(102, 102, 102, 0.6);
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
}


/* Image Credits */

.image-credit {
    font-size: 0.75em;
    text-align: center;
    color: #999;
}

.image-credit a {
    color: #999;
}


/* Family Table */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    border: 2px solid rgb(228, 147, 171);
}

th {
    background-color: rgb(247, 179, 199);
    color: rgb(91, 91, 91);
    padding: 12px;
    border: 1px solid rgb(228, 147, 171);
    text-align: left;
}

td {
    background-color: white;
    color: rgb(91, 91, 91);
    padding: 12px;
    border: 1px solid rgb(228, 147, 171);
}

tfoot td {
    background-color: rgb(228, 147, 171);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 10px;
}


/* Contact Form */

form {
    width: 90%;
}

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

legend {
    font-weight: bold;
}

form p {
    min-height: 50px;
}

input,
select {
    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;
    overflow-wrap: break-word;
}

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

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

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

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


/* Form Focus */

input:focus,
select:focus,
textarea:focus {
    background-color: rgb(255, 240, 245);
    outline: 2px solid rgb(228, 147, 171);
}


/* Form Validation */

input:valid,
select:valid,
textarea:valid {
    border: 2px solid rgb(250, 188, 207);
}

input:invalid,
select:invalid,
textarea:invalid {
    border: 2px solid rgb(207, 94, 103);
}


/* Desktop */

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

    html {
        background-image: url("background.jpeg");
        background-repeat: repeat;
        background-position: center;
    }

    body {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

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

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

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

    .imgGallery {
        flex: 0 1 23%;
        max-width: 25%;
        padding: 0 4px;
    }

    .imgGallery img {
        width: 100%;
    }

}


/* Two-column gallery */

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

    .imgGallery {
        flex: 0 1 48%;
        max-width: 50%;
    }

}


/* Mobile */

@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: solid black 1px;
    }

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

    .gallery {
        display: flex;
        flex-flow: column nowrap;
    }

    .imgGallery {
        width: 100%;
        padding: 0;
    }

    .imgGallery img {
        width: 100%;
    }


    /* Responsive Family Table */

    table,
    tbody,
    tr,
    td,
    th {
        display: block;
    }

    thead,
    tfoot {
        display: none;
    }

    tbody td {
        position: relative;
        padding-left: 40%;
        height: auto;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        top: 0;
        left: 0;
        padding: 10px;
        width: 40%;
        font-weight: bold;
        color: rgb(91, 91, 91);
    }


    /* Contact Form - Mobile */

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

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

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

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

    textarea {
        position: inherit;
        display: block;
        width: 90%;
        padding: 5px;
    }

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

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

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

}