/* styles.css */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family: 'Open Sans', sans-serif;
    background: #ffffff;
    color: #141414;
    display: flex;
    flex-direction: column;
}

.chapter-link {
    text-decoration: none;
    color: inherit;
}

.chapter-link:hover {
    opacity: 0.8;
    color: rgb(0, 149, 255);;
}

.header{
    text-align:center;
    padding:60px 20px 40px;
}

.header h1{
    font-size:4rem;
    font-weight:500;
}

.subtitle{
    margin-top:12px;
    font-size:1.2rem;
    color:#373737;
    font-style:italic;
}

.author{
    margin-top:12px;
    font-size: 0.9rem;
    color:#595959;
}

.container{
    width: 70%;
    align-self: center;
    display:flex;
    flex-direction: row;
    justify-content: space-between;
}

.sidebar{
    padding:40px 25px;
    border-right:1px solid #ddd;
    width: 25%;
}

.sidebar h3{
    margin-bottom:25px;
    font-size:0.9rem;
    text-transform:uppercase;
    letter-spacing:2px;
}

.nav-item{
    display:block;
    width:100%;
    text-align:left;
    text-decoration:none;
    color:#111;
    padding:12px;
    margin-bottom:8px;
    cursor:pointer;
    font-size:0.8rem;
    border-radius:6px;
}

.nav-item:hover{
    background:#cde3f1;
}

.nav-item.active{
    color:rgb(0, 149, 255);
    font-weight: 600;
}

.content{
    padding:60px;
    width: 75%;
}

.page{
    display:none;
}

.page{
    display:block;
}

.page h2{
    font-size:1.8rem;
    font-weight: 400;
    margin-bottom:20px;
}

.page h3{
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 30px;
}

.page p{
    font-size:0.9rem;
    line-height:1.5;
    margin-bottom:22px;
}


footer{
    display: flex;
    align-self: center;
    margin-top: 50px;
    font-size: 0.7rem;
    margin-bottom: 20px;
}

hr {
    border: none;
    height: 1px;
    background-color: #141414;
    opacity: 0.15;
    margin: 40px 0;
}

#citem{
    font-size: 1rem;
    font-weight: 400;
}

#ccitem{
    font-weight: 300;
    max-width: 100%;
    margin-left: 50px;
}

.book-figure {
    margin: 40px 0;
}

.book-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.book-figure figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* ─────────────────────────────────────────
   HAMBURGER BUTTON (injected by mobile.js)
───────────────────────────────────────── */
.hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #141414;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* animated X state */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* dim overlay behind open sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 900;
}

.sidebar-overlay.visible {
    display: block;
}

/* ─────────────────────────────────────────
   MOBILE BREAKPOINT  ≤ 768px
───────────────────────────────────────── */
@media (max-width: 768px) {

    .hamburger {
        display: flex;
    }

    .header {
        padding: 50px 20px 30px;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .container {
        width: 100%;
        flex-direction: column;
    }

    /* sidebar becomes a fixed drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px;
        z-index: 950;
        background: #ffffff;
        border-right: 1px solid #ddd;
        padding: 60px 20px 40px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* content takes full width */
    .content {
        width: 100%;
        padding: 30px 20px 60px;
    }

    #ccitem {
        margin-left: 0;
    }
}