/* ====== 1. Global Styles & Layout ====== */
body {
    margin: 0 auto;
    width: 90%;
    color: #334155;
    font-size: 1.1em;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
}

header img {
    width: 100%;
    border: #00ffff 4px solid;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.15);
    display: inline-block;
    animation: scroll-across 40s linear infinite;
}

#familypic {
    width: 50%;
    border: #ec4899 4px solid;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.15);
    display: block;
    margin: 20px auto;
}

/* ====== 2. Headings & Typography ====== */
h1,
h2 {
    color: #008b8b;
    font-size: 2.2em;
    letter-spacing: -0.5px;
}

p {
    font-size: 18px;
    color: #475569;
    line-height: 1.6em;
}

figcaption {
    font-size: 16px;
    color: #64748b;
    text-align: center;
    margin-top: 5px;
}

/* UPDATED FOR STEP 8: Increased margin to 70px */
main {
    padding: 20px;
    margin-top: 70px;
}

footer {
    clear: both;
    padding-top: 20px;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

footer a {
    color: #008b8b;
    text-decoration: none;
}

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

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

nav a {
    display: block;
    background-color: #f1f5f9;
    line-height: 2.8em;
    text-align: center;
    text-decoration: none;
    color: #008b8b;
    font-size: 1.1em;
    font-weight: bold;
    border: 1px solid #e2e8f0;
}

/* UPDATED FOR STEP 9: New hover size and transition logic */
nav a:hover {
    background-color: #00ffff;
    color: #0f172a;
    border-color: #00ffff;
    font-size: 1.2em;
    transition: background-color 0.5s ease-in 0.2s,
        color 0.5s ease-in 0.2s,
        font-size 1s ease;
}

/* ====== 4. Specific Image Styles ====== */
.me-photo,
img[src*="me.jpg"] {
    width: 250px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border: #ec4899 4px solid;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15);
}

.edu-photo,
img[src*="education"] {
    width: 400px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 25px auto;
    border: #008b8b 4px solid;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 139, 139, 0.15);
}

/* ====== 5. Animation ====== */
@keyframes scroll-across {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-15%);
    }
}

/* ====== 6. Vacation Grid ====== */
.vacation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.vacation-grid img {
    width: 100%;
    height: auto;
    border: #ec4899 2px solid;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.vacation-grid img:hover {
    transform: translateY(-5px);
}

/* ====== 7. Family Table ====== */
.family-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    margin: 25px 0;
}

.family-table caption {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ec4899;
}

.family-table th,
.family-table td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: left;
}

.family-table thead {
    background-color: #008b8b;
    color: white;
}

/* ====== 8. Form Styles ====== */
form {
    width: 90%;
    margin: 20px auto;
}

fieldset {
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

label {
    display: block;
    position: absolute;
    width: 30%;
    padding: 5px;
    font-weight: bold;
    color: #475569;
}

input,
select,
textarea {
    display: block;
    position: relative;
    left: 30%;
    padding: 8px;
    width: 60%;
    margin-bottom: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

input[type=submit],
input[type=reset] {
    display: block;
    float: left;
    width: 40%;
    padding: 12px;
    margin: 0 5% 10px 5%;
    font-weight: bold;
    background-color: #008b8b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type=submit]:hover {
    background-color: #ec4899;
}

/* ====== 9. Media Queries ====== */
@media only screen and (max-width: 768px) {
    body {
        width: 100%;
    }

    nav li {
        float: none;
        width: 100%;
    }

    input,
    select,
    textarea,
    label {
        width: 95%;
        position: inherit;
        left: 0;
    }
}

@media only screen and (min-width: 769px) {
    html {
        background-image: url('./images/background.jpg');
        background-size: cover;
        background-attachment: fixed;
    }

    main>img {
        width: 25%;
        float: right;
        border: #ec4899 4px solid;
        margin-left: 20px;
        border-radius: 8px;
    }
}