.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.3rem;
    padding-top: 0.5rem;
    border-bottom: 1px solid #ccc;
    margin: 0 auto;
    width: calc(100% - 40px);
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: inherit;
}

.header-menu {
    display: flex;
    gap: 15px;
}

@media screen and (max-width: 480px) {
    .header-menu {
        display: none;
    }
}

.header a {
    text-decoration: none;
    color: #333;
    padding: 5px;
    margin: 5px;
    border-top: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
}

.header a:hover {
    border-top: 1px solid blue;
    color: blue;
}

.container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid #ccc;
    margin: 0 auto;
    width: calc(100% - 40px);
}

.section {
    /* margin-top: 2rem; */
    /* margin-bottom: 1.2rem; */
    padding: 0.5rem;
    max-width: 100%;
}

.toc {
    margin-top: 4.5rem;
    margin-right: 1.5rem;
    padding-top: 1rem;
    padding-right: 1rem;
    width: 250px;
    border-right: 1px solid #ccc;
    position: sticky;
    top: 50px;
    max-height: 100vh;
    overflow-y: auto;
}

@media screen and (max-width: 480px) {
    .container {
        margin: 15px;
        flex-direction: column;
        align-items: center;
        /* max-width: 90%; */
    }

    .toc {
        display: none;
    }
}

/* Table of Contents */
/* remove default list styling */
.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin-bottom: 0.6rem;
}

.toc li a {
    text-decoration: none;
    color: #333;
    font-size: 1rem;
}

.toc li a:hover {
    text-decoration: underline;
    color: blue;
    font-weight: bold;
}


.content {
    margin-top: 1rem;
    padding: 1rem;
    width: 100%;
}

@media screen and (max-width: 480px) {
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: auto;
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
}

.blog-title {
    margin-bottom: 1rem;
    /* border-bottom: 1px solid #ccc; */
}

.blog-title span {
    font-size: 1.5rem;
    margin: 0;
}

.blog-title p {
    margin: 1.5rem 0 0.5rem 0;
    color: #555;
    font-style: italic;
    font-size: 1rem;
}

.stat {
    font-size: 0.9rem;
    color: #777;
    margin-top: 0.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;

    gap: 0.25rem;
}

/* Mobile Menu Container */
.mobile-menu-container {
    display: none;
    /* Hidden on desktop */
}

@media screen and (max-width: 480px) {
    .mobile-menu-container {
        display: block;
        position: relative;
    }

    .mobile-menu-checkbox {
        display: none;
        /* Hide the actual checkbox */
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 1001;
        position: relative;
    }

    .mobile-menu-btn span {
        display: block;
        height: 3px;
        width: 100%;
        background-color: #333;
        border-radius: 3px;
        transition: all 0.3s ease;
        transform-origin: left center;
    }

    /* Transform hamburger into X on check */
    .mobile-menu-checkbox:checked+.mobile-menu-btn span:nth-child(1) {
        transform: rotate(45deg);
    }

    .mobile-menu-checkbox:checked+.mobile-menu-btn span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-checkbox:checked+.mobile-menu-btn span:nth-child(3) {
        transform: rotate(-45deg);
    }

    /* The sliding menu */
    .mobile-menu {
        position: absolute;
        top: 35px;
        /* Adjust based on header/button height */
        right: 0;
        background-color: var(--ereader-sepia, #FFF8DC);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        width: 200px;
        overflow: hidden;
        /* Slide down animation using max-height */
        max-height: 0;
        opacity: 0;
        transition: all 0.4s ease;
        z-index: 1000;
        border: 1px solid transparent;
    }

    .mobile-menu a {
        display: block;
        padding: 5px 20px;
        text-decoration: none;
        color: #333;
        font-weight: 600;
        border-bottom: 1px solid #eee;
        transition: background-color 0.2s ease;
    }

    .mobile-menu a:last-child {
        border-bottom: none;
    }

    .mobile-menu a:hover {
        background-color: rgba(0, 0, 0, 0.05);
        color: blue;
    }

    /* Reveal menu when checked */
    .mobile-menu-checkbox:checked~.mobile-menu {
        max-height: 400px;
        overflow-y: scroll;
        /* Larger than expected content height */
        opacity: 1;
        border-color: #ccc;
        scroll-behavior: auto;
    }
}