@charset "utf-8";

/* ============================================
   BASE STYLES - Apply to all screen sizes
   ============================================ */

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

/* Header section */
header {
    text-align: center;
    padding: 20px;
}

/* Header image - full width */
header img {
    width: 100%;
}

/* Headings with text shadow */
h1, h2 {
    text-shadow: 4px 6px 5px gray;
}

/* H2 elements */
h2 {
    font-size: 1.3em;
}

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

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

/* Footer - direct child of body */
body > footer {
    background-color: rgb(70, 90, 110);
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    clear: both;
}

/* Footer link styling */
body > footer a {
    color: rgba(255, 255, 255, 0.6);
}

/* List marker for education page */
.education-list {
    list-style-type: square;
}

/* ============================================
   TABLE STYLES - Family Page
   ============================================ */

/* Family table - base styles */
.family-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

/* Table header */
.family-table thead {
    background-color: rgb(70, 90, 110);
    color: white;
}

/* Table header cells */
.family-table th {
    padding: 15px;
    text-align: left;
    border: 1px solid rgb(50, 70, 90);
}

/* Table body rows - alternating colors */
.family-table tbody tr:nth-child(odd) {
    background-color: rgb(240, 240, 230);
}

.family-table tbody tr:nth-child(even) {
    background-color: rgb(255, 255, 245);
}

/* Table body cells */
.family-table td {
    padding: 12px 15px;
    border: 1px solid rgb(200, 200, 200);
}

/* Table body row hover effect */
.family-table tbody tr:hover {
    background-color: rgb(200, 220, 240);
}

/* Table footer */
.family-table tfoot {
    background-color: rgb(70, 90, 110);
    color: white;
    font-weight: bold;
}

.family-table tfoot td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid rgb(50, 70, 90);
}

/* Gallery styles - flex container */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Gallery images */
.gallery img {
    object-fit: cover;
    height: 200px;
}

/* ============================================
   FORM STYLES - About Me Page
   ============================================ */

/* Form focus state */
input:focus, select:focus, textarea:focus {
    background-color: rgb(255, 255, 200);
    border: 2px solid rgb(70, 90, 110);
    outline: none;
}

/* Form valid state */
input:valid, select:valid, textarea:valid {
    border-left: 5px solid green;
}

/* Form invalid state */
input:invalid, select:invalid, textarea:invalid {
    border-left: 5px solid red;
}

/* Fieldset base styles */
fieldset {
    border: 1px solid rgb(70, 90, 110);
    background-color: rgb(250, 250, 245);
}

/* ============================================
   DESKTOP STYLES - min-width 769px
   ============================================ */
@media only screen and (min-width: 769px) {
    
    /* HTML element - browser window background with image */
    html {
        background-color: rgb(70, 90, 110);
        background-image: url('background.jpg');
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
        background-attachment: fixed;
    }

    /* Body - desktop width and centered */
    body {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    /* Navigation li - float layout for desktop */
    nav li {
        display: block;
        width: 20%;
        float: left;
    }

    /* Links within nav - desktop */
    nav a {
        display: block;
        background-color: rgb(70, 90, 110);
        line-height: 2.8em;
        text-decoration: none;
        text-align: center;
        color: rgb(255, 255, 255);
    }

    /* Hover state for nav links */
    nav a:hover {
        background-color: rgb(100, 130, 160);
        color: rgb(255, 255, 200);
    }

    /* Main element - desktop */
    main {
        padding: 20px;
        margin-top: 35px;
    }

    /* Images in main section - desktop */
    main > img {
        width: 25%;
        padding: 25px;
        float: right;
    }

    /* Gallery images - 4 columns on desktop */
    .gallery img {
        width: calc(25% - 10px);
    }

    /* ============================================
       FORM STYLES - Desktop
       ============================================ */

    /* Form width */
    form {
        width: 90%;
    }

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

    /* Input and select elements */
    form input, form select, form textarea {
        display: block;
        position: relative;
        left: 30%;
        padding: 5px;
        height: auto;
        width: 60%;
    }

    /* Label elements */
    form label {
        display: block;
        position: absolute;
        padding: 5px;
        width: 30%;
    }

    /* Radio group wrapper */
    .radio-group {
        margin-top: 15px;
        margin-bottom: 15px;
        padding: 10px 0;
        clear: both;
    }

    .radio-group > label:first-child {
        position: relative;
        width: auto;
        margin-bottom: 5px;
    }

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

    /* Radio labels */
    label.radio {
        display: inline;
        position: inherit;
        width: auto;
    }

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

/* ============================================
   MOBILE STYLES - max-width 768px
   ============================================ */
@media only screen and (max-width: 768px) {
    
    /* HTML element - solid background for mobile (no image) */
    html {
        background-color: rgb(70, 90, 110);
    }

    /* Body - full width, no margin */
    body {
        width: 100%;
        margin: 0;
    }

    /* Navicon hamburger menu - visible on mobile */
    .navicon {
        display: block;
        background-color: rgb(70, 90, 110);
        color: rgb(255, 255, 255);
        font-size: 2em;
        text-align: center;
        padding: 10px;
        cursor: pointer;
    }

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

    /* Show menu when hovering over nav */
    nav:hover ul {
        display: block;
    }

    /* Navigation li - stacked for mobile */
    nav li {
        float: none;
        font-size: x-large;
        width: 100%;
    }

    /* Links within nav - mobile */
    nav a {
        display: block;
        background-color: rgb(70, 90, 110);
        line-height: 2.8em;
        text-decoration: none;
        text-align: center;
        color: rgb(255, 255, 255);
        border-bottom: 1px solid black;
    }

    /* Hover state for nav links - mobile */
    nav a:hover {
        background-color: rgb(100, 130, 160);
        color: rgb(255, 255, 200);
    }

    /* Main element - mobile */
    main {
        padding: 20px;
        margin-top: 35px;
    }

    /* Images in main section - mobile */
    main > img {
        width: 90%;
        float: none;
        display: block;
        margin: 0 auto;
        padding: 10px;
    }

    /* Gallery images - 1 column on mobile */
    .gallery img {
        width: 100%;
    }

    /* ============================================
       RESPONSIVE TABLE - Mobile
       ============================================ */
    
    /* Hide table header on mobile */
    .family-table thead {
        display: none;
    }

    /* Make table rows display as blocks */
    .family-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid rgb(70, 90, 110);
    }

    /* Make table cells display as blocks */
    .family-table td {
        display: block;
        text-align: right;
        padding: 10px;
        border: none;
        border-bottom: 1px solid rgb(200, 200, 200);
    }

    /* Add label before each cell using data-label attribute */
    .family-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: rgb(70, 90, 110);
    }

    /* Last cell in each row - no bottom border */
    .family-table td:last-child {
        border-bottom: none;
    }

    /* Table footer on mobile */
    .family-table tfoot tr {
        margin-bottom: 0;
    }

    .family-table tfoot td {
        text-align: center;
    }

    .family-table tfoot td::before {
        display: none;
    }

    /* ============================================
       FORM STYLES - Mobile
       ============================================ */

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

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

    /* Input and select elements */
    form input, form select, form textarea {
        position: inherit;
        display: block;
        height: 50px;
        padding: 5px;
        width: 90%;
    }

    /* Label elements */
    form label {
        position: inherit;
        display: block;
        height: 50px;
        width: 90%;
    }

    /* Radio group wrapper - mobile */
    .radio-group {
        margin-top: 10px;
        margin-bottom: 10px;
        padding: 5px 0;
    }

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

/* ============================================
   TABLET STYLES - for gallery transition
   ============================================ */
@media only screen and (min-width: 481px) and (max-width: 768px) {
    /* Gallery images - 2 columns on tablet */
    .gallery img {
        width: calc(50% - 10px);
    }
}
