@charset "utf-8";

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

/* Image Reset */
img {
    max-width: 100%;
    height: auto;
}

header img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

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

h1, h2 {
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

/* =========================
   NAVIGATION (Hamburger Menu)
   ========================= */
nav {
    position: relative;
}

#menu-toggle {
    display: none;
}

#navicon {
    display: none;
    width: 40px;
    height: 30px;
    cursor: pointer;
    margin: 0 auto;
    flex-direction: column;
    justify-content: space-between;
}

#navicon span {
    display: block;
    height: 4px;
    background-color: #4682B4;
    border-radius: 2px;
}

nav ul.horizontal {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul.horizontal li {
    flex: 1 1 auto;
    min-width: 100px;
    text-align: center;
}

nav ul.horizontal a {
    display: block;
    background-color: #4682B4;
    line-height: 2.8em;
    text-decoration: none;
    color: white;
}

nav ul.horizontal a:hover {
    background-color: #2f5d87;
    color: ivory;
}

/* =========================
   TABLE STYLES
   ========================= */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    background-color: #FFFFFF;
    border: 2px solid #4682B4;
    border-collapse: collapse;
}

th, td {
    border: 1px solid #4682B4;
    padding: 12px;
    text-align: left;
}

thead {
    background-color: #4682B4;
    color: white;
}

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

tfoot {
    background-color: #e7e7e7;
    font-weight: bold;
}

/* =========================
   VACATION FLEX GALLERY
   ========================= */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.gallery img {
    flex: 0 1 22%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

/* =========================
   MAIN & FOOTER
   ========================= */
main {
    padding: 20px;
}

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

footer a {
    color: white;
    text-decoration: none;
}

/* =========================
   MEDIA QUERIES
   ========================= */
@media only screen and (max-width: 768px) {
    #navicon {
        display: flex;
    }

    nav ul.horizontal {
        display: none;
        flex-direction: column;
    }

    #menu-toggle:checked + #navicon + ul.horizontal {
        display: flex;
    }

    .gallery img {
        flex: 0 1 90%;
        height: auto;
    }
}

@media only screen and (min-width: 769px) {
    html {
        background-image: url("background.jpg");
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
    }

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

    main > img {
        width: 25%;
        float: right;
        margin-left: 20px;
        border-radius: 5px;
    }
}

/* =========================
   MOBILE TABLE TRANSFORMATION
   ========================= */
@media only screen and (max-width: 640px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border: 2px solid #4682B4;
        padding: 10px;
        background-color: white;
    }

    td {
        position: relative;
        padding-left: 50%;
        border: none;
        border-bottom: 1px solid #ddd;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        color: #4682B4;
    }

    tfoot {
        display: block;
        text-align: center;
    }
}

/* =========================
   ABOUT ME PAGE FORM STYLES
   ========================= */
body.aboutme-page input:focus,
body.aboutme-page select:focus,
body.aboutme-page textarea:focus {
    outline: 2px solid #4682B4;
}

body.aboutme-page input:valid,
body.aboutme-page select:valid,
body.aboutme-page textarea:valid {
    border: 2px solid green;
}

body.aboutme-page input:invalid,
body.aboutme-page select:invalid,
body.aboutme-page textarea:invalid {
    border: 2px solid red;
}

/* DESKTOP FORM STYLES */
@media only screen and (min-width: 769px) {
    body.aboutme-page form {
        width: 90%;
        margin: 0 auto;
    }

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

    body.aboutme-page input,
    body.aboutme-page select,
    body.aboutme-page textarea {
        display: block;
        position: relative;
        left: 30%;
        width: 60%;
        padding: 5px;
        height: auto;
    }

    body.aboutme-page label {
        display: block;
        position: absolute;
        width: 30%;
        padding: 5px;
    }

    body.aboutme-page input[type="radio"] {
        display: inline;
        position: inherit;
        left: 0;
        width: auto;
    }

    body.aboutme-page label.radio {
        display: inline;
        position: inherit;
    }

    body.aboutme-page input[type="submit"],
    body.aboutme-page input[type="reset"] {
        display: block;
        float: left;
        width: 45%;
        padding: 10px;
        margin: 0 2.5% 10px 2.5%;
        text-align: center;
    }
}

/* MOBILE FORM STYLES */
@media only screen and (max-width: 768px) {
    body.aboutme-page form {
        width: 100%;
        font-size: large;
    }

    body.aboutme-page fieldset {
        width: 100%;
        padding: 5px;
        margin: 0;
    }

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

    body.aboutme-page label {
        display: block;
        position: inherit;
        width: 90%;
        height: 50px;
    }

    body.aboutme-page input[type="radio"] {
        display: inline;
        width: auto;
    }

    body.aboutme-page label.radio {
        display: inline;
    }

    body.aboutme-page input[type="submit"],
    body.aboutme-page input[type="reset"] {
        display: block;
        float: none;
        width: 90%;
        margin: 10px auto;
        text-align: center;
        font-size: 1.2em;
    }
}
