/* GemmaCure Research Paper — LaTeX-inspired academic layout */

html, body {
  margin: 0;
  padding: 0;
  background: #f0f0f0;
}

.paper-wrap {
  background: #fff;
  color: #111;
  font-family: "Georgia", "Palatino Linotype", "Times New Roman", serif;
  line-height: 1.55;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

/* ── Top toolbar ──────────────────────────────────────────── */
.paper-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 28px;
  background: #f4f4f4;
  border-bottom: 1px solid #ddd;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  color: #444;
  position: sticky;
  top: 0;
  z-index: 50;
}
.paper-toolbar a { color: #1a56db; text-decoration: none; }
.paper-toolbar a:hover { text-decoration: underline; }
.paper-toolbar-actions { display: flex; gap: 10px; }
.paper-btn {
  padding: 5px 14px;
  border-radius: 5px;
  border: 1px solid #bbb;
  background: #fff;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  color: #333;
}
.paper-btn:hover { background: #e8e8e8; }
.paper-btn-primary {
  background: #1a56db;
  border-color: #1a56db;
  color: #fff;
}
.paper-btn-primary:hover { background: #1447b5; }

/* ── Paper document ───────────────────────────────────────── */
.paper-doc {
  max-width: 900px;
  margin: 32px auto 60px;
  padding: 56px 64px;
  background: #fff;
  box-shadow: 0 2px 24px rgba(0,0,0,0.08);
  border: 1px solid #e0e0e0;
}

/* ── Title block ──────────────────────────────────────────── */
.paper-title {
  font-size: 1.7rem;
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 18px;
  color: #000;
}

.paper-authors {
  text-align: center;
  font-size: 1.02rem;
  margin-bottom: 6px;
  color: #222;
}
.paper-authors sup { font-size: 0.72em; color: #555; }

.paper-affiliations {
  text-align: center;
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 4px;
  font-style: italic;
}

.paper-date {
  text-align: center;
  font-size: 0.82rem;
  color: #777;
  margin-bottom: 28px;
}

.paper-divider {
  border: none;
  border-top: 1px solid #aaa;
  margin: 18px 0;
}

/* ── Abstract ─────────────────────────────────────────────── */
.paper-abstract-block {
  margin: 0 auto 28px;
  padding: 0 40px;
}
.paper-abstract-block .abstract-title {
  text-align: center;
  font-weight: bold;
  font-size: 0.92rem;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.paper-abstract-block p {
  font-size: 0.88rem;
  text-align: justify;
  line-height: 1.6;
  color: #222;
}
.paper-keywords {
  font-size: 0.82rem;
  margin-top: 10px;
  color: #444;
}
.paper-keywords strong { font-style: italic; }

/* ── Two-column body ──────────────────────────────────────── */
.paper-body {
  column-count: 2;
  column-gap: 36px;
  column-rule: 1px solid #ddd;
  font-size: 0.88rem;
  text-align: justify;
  hyphens: auto;
}

/* ── Sections ─────────────────────────────────────────────── */
.paper-section {
  break-inside: avoid-column;
  margin-bottom: 16px;
}
.paper-section h2 {
  font-size: 0.95rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 22px 0 8px;
  color: #000;
  border-bottom: 0.5px solid #bbb;
  padding-bottom: 2px;
}
.paper-section h3 {
  font-size: 0.88rem;
  font-weight: bold;
  font-style: italic;
  margin: 14px 0 5px;
  color: #111;
}
.paper-section p {
  margin-bottom: 9px;
  line-height: 1.6;
  color: #111;
}
.paper-section ul, .paper-section ol {
  margin: 6px 0 9px 18px;
  padding: 0;
}
.paper-section li {
  margin-bottom: 4px;
  line-height: 1.55;
}

/* ── Citation refs ─────────────────────────────────────────── */
.cite {
  color: #1a56db;
  cursor: pointer;
  font-size: 0.82em;
  vertical-align: super;
  text-decoration: none;
}
.cite:hover { text-decoration: underline; }

/* ── Tables ───────────────────────────────────────────────── */
.paper-table-wrap {
  break-inside: avoid;
  margin: 14px 0;
}
.paper-table-caption {
  font-size: 0.78rem;
  text-align: center;
  margin-bottom: 4px;
  color: #444;
  font-style: italic;
}
.paper-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.paper-table th {
  border-top: 1.5px solid #555;
  border-bottom: 0.5px solid #555;
  padding: 4px 8px;
  text-align: left;
  font-weight: bold;
  background: transparent;
  color: #000;
}
.paper-table td {
  padding: 3px 8px;
  border: none;
  color: #111;
  vertical-align: top;
}
.paper-table tr:last-child td {
  border-bottom: 1.5px solid #555;
}
.paper-table tr:nth-child(even) td { background: #f9f9f9; }

/* ── Highlighted / hypothesis boxes ─────────────────────────── */
.paper-box {
  background: #f5f5f5;
  border-left: 3px solid #1a56db;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 0.84rem;
  break-inside: avoid;
}
.paper-box-title {
  font-weight: bold;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: #1a56db;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── SMILES / code ─────────────────────────────────────────── */
.paper-code {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.76rem;
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 5px;
  color: #2d2d2d;
  word-break: break-all;
}
.paper-codeblock {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.75rem;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 12px;
  margin: 10px 0;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
  color: #222;
  break-inside: avoid;
}

/* ── Story callout ─────────────────────────────────────────── */
.paper-quote {
  border-left: 3px solid #888;
  padding: 8px 14px;
  margin: 12px 0;
  font-style: italic;
  font-size: 0.87rem;
  color: #333;
  break-inside: avoid;
}
.paper-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  color: #666;
  margin-top: 5px;
}

/* ── Architecture diagrams ─────────────────────────────────── */
.paper-diagram-row {
  display: flex;
  gap: 14px;
  margin: 14px 0 20px;
  align-items: flex-start;
  column-span: all;
}
.paper-diagram {
  flex: 1;
  background: #f8f9fc;
  border: 1px solid #ccd3de;
  border-radius: 5px;
  padding: 10px 12px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.62rem;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
  color: #1a1a2e;
  break-inside: avoid;
}
.paper-diagram-title {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1a56db;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 7px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ccd3de;
  white-space: normal;
}
.paper-diagram-caption {
  text-align: center;
  font-size: 0.76rem;
  color: #555;
  margin-top: 6px;
  font-style: italic;
  white-space: normal;
  font-family: system-ui, sans-serif;
}
@media (max-width: 680px) {
  .paper-diagram-row { flex-direction: column; }
}

/* ── Full-width sections (references) ──────────────────────── */
.paper-full {
  column-span: all;
  break-before: column;
}
.paper-full h2 {
  font-size: 0.95rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 10px;
  color: #000;
  border-bottom: 0.5px solid #bbb;
  padding-bottom: 2px;
}

/* ── References list ───────────────────────────────────────── */
.paper-refs {
  font-size: 0.8rem;
  color: #333;
  line-height: 1.55;
}
.paper-refs li {
  margin-bottom: 7px;
  padding-left: 4px;
}
.paper-refs a { color: #1a56db; }

/* ── Author contributions ──────────────────────────────────── */
.paper-contrib-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 8px 0;
}
.paper-contrib-table th {
  border-bottom: 1px solid #888;
  padding: 4px 6px;
  font-weight: bold;
  text-align: left;
  background: transparent;
}
.paper-contrib-table td {
  padding: 3px 6px;
  vertical-align: top;
}
.paper-contrib-table tr:nth-child(even) td { background: #f6f6f6; }

/* ── Print overrides ───────────────────────────────────────── */
@media print {
  .paper-toolbar { display: none !important; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .paper-wrap { background: #fff !important; }
  .paper-doc {
    max-width: none !important;
    margin: 0 !important;
    padding: 15mm 18mm !important;
    box-shadow: none !important;
    border: none !important;
  }
  .paper-body { column-count: 2; }
  a { color: #000 !important; text-decoration: none !important; }
  .cite { color: #000 !important; }
  .paper-diagram { border: 1px solid #bbb !important; }
}

/* ── Responsive: single column on small screens ──────────────── */
@media (max-width: 680px) {
  .paper-doc { padding: 28px 22px; }
  .paper-body { column-count: 1; }
  .paper-abstract-block { padding: 0; }
  .paper-title { font-size: 1.25rem; }
}
