/* Premium Editorial Theme - "Intriguing & Clean" */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@400&display=swap');

:root {
    --bg-main: #f8f5f2;
    /* Warm, paper-like off-white */
    --bg-sidebar: #0f1115;
    /* Deep space black */
    --text-main: #2a2a2a;
    --text-sidebar: #9a9ca1;
    --accent: #ff5252;
    /* Striking coral red for minimalist intrigue */
    --accent-hover: #ff7b7b;
    --border: #e0e0e0;
    --sidebar-width: 320px;
    --max-width: 760px;
    /* Optimal reading width */
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    /* Clean san-serif base for modern feel */
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.layout {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    padding: 4rem 2.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 5rem;
}

.sidebar-header a {
    color: #fff;
    font-family: 'Playfair Display', serif;
    /* Serif logic in headers */
    font-weight: 700;
    font-size: 1.8rem;
    text-decoration: none;
    line-height: 1.2;
    display: block;
    letter-spacing: -0.02em;
}

.author-subtitle {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #666;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sidebar-link {
    color: var(--text-sidebar);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
    opacity: 0.7;
}

.sidebar-link:hover {
    color: #fff;
    opacity: 1;
    transform: translateX(5px);
}

.sidebar-link.active {
    color: #fff;
    font-weight: 500;
    opacity: 1;
}

.sidebar-link.active::before {
    content: '—';
    position: absolute;
    left: -20px;
    color: var(--accent);
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 8rem 8rem;
    max-width: 100%;
    background: var(--bg-main);
}

/* Typography & Decoration */
.chapter-header {
    margin-bottom: 6rem;
    text-align: left;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.chapter-number {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    /* Technical feel */
    font-size: 0.8rem;
    background: #000;
    color: #fff;
    padding: 4px 10px;
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #111;
}

.text-body {
    font-family: 'Playfair Display', serif;
    /* Serif for body = "Book" feel */
    font-size: 1.4rem;
    line-height: 1.8;
    max-width: var(--max-width);
    margin: 0 auto;
    color: #222;
}

/* Images in text */
.text-body img {
    max-width: 120%;
    /* Break out of column slightly */
    width: 120%;
    margin-left: -10%;
    height: auto;
    margin-top: 4rem;
    margin-bottom: 4rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    filter: grayscale(20%) contrast(105%);
    /* Artistic touch */
    border-radius: 4px;
}

h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-top: 5rem;
    margin-bottom: 2rem;
    color: #000;
    letter-spacing: -0.02em;
}

h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--accent);
    text-transform: uppercase;
}

p {
    margin-bottom: 2em;
    font-weight: 400;
}

strong {
    font-weight: 700;
    color: #000;
}

blockquote {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-style: italic;
    color: #555;
    border-left: none;
    margin: 4rem 0;
    padding: 0 4rem;
    text-align: center;
    line-height: 1.6;
}

blockquote::before {
    content: "“";
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    color: var(--accent);
    display: block;
    line-height: 1;
    margin-bottom: 1rem;
}

/* Navigation Buttons */
.chapter-footer-nav {
    max-width: var(--max-width);
    margin: 8rem auto 0;
    padding-top: 4rem;
    display: flex;
    justify-content: space-between;
}

.nav-btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-decoration: none;
    color: #111;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--accent);
    transform: translateX(5px);
}

.nav-btn.prev:hover {
    transform: translateX(-5px);
}

/* Gate */
.gate-modal {
    background: rgba(15, 17, 21, 0.95) !important;
    border: 1px solid #333 !important;
    color: #fff !important;
}

.gate-title {
    color: #fff !important;
}

.gate-text {
    color: #aaa !important;
}

/* Mobile */
@media (max-width: 1100px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 2rem;
    }

    .text-body img {
        width: 100%;
        margin-left: 0;
    }

    h1 {
        font-size: 3rem;
    }

    .text-body {
        font-size: 1.2rem;
        padding: 0;
    }
}