body {
    max-width: 900px;
    margin: 40px auto;
    /* The 'auto' here handles the horizontal centering */
    padding: 0 20px;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
    color: #222;
    background: #fafafa;
    display: flex;
    text-align: justify;
}

h1 {
    border-bottom: 2px solid #333;
    padding-bottom: .4em;
}

h1 a,
h1 a:visited,
h1 a:hover,
h1 a:active {
    color: black;
    text-decoration: none;
}

h2 {
    margin-top: 2em;
    border-bottom: 1px solid #ccc;
    padding-bottom: .2em;
}

h3 {
    margin-top: 1.5em;
    color: #555;
}

ul {
    margin-top: .4em;
}

li {
    margin-bottom: .45em;
}

a {
    color: #003399;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

footer {
    margin-top: 4em;
    font-size: .9em;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 1em;
}

.sidebar {
    width: 250px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    padding: 1rem;
    background: #f5f5f5;
    height: fit-content;
}

.content {
    flex: 1;
    padding: 2rem;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        /* Stacks the sidebar and content vertically */
        margin: 20px auto;
        /* Reduces the top/bottom margin to save space */
        padding: 0 15px;
    }

    .sidebar {
        width: 100%;
        /* Makes the sidebar take up the full width */
        position: static;
        /* Turns off 'sticky' so it doesn't follow you down the page */
        margin-bottom: 20px;
        box-sizing: border-box;
        /* Ensures padding doesn't make it overflow */
    }

    .content {
        padding: 0;
        /* Removes extra padding to maximize screen space */
    }
}