@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;700&family=Playfair+Display:wght@700&display=swap');

/* ===== Base (mobile-first) ===== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Merriweather', serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #2a2a2a;
    -webkit-font-smoothing: antialiased;
}

/* --- Hamburger (mobile only) --- */

#hamburger {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.5rem;
    padding: 4px 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    line-height: 1;
}

#nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

/* --- Sidebar (slide-over on mobile) --- */

#nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    padding: 50px 15px 15px;
    overflow-y: auto;
    background-color: #fafafa;
    border-right: 1px solid #eee;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

#nav[data-wide="true"] {
    display: block;
}

#nav-header {
    cursor: pointer;
}

/* --- Top nav menu --- */

ul.menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow-x: auto;
}

li.menu-item {
    display: inline-block;
    margin-right: 10px;
}

/* --- Main content area --- */

#view {
    flex: 1;
    padding: 10px 15px;
    overflow-y: auto;
}

/* --- Post list --- */

#pdf-list {
    list-style-type: none;
    padding: 0;
}

#pdf-list li {
    background-color: #fff;
}

.pdf-link {
    display: block;
    margin-bottom: 8px;
    text-decoration: none;
    color: #333;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.pdf-link:hover {
    background-color: #f0f0f0;
}

#pdf-list p.selected {
    background-color: #eee;
}

/* --- Post name truncation on mobile --- */

.postName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Post date hidden on mobile --- */

.postedDate {
    display: none;
}

/* --- Post content --- */

#post-content {
    padding: 0;
    margin: 0;
    width: 100%;
    min-height: 60vh;
}

/* --- Quotes ticker --- */

#quotes {
    font-size: x-small;
    color: #efefef;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
    position: relative;
}

#quotes-text {
    position: absolute;
    right: 0;
    white-space: nowrap;
}

/* --- Posts toggle button (mobile) --- */

.postsToggler a {
    font-size: 0.75em;
    text-decoration: none;
    color: #2c3e50;
}

/* ===== Desktop (min-width: 768px) ===== */

@media (min-width: 768px) {
    body {
        flex-direction: row;
        height: 100vh;
    }

    #hamburger, #nav-overlay {
        display: none;
    }

    #nav {
        display: block;
        position: static;
        width: 20%;
        max-width: none;
        height: auto;
        max-height: 100vh;
        padding: 20px;
        border-bottom: none;
        border-right: 1px solid #eee;
        box-shadow: none;
    }

    #view {
        padding: 20px;
        max-height: 100vh;
    }

    .postName {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .postedDate {
        display: block;
    }

    #quotes {
        width: 300px;
    }
}
