@charset "UTF-8";

/* ============================================
    Base Styles - Apply Regardless of Screen Size
============================================= */

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

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

nav a:hover {
    background-color: #004225;
    color: white;
}

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

body > footer {
    background-color: #013220;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    clear: both;
}

body > footer a {
    color: white;
}

ul {
    list-style-type: square;
}

/* Navicon hidden on desktop by default */
#navicon {
    display: none;
}

/* Gallery base */
.gallery {
    display: flex;
    flex-wrap: wrap;
}

.gallery figure {
    box-sizing: border-box;
    padding: 5px;
    margin: 0;
}

.gallery figure img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery figcaption {
    text-align: center;
    font-size: 0.85em;
    padding: 4px 0;
}

/* Form focus and validation states */
input:focus, select:focus, textarea:focus {
    outline: 3px solid #00693E;
    background-color: #f0fff4;
}

input:valid, select:valid, textarea:valid {
    border: 2px solid green;
    background-color: #e8f5e9;
}

input:invalid, select:invalid, textarea:invalid {
    border: 2px solid red;
    background-color: #fff0f0;
}

/* ============================================
    Family Table
============================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

.family-table {
    width: 100%;
    border-collapse: collapse;
    border: 3px solid #00693E;
    font-size: 0.95em;
}

.family-table th {
    background-color: #00693E;
    color: white;
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #004225;
}

.family-table td {
    padding: 10px 15px;
    border: 1px solid #c8e6c9;
}

.family-table tbody tr:nth-child(even) {
    background-color: #e8f5e9;
}

.family-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.family-table tbody tr:hover {
    background-color: #c8e6c9;
}

.family-table tfoot td {
    background-color: #013220;
    color: white;
    text-align: center;
    font-style: italic;
    padding: 10px 15px;
    border: 1px solid #004225;
}

/* ============================================
    Desktop: min-width 769px
============================================= */

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

    html {
        background-image: url('bg.svg');
        background-repeat: repeat;
        background-position: center center;
    }

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

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

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

    /* Form layout for larger screens */
    form {
        width: 90%;
    }

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

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

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

    /* 4-column gallery on desktop */
    .gallery figure {
        width: 25%;
    }

}

/* ============================================
    Mobile: max-width 768px
============================================= */

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

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

    /* Show navicon on mobile */
    #navicon {
        display: block;
        background-color: #00693E;
        color: white;
        font-size: 1.8em;
        padding: 8px 15px;
        line-height: 1.4;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    /* Hide nav list by default on mobile */
    nav ul {
        display: none;
    }

    /* Reveal nav list when hovering anywhere inside nav */
    nav:hover ul {
        display: block;
    }

    /* Keep nav list visible when hovering over the menu items */
    nav ul:hover {
        display: block;
    }

    /* Nav list items */
    nav li {
        float: none;
        font-size: x-large;
        width: 100%;
    }

    /* Nav links */
    nav a {
        border-bottom: 1px solid black;
    }

    /* Main images */
    main > img {
        width: 90%;
        float: none;
    }

    /* Form layout for mobile screens */
    form {
        width: 100%;
        font-size: large;
    }

    fieldset {
        width: 100%;
        padding: 5px;
        margin: 0;
        box-sizing: border-box;
        position: relative;
    }

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

    label {
        position: inherit;
        display: block;
        height: 50px;
        width: 90%;
        box-sizing: border-box;
    }

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

    /* 2-column gallery on tablet/mobile */
    .gallery figure {
        width: 50%;
    }

}

/* ============================================
    Small Mobile: max-width 480px
============================================= */

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

    /* 1-column gallery on small mobile */
    .gallery figure {
        width: 100%;
    }

}
