/* ============================================
   LEGACY ESSAY STYLES
   For academic papers originally in Pages/Word
   Helvetica, clean, pristine
   ============================================ */

:root {
    --legacy-bg: #ffffff;
    --legacy-text: #1a1a1a;
    --legacy-text-muted: #555;
    --legacy-text-faint: #888;
    --legacy-accent: #0066cc;
    --legacy-border: #ddd;
    --legacy-code-bg: #f5f5f5;
    
    /* Dark mode */
    --legacy-dark-bg: #1c1c1c;
    --legacy-dark-text: #e8e8e8;
    --legacy-dark-text-muted: #aaa;
    --legacy-dark-text-faint: #777;
    --legacy-dark-accent: #6cb4ff;
    --legacy-dark-border: #3a3a3a;
    --legacy-dark-code-bg: #2a2a2a;
}

@media (prefers-color-scheme: dark) {
    :root {
        --legacy-bg: var(--legacy-dark-bg);
        --legacy-text: var(--legacy-dark-text);
        --legacy-text-muted: var(--legacy-dark-text-muted);
        --legacy-text-faint: var(--legacy-dark-text-faint);
        --legacy-accent: var(--legacy-dark-accent);
        --legacy-border: var(--legacy-dark-border);
        --legacy-code-bg: var(--legacy-dark-code-bg);
    }
}

[data-theme="dark"] {
    --legacy-bg: var(--legacy-dark-bg);
    --legacy-text: var(--legacy-dark-text);
    --legacy-text-muted: var(--legacy-dark-text-muted);
    --legacy-text-faint: var(--legacy-dark-text-faint);
    --legacy-accent: var(--legacy-dark-accent);
    --legacy-border: var(--legacy-dark-border);
    --legacy-code-bg: var(--legacy-dark-code-bg);
}

[data-theme="light"] {
    --legacy-bg: #ffffff;
    --legacy-text: #1a1a1a;
    --legacy-text-muted: #555;
    --legacy-text-faint: #888;
    --legacy-accent: #0066cc;
    --legacy-border: #ddd;
    --legacy-code-bg: #f5f5f5;
}

/* ============================================
   BASE
   ============================================ */

.legacy-essay {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.6;
    color: var(--legacy-text);
    background: var(--legacy-bg);
    max-width: 8.5in;
    margin: 0 auto;
    padding: 0.75in 1in;
}

@media screen {
    .legacy-essay {
        max-width: 720px;
        padding: 2rem 1.5rem 4rem;
    }
}

/* ============================================
   HEADER / TITLE BLOCK
   ============================================ */

.legacy-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--legacy-border);
}

.legacy-header h1 {
    font-size: 18pt;
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.legacy-header .subtitle {
    font-size: 12pt;
    font-weight: 400;
    color: var(--legacy-text-muted);
    margin: 0 0 1rem;
}

.legacy-header .meta {
    font-size: 10pt;
    color: var(--legacy-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   SECTION HEADINGS
   ============================================ */

.legacy-essay h2 {
    font-size: 14pt;
    font-weight: 600;
    margin: 2rem 0 1rem;
    padding-top: 0.5rem;
}

.legacy-essay h3 {
    font-size: 12pt;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.legacy-essay h4 {
    font-size: 11pt;
    font-weight: 600;
    font-style: italic;
    margin: 1.25rem 0 0.5rem;
}

/* ============================================
   BODY TEXT
   ============================================ */

.legacy-essay p {
    margin: 0 0 1rem;
    text-align: justify;
    hyphens: auto;
}

.legacy-essay p:first-of-type {
    text-indent: 0;
}

/* Optional: traditional paragraph indentation instead of spacing */
.legacy-essay.indented p {
    margin-bottom: 0;
    text-indent: 0.5in;
}

.legacy-essay.indented p:first-of-type,
.legacy-essay.indented h2 + p,
.legacy-essay.indented h3 + p,
.legacy-essay.indented blockquote + p {
    text-indent: 0;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

.legacy-essay blockquote {
    margin: 1.5rem 0;
    padding: 0 0 0 1.5rem;
    border-left: 2px solid var(--legacy-border);
    font-style: italic;
    color: var(--legacy-text-muted);
}

.legacy-essay blockquote p {
    margin-bottom: 0.5rem;
}

.legacy-essay blockquote cite,
.legacy-essay blockquote .attribution {
    display: block;
    font-style: normal;
    font-size: 10pt;
    margin-top: 0.5rem;
    color: var(--legacy-text-faint);
}

.legacy-essay blockquote .attribution::before {
    content: "— ";
}

/* ============================================
   LISTS
   ============================================ */

.legacy-essay ul,
.legacy-essay ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legacy-essay li {
    margin-bottom: 0.4rem;
}

.legacy-essay li p {
    margin-bottom: 0.4rem;
}

/* ============================================
   LINKS
   ============================================ */

.legacy-essay a {
    color: var(--legacy-accent);
    text-decoration: none;
}

.legacy-essay a:hover {
    text-decoration: underline;
}

/* ============================================
   FOOTNOTES
   ============================================ */

.legacy-essay .footnote-ref {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
}

.legacy-essay .footnotes {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--legacy-border);
    font-size: 10pt;
}

.legacy-essay .footnotes ol {
    padding-left: 1.25rem;
}

.legacy-essay .footnotes li {
    margin-bottom: 0.75rem;
    color: var(--legacy-text-muted);
}

/* ============================================
   FIGURES & IMAGES
   ============================================ */

.legacy-essay figure {
    margin: 2rem 0;
    text-align: center;
}

.legacy-essay figure img {
    max-width: 100%;
    height: auto;
}

.legacy-essay figcaption {
    font-size: 10pt;
    color: var(--legacy-text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Hand-drawn figures styling */
.legacy-essay .figure-sketch {
    background: var(--legacy-code-bg);
    padding: 1rem;
    border-radius: 4px;
}

/* ============================================
   CODE
   ============================================ */

.legacy-essay code {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    background: var(--legacy-code-bg);
    padding: 0.15em 0.3em;
    border-radius: 3px;
}

.legacy-essay pre {
    background: var(--legacy-code-bg);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.legacy-essay pre code {
    background: none;
    padding: 0;
}

/* ============================================
   LINKS SECTION (bibliography style)
   ============================================ */

.legacy-essay .links-section {
    margin-top: 2rem;
}

.legacy-essay .links-section h2 {
    font-size: 12pt;
}

.legacy-essay .links-section p {
    font-size: 10pt;
    margin-bottom: 0.75rem;
    text-align: left;
}

.legacy-essay .links-section a {
    word-break: break-all;
}

/* ============================================
   PAGE NUMBER (for print)
   ============================================ */

.legacy-essay .page-indicator {
    font-size: 9pt;
    color: var(--legacy-text-faint);
    text-align: right;
    margin-bottom: 1rem;
}

/* ============================================
   NAVIGATION (minimal)
   ============================================ */

.legacy-nav {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10pt;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.legacy-nav a {
    color: var(--legacy-text-muted);
    text-decoration: none;
}

.legacy-nav a:hover {
    color: var(--legacy-accent);
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .legacy-essay {
        max-width: none;
        padding: 0;
        font-size: 11pt;
    }
    
    .legacy-nav {
        display: none;
    }
    
    .legacy-essay a {
        color: inherit;
        text-decoration: underline;
    }
    
    .legacy-essay blockquote {
        border-left-color: #999;
    }
}

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

@media (max-width: 600px) {
    .legacy-essay {
        padding: 1.5rem 1rem 3rem;
        font-size: 10pt;
    }
    
    .legacy-essay p {
        text-align: left;
    }
    
    .legacy-header h1 {
        font-size: 16pt;
    }
}
