@charset "utf-8";

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

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

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

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

/* Combined Main Rule (Assignment 7, Step 8) */
main {
    padding: 20px;
    margin-top: 70px; /* cite: 95 */
}

/* Navigation Base */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    display: block;
    background-color: #34495e;
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
    color: #ecf0f1;
}

/* Combined Hover Transition (Assignment 7, Step 9-10) */
nav a:hover {
    background-color: #f1c40f; /* cite: 101 */
    color: #2c3e50; /* cite: 102 */
    font-size: 1.2em; /* cite: 99, 103 */
    
    /* Transition styles (Step 10b) */
    transition: background-color 0.5s ease-in 0.2s, 
                color 0.5s ease-in 0.2s, 
                font-size 1s ease; /* cite: 100, 101, 102, 103 */
}

/* Footer (Assignment 6 Requirement) */
footer {
    clear: both; /* cite: 66 */
    background-color: #34495e;
    color: rgba(236, 240, 241, 0.6);
    text-align: center;
    padding: 10px;
}

/* Form Pseudo-Classes (Assignment 6, Step 8-9) */
input:focus, select:focus, textarea:focus {
    background-color: #f9f9e0; /* cite: 39 */
}

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

input:invalid, select:invalid, textarea:invalid {
    border: 2px solid red; /* cite: 40 */
}

/* Table Styles (Assignment 5) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #ffffff;
    border: 2px solid #34495e;
}

th, td {
    padding: 12px;
    border: 1px solid #bdc3c7;
}

thead {
    background-color: #34495e;
    color: #ecf0f1;
}

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

/* =========================================
   2. DESKTOP STYLES (Min-width: 769px)
   ========================================= */
@media only screen and (min-width: 769px) {
    html {
        background-image: url('background.jpg');
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;
    }

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

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

    /* Profile Photo Styling (Handled specifically) */
    main > img {
        width: 25%;
        float: right;
        padding: 25px;
    }

    /* Vacation Gallery Override */
    main .gallery img {
        width: 24%;
        padding: 5px;
        float: none;
    }

    /* Form Alignment (Assignment 6, Step 10a) */
    form {
        width: 90%; /* cite: 43 */
    }

    fieldset {
        position: relative;
        width: 90%; /* cite: 45 */
        padding: 5px;
        margin: 0 10px 10px 0;
    }

    label {
        display: block;
        position: absolute; /* cite: 48 */
        padding: 5px;
        width: 30%;
    }

    input, select, textarea {
        display: block;
        position: relative; /* cite: 46 */
        left: 30%;
        width: 60%;
        padding: 5px;
        margin-bottom: 10px;
    }

    /* Fixing Overlapping Question */
    label.full-width {
        position: relative;
        width: 100%;
        left: 0;
        margin-bottom: 5px;
    }

    .radio-group {
        position: relative;
        left: 30%;
        margin-bottom: 15px;
    }

    input[type="radio"] {
        display: inline; /* cite: 50 */
        position: inherit; /* cite: 51 */
        left: 0; /* cite: 52 */
        width: auto; /* cite: 53 */
    }

    label.radio {
        display: inline; /* cite: 55 */
        position: inherit; /* cite: 56 */
        width: auto;
        padding-right: 20px;
    }

    /* Submit and Reset Buttons [cite: 57] */
    #submit, #reset {
        display: block; /* cite: 58 */
        float: left; /* cite: 59 */
        position: relative;
        left: 0; /* cite: 60 */
        text-align: center; /* cite: 61 */
        width: 40%; /* cite: 62 */
        padding: 10px; /* cite: 63 */
        margin: 0 5% 10px 5%; /* cite: 64, 65 */
    }
}

/* =========================================
   3. MOBILE STYLES (Max-width: 768px)
   ========================================= */
@media only screen and (max-width: 768px) {
    body {
        width: 100%;
        margin: 0;
    }

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

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

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

    /* Vacation Gallery Tablet View */
    main .gallery img {
        width: 48%;
        margin: 1%;
    }

    /* Table Responsiveness (Assignment 5) */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    /* Form Mobile Layout (Assignment 6, Step 10b) */
    form {
        width: 100%; /* cite: 68 */
        font-size: large;
    }

    fieldset {
        width: 100%; /* cite: 69 */
        padding: 5px;
        margin: 0;
    }

    label {
        position: inherit; /* cite: 72 */
        display: block;
        height: auto;
        width: 90%;
        padding: 5px;
    }

    input, select, textarea {
        position: inherit; /* cite: 70 */
        display: block;
        height: 50px; /* cite: 71 */
        width: 90%;
        margin-bottom: 10px;
    }

    #submit, #reset {
        float: none; /* cite: 74 */
        width: 90%; /* cite: 75 */
        margin: 10px; /* cite: 76 */
        font-size: 1.2em; /* cite: 77 */
    }
}

/* Smallest Mobile Phones */
@media screen and (max-width: 479px) {
    main .gallery img {
        width: 98%;
    }
}