/* ============================================================================
   STAPLEDON RECONSTRUCTED LECTURES - LIGHT THEME
   Two-column layout: Notes | Reconstructed Prose
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Sans+Pro:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --bg-page: #faf8f5;
    --bg-notes: #f5f2ed;
    --bg-prose: #fffdf9;
    --bg-marginal: #eeeae3;
    --text-primary: #2c2416;
    --text-secondary: #5a4d3a;
    --text-muted: #8a7d6a;
    --text-heading: #1a1610;
    --accent-gold: #a67c3d;
    --accent-red: #8b3a3a;
    --border-light: #d4cfc5;
    --border-section: #c4bfb5;
    --shadow-soft: 0 2px 8px rgba(44, 36, 22, 0.08);
    --font-serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
    --font-sans: 'Source Sans Pro', 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-serif);
    background-color: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.7;
}

/* Reset link colors globally */
a {
    color: inherit;
    text-decoration: none;
}

a:visited {
    color: inherit;
}

/* ============================================================================
   TOP NAVIGATION
   ============================================================================ */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    z-index: 1000;
}

.nav-left .back-button {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .nav-left .back-button:hover {
        background-color: var(--bg-marginal);
        color: var(--text-primary);
    }
}

.nav-left .back-button .arrow {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    line-height: 1;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--accent-gold);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (hover: hover) {
    .theme-toggle:hover {
        background-color: var(--bg-marginal);
    }
}

.theme-icon-dark { display: none; }
body.dark-mode .theme-icon-light { display: none; }
body.dark-mode .theme-icon-dark { display: inline-block; }

/* ============================================================================
   PAGE HEADER
   ============================================================================ */

.page-header {
    text-align: center;
    padding: 5rem 2rem 2rem 2rem;
    background: linear-gradient(180deg, var(--bg-marginal) 0%, var(--bg-page) 100%);
    border-bottom: 1px solid var(--border-light);
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 0.5rem 0;
}

.page-header .subtitle {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    margin: 0;
}

.page-header .meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-family: var(--font-sans);
}

/* ============================================================================
   TWO-COLUMN LAYOUT
   ============================================================================ */

.two-column-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: dense;
    gap: 0;
    max-width: 1600px;
    margin: 0 auto;
}

.column-header {
    position: sticky;
    top: 3rem;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid var(--border-section);
}

.notes-column .column-header {
    background: var(--bg-notes);
    color: var(--accent-gold);
}

.prose-column .column-header {
    background: var(--bg-prose);
    color: var(--accent-red);
}

.notes-column {
    background: var(--bg-notes);
    border-right: 1px solid var(--border-section);
}

.prose-column {
    background: var(--bg-prose);
}

/* ============================================================================
   SECTION BLOCKS (aligned across columns)
   ============================================================================ */

.section-block {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    min-height: 150px;
}

.section-block:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-light);
}

/* ============================================================================
   NOTES COLUMN STYLING
   ============================================================================ */

.notes-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.notes-content .line {
    margin: 0.3rem 0;
}

.notes-content .indent-1 { margin-left: 1.5rem; }
.notes-content .indent-2 { margin-left: 3rem; }
.notes-content .indent-3 { margin-left: 4.5rem; }
.notes-content .indent-4 { margin-left: 6rem; }

.notes-content .section-heading {
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    color: var(--text-heading);
}

.notes-content u {
    text-decoration-color: var(--accent-gold);
    text-decoration-thickness: 1px;
}

.notes-content .marginal-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0.5rem 0;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-light);
}

.notes-content .symbol {
    color: var(--accent-gold);
}

/* ============================================================================
   PROSE COLUMN STYLING
   ============================================================================ */

.prose-content {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
    hyphens: auto;
}

.prose-content p {
    margin: 0 0 1rem 0;
    text-indent: 1.5rem;
}

.prose-content p:first-child {
    text-indent: 0;
}

.prose-content p::first-letter {
    font-size: 1.1em;
}

.prose-content em {
    color: var(--text-secondary);
}

.prose-content strong {
    font-weight: 600;
    color: var(--text-heading);
}

.prose-content blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 3px solid var(--accent-gold);
    background: var(--bg-marginal);
    font-style: italic;
}

/* ============================================================================
   PAGE SECTIONS
   ============================================================================ */

.page-divider {
    grid-column: 1 / -1;
    padding: 0.5rem 1.5rem;
    background: var(--bg-marginal);
    border-top: 1px solid var(--border-section);
    border-bottom: 1px solid var(--border-section);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.page-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background: var(--bg-marginal);
    border-top: 1px solid var(--border-section);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-sans);
}

/* ============================================================================
   INDEX PAGE STYLES
   ============================================================================ */

.archive-header {
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.archive-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.archive-header .subtitle {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.archive-header .description {
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.archive-header .note {
    max-width: 700px;
    margin: 0 auto 2rem auto;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    font-style: italic;
}

.lecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
}

.lecture-card {
    background: var(--bg-prose);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .lecture-card:hover {
        box-shadow: 0 6px 15px rgba(44, 36, 22, 0.15);
        border-color: var(--accent-gold);
    }
}

.lecture-card .lecture-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.lecture-card .lecture-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.lecture-card .lecture-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    line-height: 1.5;
}

.archive-footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.archive-footer .footer-link {
    margin-top: 1rem;
}

.archive-footer .footer-link a {
    color: var(--accent-gold);
    text-decoration: underline;
    font-weight: 500;
}

@media (hover: hover) {
    .archive-footer .footer-link a:hover {
        color: var(--text-primary);
    }
}

/* ============================================================================
   MOBILE VIEW TOGGLE
   ============================================================================ */

.mobile-view-toggle {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-marginal);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 0.25rem;
    gap: 0;
    overflow: hidden;
}

.mobile-view-toggle button {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 16px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-view-toggle button.active {
    background: var(--accent-gold);
    color: #fff;
}

@media (hover: hover) {
    .mobile-view-toggle button:not(.active):hover {
        color: var(--text-primary);
    }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 900px) {
    .mobile-view-toggle {
        display: flex;
    }
    
    .two-column-container {
        grid-template-columns: 1fr;
    }
    
    /* Hide column headers on mobile - we use the toggle instead */
    .column-header {
        display: none;
    }
    
    /* Default: show reconstruction, hide notes */
    .notes-column {
        display: none;
        border-right: none;
    }
    
    .prose-column {
        display: block;
    }
    
    /* When showing notes view */
    body.mobile-view-notes .notes-column {
        display: block;
    }
    
    body.mobile-view-notes .prose-column {
        display: none;
    }
    
    /* Ensure footer always shows */
    .page-footer {
        display: block !important;
    }
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-marginal);
}

::-webkit-scrollbar-thumb {
    background: var(--border-section);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================================
   SELECTION
   ============================================================================ */

::selection {
    background: rgba(166, 124, 61, 0.25);
    color: var(--text-heading);
}

