/* Base styles */
body {
    background-color: #EEE;
    font-family: Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Links */
a {
    text-decoration: none;
    color: #0066cc;
}

a:hover {
    color: #003366;
}

/* Lists */
ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

li {
    margin: 10px 0;
}

/* Main container - now responsive */
#container {
    background-color: white;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Header */
#header {
    background-color: #66CCff;
    color: white;
    text-align: center;
    padding: 15px;
}

#header h1 {
    margin: 0;
    font-size: 1.8em;
}

/* Navigation - now sticky on mobile */
#nav {
    background-color: #0066cc;
    padding: 10px 0;
}

#nav h3 {
    display: none; /* Hide "Navigation" heading */
}

#nav ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

#nav li {
    margin: 0;
}

#nav a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 3px;
    transition: background 0.3s;
}

#nav a:hover, #nav a.selected {
    background: rgba(255,255,255,0.2);
    font-weight: bold;
}

/* Content area */
#content {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Photo styling - responsive */
#photo {
    flex: 0 0 auto;
    text-align: center;
    margin-bottom: 20px;
}

#photo img {
    border: 5px solid #000000;
    max-width: 100%;
    height: auto;
    width: auto;
    max-width: 300px;
}

img.resize {
    width: 300px;
    max-width: 100%;
    height: auto;
}

/* Main content area */
#main {
    flex: 1;
    min-width: 300px;
}

#about {
    width: 100%;
    text-align: left;
}

/* Footer */
#footer {
    clear: both;
    padding: 15px;
    background-color: #999999;
    color: white;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#footer_left, #footer_right, #foot_center {
    flex: 1;
    min-width: 200px;
}

#footer_left {
    text-align: left;
}

#foot_center {
    text-align: center;
}

/* Mobile-first responsive design */
@media screen and (max-width: 768px) {
    body {
        font-size: 16px; /* Larger base font for mobile */
        margin: 0 !important; /* Force remove any browser default margins */
        padding: 0 !important; /* Force remove any browser default padding */
    }
    
    #container {
        margin: 0 !important;
        box-shadow: none;
        width: 100vw; /* Use viewport width instead */
        max-width: none; /* Remove max-width constraint on mobile */
    }
    
    #header {
        padding: 15px;
    }
    
    #header h1 {
        font-size: 1.6em; /* Slightly larger header */
    }
    
    /* Make navigation sticky on mobile */
    #nav {
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    #nav ul {
        gap: 15px;
        padding: 0 10px;
    }
    
    #nav a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    #content {
        flex-direction: column;
        padding: 20px; /* More generous padding */
        gap: 20px;
    }
    
    #photo {
        order: 1;
        flex: none;
        margin-bottom: 20px;
    }
    
    #photo img {
        max-width: 280px; /* Bigger photo on mobile */
        width: 80%; /* Responsive but larger */
    }
    
    #main {
        order: 2;
        flex: none;
        width: 100%;
        min-width: auto;
        font-size: 1.05em; /* Slightly larger text in main content */
        line-height: 1.7; /* Better line spacing for readability */
    }
    
    #about {
        order: 3;
        margin-left: 0;
        padding: 0;
    }
    
    #footer {
        text-align: center;
        padding: 15px;
        font-size: 0.95em;
        flex-direction: column;
        gap: 8px;
    }
    
    #footer_left, #footer_right, #foot_center {
        flex: none;
        min-width: auto;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 17px; /* Even larger on small phones */
    }
    
    #header h1 {
        font-size: 1.5em;
    }
    
    #nav ul {
        gap: 10px;
        padding: 0 5px;
    }
    
    #nav a {
        padding: 5px 8px;
        font-size: 13px;
    }
    
    #content {
        padding: 15px; /* Less padding on very small screens but still comfortable */
    }
    
    #photo img {
        max-width: 250px; /* Still decent sized on small phones */
        width: 75%;
    }
    
    #main {
        font-size: 1.1em; /* Larger text on small screens */
        line-height: 1.8;
    }
    
    #footer {
        flex-direction: column;
        gap: 5px;
        padding: 12px;
    }
}

/* Tablet styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    #container {
        width: 95%;
        max-width: 800px;
    }
    
    #content {
        padding: 18px;
    }
    
    /* Navigation goes back to sidebar on desktop/tablet */
    #nav {
        position: static;
        background-color: transparent;
        box-shadow: none;
        width: 170px;
        float: left;
        padding: 0;
    }
    
    #nav h3 {
        display: block;
    }
    
    #nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    #nav a {
        color: #0066cc;
        padding: 5px 0;
        border-radius: 0;
    }
    
    #nav a:hover, #nav a.selected {
        background: transparent;
        color: #003366;
    }
    
    #main {
        width: 600px;
        float: right;
    }
    
    #about {
        width: 340px;
        margin-left: 170px;
        float: center;
        text-align: left;
        padding: 10px;
    }
}

/* Desktop styles */
@media screen and (min-width: 1025px) {
    /* Navigation goes back to sidebar on desktop */
    #nav {
        position: static;
        background-color: transparent;
        box-shadow: none;
        width: 170px;
        float: left;
        padding: 0;
    }
    
    #nav h3 {
        display: block;
    }
    
    #nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    #nav a {
        color: #0066cc;
        padding: 5px 0;
        border-radius: 0;
    }
    
    #nav a:hover, #nav a.selected {
        background: transparent;
        color: #003366;
        font-weight: bold;
    }
    
    #main {
        width: 600px;
        float: right;
    }
    
    #about {
        width: 340px;
        margin-left: 170px;
        float: center;
        text-align: left;
        padding: 10px;
    }
}

/* Print styles */
@media print {
    body {
        background-color: white;
    }
    
    #container {
        box-shadow: none;
        width: 100%;
    }
    
    #header {
        background-color: transparent;
        color: black;
        border-bottom: 2px solid #000;
    }
    
    #nav {
        display: none;
    }
    
    #footer {
        background-color: transparent;
        color: black;
        border-top: 1px solid #000;
    }
}
