/* ============================================================
   paper.css — Scientific Paper Stylesheet
   ============================================================ */

:root {
  --font-body:    "Georgia", "Times New Roman", serif;
  --font-ui:      "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Courier New", monospace;
  --color-text:   #1a1a1a;
  --color-muted:  #555;
  --color-link:   #1a4e8a;
  --color-rule:   #ccc;
  --color-bg:     #fafaf8;
  --color-card:   #fff;
  --max-width:    780px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; background: var(--color-bg); color: var(--color-text); }

body {
  font-family: var(--font-body);
  line-height: 1.75;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ── Header / Title block ── */
header.paper-header { text-align: center; margin-bottom: 3rem; border-bottom: 2px solid var(--color-rule); padding-bottom: 2rem; }
header.paper-header h1 { font-size: 1.8rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.75rem; }
header.paper-header .subtitle { font-size: 1.05rem; color: var(--color-muted); font-style: italic; margin-bottom: 1rem; }
header.paper-header .authors { font-family: var(--font-ui); font-size: 0.9rem; color: var(--color-muted); }
header.paper-header .meta { font-family: var(--font-ui); font-size: 0.8rem; color: var(--color-muted); margin-top: 0.5rem; }

/* ── Abstract ── */
section.abstract {
  background: #f0f0eb;
  border-left: 4px solid #aaa;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}
section.abstract h2 { font-size: 0.85rem; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; color: var(--color-muted); }

/* ── Section headings ── */
h2 { font-size: 1.25rem; margin-top: 2.5rem; margin-bottom: 0.75rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--color-rule); }
h3 { font-size: 1.05rem; margin-top: 1.75rem; margin-bottom: 0.5rem; }
h4 { font-size: 0.95rem; margin-top: 1.25rem; margin-bottom: 0.4rem; color: var(--color-muted); }

/* ── Body text ── */
p { margin-bottom: 1rem; }
a { color: var(--color-link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #0d2e55; }

/* ── Figures ── */
figure {
  margin: 2rem 0;
  text-align: center;
}
figure img { max-width: 100%; height: auto; border: 1px solid var(--color-rule); }
figcaption { font-family: var(--font-ui); font-size: 0.82rem; color: var(--color-muted); margin-top: 0.5rem; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: 0.9rem; font-family: var(--font-ui); }
th { background: #eee; border-bottom: 2px solid #aaa; padding: 0.5rem 0.75rem; text-align: left; }
td { border-bottom: 1px solid #ddd; padding: 0.45rem 0.75rem; vertical-align: top; }
caption { caption-side: bottom; font-size: 0.8rem; color: var(--color-muted); margin-top: 0.4rem; text-align: left; }

/* ── Code / Pre ── */
code { font-family: var(--font-mono); font-size: 0.85em; background: #eee; padding: 0.1em 0.3em; border-radius: 3px; }
pre { background: #f4f4f0; border: 1px solid var(--color-rule); padding: 1rem; overflow-x: auto; font-size: 0.82rem; margin: 1.5rem 0; }

/* ── Blockquote ── */
blockquote { border-left: 3px solid #bbb; margin: 1.5rem 0; padding: 0.5rem 1.25rem; color: var(--color-muted); font-style: italic; }

/* ── Footnotes ── */
section.footnotes { margin-top: 3rem; border-top: 1px solid var(--color-rule); padding-top: 1rem; font-size: 0.82rem; font-family: var(--font-ui); color: var(--color-muted); }
section.footnotes ol { padding-left: 1.2rem; }
section.footnotes li { margin-bottom: 0.4rem; }

/* ── References ── */
section#references { margin-top: 3rem; }
section#references h2 { font-size: 1.1rem; }
ol.references { padding-left: 1.5rem; font-size: 0.88rem; font-family: var(--font-ui); }
ol.references li { margin-bottom: 0.75rem; }

/* ── Source cards (local archive links) ── */
.source-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}
.source-card .sc-icon { font-size: 1.2rem; flex-shrink: 0; }
.source-card .sc-title { font-weight: 600; }
.source-card .sc-meta  { color: var(--color-muted); font-size: 0.78rem; }

/* ── Table of Contents ── */
nav.toc { background: #f4f4f0; border: 1px solid var(--color-rule); padding: 1rem 1.5rem; margin-bottom: 2.5rem; font-family: var(--font-ui); font-size: 0.88rem; }
nav.toc h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-muted); border: none; margin-top: 0; margin-bottom: 0.5rem; padding: 0; }
nav.toc ol { padding-left: 1.2rem; }
nav.toc li { margin-bottom: 0.2rem; }

/* ── Print ── */
@media print {
  body { max-width: 100%; padding: 0; font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
  .no-print { display: none; }
}
