@charset "utf-8";

/* 4. Body styles */
body { 
    margin: 0; 
    width: 90%; 
    margin-left: auto; 
    margin-right: auto; 
    background-color: rgb(245,230,230); /* softer pinkish background */
    color: black; /* readable text */
    font-family: Verdana, Geneva, sans-serif; 
}

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

/* 6. h2 elements */
h2 {
    font-size: 1.3em;
}
h1, h2 {
    text-shadow: 4px 6px 5px gray;
    color: white; 
}

/* 7. Navigation section */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
nav li {
    display: block;
    width: 20%;
    float: left;
}

/* 8. Links inside nav */
nav a {
    display: block;
    background-color: rgb(42, 127, 127);
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
    color: white;
}

/* 9. Hover effect for nav links */
nav a:hover {
    background-color: rgb(244,180,0);
    color: white;
}

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

/* 11. Image styling */
main > img {
    width: 90%;
    float: none;
    display: block;
    margin: 10px auto;
    padding: 25px;
}

header img {
    width: 100%;
    height: auto;
}

/* 12. Footer styling */
body > footer {
    background-color: rgb(42,127,127);
    color: black;
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    clear: both;
}

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

/* Background image on HTML */
html {
    background-color: rgb(42,127,127);
    background-image: url("images/background.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

/* ===========================
   FLEXBOX GALLERY BASE STYLES
   =========================== */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery img {
    width: 100%;
}

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

    .about-layout { 
        flex-direction: column; 
    } 

    .about-photo img { 
        max-width: 100%; 
    } 

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

    nav ul {
        display: none;
    }

    #navicon {
        display: block;
        background-color: rgb(42,127,127);
        color: white;
        padding: 10px;
        font-size: 2em;
        cursor: pointer;
        text-align: center;
    }

    #navicon:hover + ul,
    nav ul:hover {
        display: block;
    }

    .gallery img {
        flex: 1 1 100%;
    }
}


/* ===========================
   MEDIUM SCREENS (769–1024px)
   =========================== */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .gallery img {
        flex: 1 1 calc(50% - 10px); /* 2 columns */
    }
}

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

    /* Hide hamburger */
    #navicon {
        display: none;
    }

    nav ul {
        display: block;
    }



    main img {
        width: 40%;
        float: right;
    }

    /* Desktop gallery: 4 columns */
    .gallery img {
        flex: 1 1 calc(25% - 10px);
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

th, td {
    border: 2px solid #333;
    padding: 10px;
    text-align: left;
}

thead {
    background: #cce5ff;
}

tfoot {
    background: #f2f2f2;
    font-weight: bold;
    text-align: center;
}

@media (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    th {
        background: #cce5ff;
        font-size: 1.2em;
    }

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

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

/* ============================
   FORM FOCUS, VALID, INVALID
   ============================ */
input:focus, select:focus, textarea:focus {
    background-color: #ffffcc;
}

input:valid, select:valid, textarea:valid {
    border: 2px solid green;
}

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

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

    form {
        width: 90%;
    }

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

    /* LABELS: left column */
    label {
        display: block;
        position: absolute;
        width: 30%;
        padding: 5px;
        left: 0;
    }

    /* INPUTS + SELECTS + TEXTAREA: right column */
    input, select, textarea {
        display: block;
        position: relative;
        left: 30%;
        width: 60%;
        padding: 5px;
        height: auto;
        margin-bottom: 20px;
    }

    /* RADIO BUTTONS */
    input[type="radio"] {
        display: inline;
        position: relative;
        left: 0;
        width: auto;
        margin-left: 30%;
    }

    label.radio {
        display: inline;
        position: relative;
        left: 30%;
        width: auto;
        padding: 0 10px;
    }

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

    footer {
        clear: both;
    }
}
/* ABOUT PAGE SIDE-BY-SIDE LAYOUT */
.about-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.about-photo img {
    width: 100%;
    max-width: 350px;
    border-radius: 10px;
}

.about-form {
    flex: 1;
}


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

    form {
        width: 100%;
        font-size: large;
    }

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

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

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

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








