@charset "utf-8";

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

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

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: 20px 0 10px 0;
}

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

header img {
    width: 100%;
}

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

/* ================= NAVIGATION ================= */

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;
    color: black;

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

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

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

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

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

.gallery img {
    width: 25%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* ================= FLOAT IMAGE ================= */

.float-image {
    float: right;
    width: 40%;
    margin: 10px;
}

/* ================= FORM STYLES ================= */

form {
    width: 90%;
    margin: 20px auto;
    font-size: 1em;
}

fieldset {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
}

label {
    display: block;
    margin-top: 10px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    box-sizing: border-box;
}

/* Radio buttons */
input[type="radio"] {
    width: auto;
    margin-right: 5px;
}

label.radio {
    display: inline;
}

/* Submit and Reset buttons */
input[type="submit"],
input[type="reset"] {
    width: 48%;
    padding: 10px;
    margin: 10px 1%;
    cursor: pointer;
}

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

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

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

/* ================= MOBILE ================= */

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

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

    nav ul {
        display: none;
    }

    nav:hover ul {
        display: block;
    }

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

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

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

    .gallery img {
        width: 50%;
    }

    .gallery img:hover {
        transform: none;
        box-shadow: none;
    }

    input[type="submit"],
    input[type="reset"] {
        width: 100%;
        margin: 10px 0;
    }
}

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

/* ================= DESKTOP ================= */

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

/* ================= 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;
    }
}