@charset "utf-8";

/* Styles for all screen sizes */

html {
    background-color: hsl(200, 20%, 47%);
}

body {
    background-color: #F1F8E9;
    color: #1B1B1B;
    font-family: Verdana, Geneva, sans-serif;
    box-sizing: border-box;
}

header {
    text-align: center;
}

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

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: #2E7D32;
    color: white;
    line-height: 2.8em;
    text-align: center;
    text-decoration: none;
}

nav a:hover {
    background-color: #C8E6C9;
    color: #1B3A1B;
}

nav a:focus-visible {
    outline: 3px solid #163e19;
    outline-offset: -3px;
}

/* Hide the navicon on larger screens. */

a#navicon {
    display: none;
}

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

footer {
    clear: both;
    background-color: #2E7D32;
    color: white;
    padding: 10px;
    text-align: center;
}

footer a {
    color: white;
}

/* Flex gallery */

div.gallery {
    display: flex;
    flex-flow: row wrap;
}

div.imgGallery {
    box-sizing: border-box;
    padding: 4px;
}

div.imgGallery img {
    display: block;
    width: 100%;
    height: auto;
}

/* Family table */

table {
    width: 100%;
    table-layout: fixed;
    border: 4px solid rgb(7, 93, 146);
    border-collapse: collapse;
    background-color: white;
}

caption {
    font-weight: bold;
    padding: 0.75em;
}

th,
td {
    border: 1px solid #61717b;
    padding: 12px;
    text-align: left;
    overflow-wrap: anywhere;
}

thead,
tfoot {
    background-color: rgb(7, 93, 146);
    color: white;
}

tbody tr:nth-of-type(even) {
    background-color: rgb(197, 206, 221);
}

@media only screen and (max-width: 1100px) {
    div.imgGallery {
        flex: 48%;
        max-width: 50%;
    }
}

/* Styles for devices 768 pixels wide or smaller */

@media only screen and (max-width: 768px) {
    body {
        width: 100%;
        margin: 0;
    }

    /* Display the hamburger navicon on mobile devices. */

    a#navicon {
        display: block;
        font-size: 2em;
        border-bottom: none;
    }

    /* Hide the menu until the navicon is used. */

    nav ul {
        display: none;
    }

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

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

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

    a#navicon {
        border-bottom: none;
    }

    /* Shared image style for Home and About Me. */

    main > img {
        display: block;
        float: none;
        width: 100%;
        margin: auto;
    }

    /* Two-column gallery */

    div.imgGallery {
        width: 50%;
    }

    tbody,
    tr,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    tbody tr {
        border: 2px solid rgb(7, 93, 146);
        margin-bottom: 1em;
    }

    /* Reserve the left column for each cell's data-label. */

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

    tbody td::before {
        content: attr(data-label);
        position: absolute;
        top: 0;
        left: 0;
        width: 40%;
        padding: 5px;
        font-weight: bold;
    }

    tfoot {
        display: table-footer-group;
    }

    tfoot tr,
    tfoot td {
        display: block;
    }

    tfoot td {
        text-align: center;
    }
}

/* One-column gallery on smaller mobile screens */

@media only screen and (max-width: 480px) {
    div.imgGallery {
        width: 100%;
    }
}

/* Styles for devices 769 pixels wide or larger */

@media only screen and (min-width: 769px) {
    html {
        background: hsl(200, 20%, 47%) url("back_pic.jpg")
                    center / cover no-repeat fixed;
    }

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

    nav ul {
        display: flex;
    }

    nav li {
        width: 20%;
    }

    /* Shared image style for Home and About Me. */

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

    /* Four-column gallery */

    div.imgGallery {
        width: 25%;
    }

    article {
        column-count: 3;
        column-gap: 30px;
        column-rule: 2px solid gray;
        margin-top: 15px;
    }
}


.contactDivider {
    clear: both;
}

form,
form * {
    box-sizing: border-box;
}

form fieldset {
    min-width: 0;
}



.formRow {
    position: relative;
    margin-bottom: 16px;
}

form input,
form select,
form textarea {
    font: inherit;
}

.formHelp {
    margin: 5px 0;
    font-size: 0.85em;
}

.commentsRow textarea {
    display: block;
    min-height: 140px;
    padding: 5px;
    resize: vertical;
}

.formButtons::after {
    content: "";
    display: block;
    clear: both;
}

/* Larger screens: 769 pixels and wider */

@media only screen and (min-width: 769px) {
    form {
        width: 90%;
    }

    form fieldset {
        width: 90%;
        padding: 5px;
        margin: 0 10px 10px 0;
    }

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

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

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

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

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

    .formHelp {
        margin-left: 30%;
    }

    .commentsRow textarea {
        position: relative;
        left: 30%;
        width: 60%;
    }
}

/* Mobile screens: 768 pixels and smaller */

@media only screen and (max-width: 768px) {
    form {
        width: 100%;
        font-size: large;
    }

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

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

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

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

    .commentsRow textarea {
        width: 90%;
    }

    /* Allow navigation to open by click or keyboard. */

    nav ul:target,
    nav:focus-within ul {
        display: block;
    }
}

/* Validation styles based on textbook sections 7-22a and 7-22b. */

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

input:valid {
    background-color: rgb(220, 255, 220);
}

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

/* Embedded icons replace the textbook's rb_valid.png and rb_invalid.png.
   The HTML uses id="email", so the selector below uses #email. */

input#name:focus:valid,
input#zip:focus:valid,
input#phone:focus:valid,
input#email:focus:valid {
    background: rgb(220, 255, 220)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8' fill='%232e7d32'/%3E%3Cpath d='M5 10l3 3 7-7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E")
        bottom right / contain no-repeat;
    padding-right: 30px;
}

input#name:focus:invalid,
input#zip:focus:invalid,
input#phone:focus:invalid,
input#email:focus:invalid {
    background: rgb(255, 232, 233)
        bottom right / contain no-repeat;
    padding-right: 30px;
}

/* Keep recommendation choices inside their fieldset on every screen size. */

form .recommendGroup {
    margin-bottom: 16px;
}

form .radioOptions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 5px;
}

form .radioOptions label.radio {
    display: inline-flex;
    align-items: center;
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    gap: 6px;
    white-space: nowrap;
}

form .radioOptions input[type="radio"] {
    display: inline-block;
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
}