@charset "utf-8";

/* ================= GLOBAL STYLES ================= */

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

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

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

h2 {
    font-size: 1.3em;
    text-shadow: 4px 6px 5px gray;
    margin-top: 20px;
    margin-bottom: 10px;
}

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

header img {
    width: 100%;
}

body > footer {
    background-color: #042c776e;
    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;
    clear: both;
}

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

li {
    display: block;
}

a {
    display: block;
    background-color: rgb(145, 179, 230);
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
}

a:hover {
    background-color: skyblue;
    color: rgb(74, 247, 74);
}

/* Hide hamburger icon by default (desktop) */
.navicon {
    display: none;
}

/* ================= FLEX GALLERY ================= */

.gallery {
    display: flex;
    flex-wrap: wrap;
}

.gallery img {
    width: 25%;   /* 4 columns on desktop */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery img:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* ================= FLOAT IMAGE FOR ABOUT ME ================= */
.float-image {
    float: right;
    width: 40%;
    margin: 10px;
}

/* ================= FORM STYLES ================= */
form {
    width: 90%;
    margin: 20px auto;
    font-size: 1em;
}

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

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

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
    display: block;
    position: relative;
    left: 30%;
    padding: 5px;
    width: 60%;
    height: auto;
}

/* Radio button styles */
input[type="radio"] {
    display: inline;
    position: inherit;
    left: 0;
    width: auto;
}

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

/* Submit and Reset buttons */
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;
}

/* Focus Styles */
input:focus,
select:focus,
textarea:focus {
    border: 2px solid blue;
}

/* Valid/Invalid Pseudo-Classes */
input:valid,
select:valid,
textarea:valid {
    border: 2px solid green;
}

input:invalid,
select:invalid,
textarea:invalid {
    border: 2px solid red;
}

/* ================= MOBILE STYLES ================= */
@media only screen and (max-width: 768px) {

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

    /* Show hamburger icon */
    .navicon {
        display: block;
        background-color: rgb(145, 179, 230);
        font-size: 2em;
        text-align: center;
        cursor: pointer;
    }

    /* Hide menu until hover */
    nav ul {
        display: none;
    }

    nav:hover ul {
        display: block;
    }

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

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

    main img,
    .float-image {
        width: 100%;
        float: none;
    }

    /* 2-column gallery */
    .gallery img {
        width: 50%;
    }

    /* Disable hover bubble on mobile */
    .gallery img:hover {
        transform: none;
        box-shadow: none;
    }

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

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

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

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

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

/* 1-column gallery for small phones */
@media only screen and (max-width: 480px) {
    .gallery img {
        width: 100%;
    }
}

/* ================= DESKTOP STYLES ================= */
@media only screen and (min-width: 769px) {

    html {
        background-image: url("gymbackground.png");
        background-size: cover;
    }

    body {
        width: 90%;
        margin: 0 auto;
    }

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

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

/* ================= FAMILY TABLE ================= */
.family-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.family-table th,
.family-table td {
    border: 1px solid #333;
    padding: 10px;
    text-align: left;
}

.family-table thead {
    background-color: #444;
    color: white;
}

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

.family-table tfoot {
    background-color: #ddd;
    font-weight: bold;
    text-align: center;
}

/* Responsive Table */
@media only screen and (max-width: 768px) {

    .family-table thead {
        display: none;
    }

    .family-table,
    .family-table tbody,
    .family-table tr,
    .family-table td {
        display: block;
        width: 100%;
    }

    .family-table tr {
        margin-bottom: 15px;
        border: 1px solid #333;
        padding: 10px;
    }

    .family-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    .family-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        font-weight: bold;
        text-align: left;
    }
}