/* ==========================================================================
   ACTUAL PROFIT — 12-PART DIGITAL MONOGRAPH READING SYSTEM STYLESHEET
   Authoritative Reference: redesign roadmap.docx (Parts 6, 7, 8, 10, 15, 17, 18, 23)
   ========================================================================== */

@import url('../../css/research-tokens.css');

/* --------------------------------------------------------------------------
   1. MONOGRAPH LAYOUT SHELL (Desktop 2-Column: Sidebar + 800px Reading Core)
   -------------------------------------------------------------------------- */
.monograph-shell {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: var(--max-site-width);
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 3vw, 2rem);
    gap: var(--space-8);
    position: relative;
}

/* Sticky Left Sidebar (Desktop) */
.toc-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    padding: 1.25rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.toc-sidebar__title {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding-bottom: 0.65rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-sidebar__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.toc-sidebar__item a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    border-radius: 2px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.35;
    transition: background 0.1s ease, color 0.1s ease;
}

.toc-sidebar__item a:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

.toc-sidebar__item.is-active a {
    background: var(--accent-gold-subtle);
    color: var(--accent-gold);
    font-weight: 600;
    border-left: 2px solid var(--accent-gold);
}

.toc-sidebar__num {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.toc-sidebar__item.is-active .toc-sidebar__num {
    color: var(--accent-gold);
}

/* Central Reading Body (Strict 800px / 65ch Max Width) */
.monograph-reading-body {
    width: 100%;
    max-width: var(--max-content-width, 800px);
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   2. MONOGRAPH ARTICLE TYPOGRAPHY & APCA CONTRAST
   -------------------------------------------------------------------------- */
.monograph-header {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.monograph-chapter-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-3);
}

.monograph-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

.monograph-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: var(--space-4);
}

.monograph-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

/* Prose Paragraphs */
.monograph-content p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    max-width: 100%;
}

.monograph-content p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.monograph-content p em {
    color: #e4e4e7;
    font-style: italic;
}

/* Proprietary Verdict Highlight Box */
.verdict-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-gold);
    border-radius: 2px;
    padding: 1.35rem 1.65rem;
    margin: var(--space-8) 0;
}

.verdict-box__title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-gold);
    margin-bottom: 0.4rem;
}

.verdict-box__content {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-primary);
    font-weight: 500;
}

.verdict-box p:last-child {
    margin-bottom: 0;
}

/* Section Subheadings inside Monograph */
.monograph-content h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

.monograph-content h3 {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

/* --------------------------------------------------------------------------
   3. SEQUENTIAL PAGINATION & CITATION FOOTER
   -------------------------------------------------------------------------- */
.monograph-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-subtle);
}

.pagination-btn {
    display: inline-flex;
    flex-direction: column;
    padding: 0.85rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    text-decoration: none;
    transition: border-color 0.1s ease;
    min-width: 200px;
}

.pagination-btn:hover {
    border-color: var(--accent-gold);
}

.pagination-btn__dir {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.pagination-btn__title {
    font-family: var(--font-serif);
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.pagination-btn.is-next {
    text-align: right;
    margin-left: auto;
}

/* Monograph Citation Block */
.monograph-citation-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 1.25rem 1.5rem;
    margin-top: var(--space-8);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.monograph-citation-box strong {
    color: var(--accent-gold);
}

/* --------------------------------------------------------------------------
   4. SLIDE-OUT TOC DRAWER (MOBILE / RESPONSIVE)
   -------------------------------------------------------------------------- */
.toc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 998;
}

.toc-overlay.is-active {
    display: block;
}

.toc-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 85vw);
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    z-index: 999;
    padding: 1.5rem;
    flex-direction: column;
    overflow-y: auto;
}

.toc-drawer.is-active {
    display: flex;
}

.toc-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.toc-drawer__title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
}

.toc-drawer__close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.toc-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.toc-nav-item a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 2px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.toc-nav-item.is-current a {
    background: var(--accent-gold-subtle);
    color: var(--accent-gold);
    font-weight: 600;
    border-left: 2px solid var(--accent-gold);
}

.toc-nav-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .toc-sidebar {
        display: none;
    }
}
