/* Main stylesheet for My Engineering Project */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

header, footer {
    background-color: #f4f4f4;
    padding: 1rem;
    text-align: center;
}

main {
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
}

/* Sidebar rules are in sidebar.css */

/* layout with sidebar and ad space */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 200px;
    background: #333;
    color: #fff;
    transition: transform 0.3s ease;
    transform: translateX(-180px);
    z-index: 1000;
}
#sidebar.expanded {
    transform: translateX(0);
}
#sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 3rem 0 0 0;
}
#sidebar nav li a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 0.5rem 1rem;
}
#toggleSidebar {
    position: absolute;
    right: -40px;
    top: 10px;
    background: #333;
    color: #fff;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}
#content {
    margin-left: 200px;
    flex: 1;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}
#content.collapsed {
    margin-left: 20px;
}
#adspace {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10vh;
    background: #f4f4f4;
    text-align: center;
    padding: 1rem;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

/* make all images scale within their containers */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* avoid overlapping by giving content proper stacking context */
#content {
    position: relative;
    z-index: 1;
}

/* prevent sections with background images from collapsing */
section {
    overflow: hidden;
}


/* sub-footer inside sidebar */
#sidebar .sub-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem 0;
    background: #222;
    color: #aaa;
    text-align: center;
    font-size: 0.85rem;
}

/* mobile adjustments */
@media (max-width: 768px) {
    #sidebar {
        width: 0;
        transform: translateX(-100%);
    }
    #sidebar.expanded {
        transform: translateX(0);
    }
    #toggleSidebar {
        position: fixed;
        left: 10px;
        top: 10px;
        z-index: 1100;
    }
    #content {
        margin-left: 0;
    }
    #content.collapsed {
        margin-left: 0;
    }
    /* adjust padding and font-size for narrow screens */
    main {
        padding: 1rem;
    }
    header, footer {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}


