/* ===== Base layout ===== */

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Verdana, sans-serif;

    /* Center the whole page (nav + content + footer) */
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;

    /* 2-column grid: left = nav, right = content */
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-areas:
        "header header"
        "nav    content"
        "footer footer";
    column-gap: 24px;
}

/* ===== Areas in the grid ===== */

h1#Content {
    grid-area: header;
    margin: 0 0 16px 0;
    max-width: 700px;
}

aside, nav, article, footer {
    display: block;
}

aside.NavSidebar {
    grid-area: nav;
    border: 1px solid black;
    padding: 8px 0;
}

nav.Sidebar {
    margin: 0 12px;
    text-align: left;
}

main {
    grid-area: content;
}

article.Content {
    max-width: 700px;
    text-align: left;
}

/* Footer under both columns */
footer {
    grid-area: footer;
    margin-top: 24px;
    font-size: small;
    max-width: 925px;
}

/* ===== Typography & spacing ===== */

p {
    margin-top: 0;
    margin-bottom: 16px;
}

/* This selector doesn’t match anything right now but kept from old CSS */
h2 p {
    text-indent: 20px;
}

.links {
    padding-top: 15px;
}

.back {
    margin-bottom: 48px;
}

dt {
    margin-left: 40px;
    margin-right: 8px;
    margin-bottom: 8px;
}

dd {
    margin-top: 0;
    margin-right: 8px;
    margin-bottom: 24px;
    margin-left: 80px;
}

/* ===== Tables (fair use notice) ===== */

table {
    width: 100%;
    border: 1px solid black;
    border-collapse: collapse;
}

td {
    text-align: left;
    vertical-align: top;
    padding: 5px;
}

/* ===== Responsive behavior for phones / narrow screens ===== */

@media (max-width: 768px) {
    body {
        /* Switch to single column stack */
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "nav"
            "content"
            "footer";
    }

    aside.NavSidebar {
        border-width: 0 0 1px 0;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    article.Content {
        max-width: 100%;
    }

    footer {
        max-width: 100%;
    }
}

