/* Academic preprint styling scoped strictly to OncoRef whitepaper pages (.oncoref-whitepaper).
   Mirrors docs/antigen-whitepaper/oncoref-antigen-whitepaper.pdf and the tcrsift preprint
   visual system: Palatino serif body, Helvetica Neue headings/tables/kickers, Menlo inline
   code, monochrome ink with restrained #1B4F72 accent, framed Abstract, uppercase section
   kickers above H2, LaTeX booktabs tables, and framed figures with click-to-zoom lightbox. */

:root {
  --wp-serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --wp-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wp-mono: Menlo, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --wp-ink: #141414;
  --wp-heading: #111111;
  --wp-muted: #525860;
  --wp-accent: #1b4f72;
  --wp-code-ink: #26323d;
  --wp-code-bg: #f3f5f7;
  --wp-tint: #f7f8fa;
  --wp-rule: #d2d7dc;
  --wp-rule-dark: #1c1c1c;
  --wp-row-rule: #e6e9ec;
  --wp-fig-bg: #ffffff;
}

[data-bs-theme="dark"] {
  --wp-ink: #e5e7eb;
  --wp-heading: #f8fafc;
  --wp-muted: #9ca3af;
  --wp-accent: #6cb4e8;
  --wp-code-ink: #cbd5e1;
  --wp-code-bg: rgba(148, 163, 184, 0.14);
  --wp-tint: rgba(148, 163, 184, 0.08);
  --wp-rule: rgba(148, 163, 184, 0.28);
  --wp-rule-dark: rgba(226, 232, 240, 0.65);
  --wp-row-rule: rgba(148, 163, 184, 0.16);
  --wp-fig-bg: #ffffff;
}

/* Measure & base typography */
.oncoref-whitepaper {
  max-width: 49rem;
  font-family: var(--wp-serif);
  font-size: 1.01rem;
  line-height: 1.62;
  color: var(--wp-ink);
  font-variant-numeric: lining-nums;
}

.oncoref-whitepaper p {
  margin-top: 0;
  margin-bottom: 0.78rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.oncoref-whitepaper li {
  margin-bottom: 0.35rem;
}

@media (max-width: 48em) {
  .oncoref-whitepaper p {
    text-align: left;
    hyphens: none;
  }
}

.oncoref-whitepaper a {
  color: var(--wp-accent);
  text-decoration: none;
}

.oncoref-whitepaper a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Inline code — quiet, print-like */
.oncoref-whitepaper code:not(pre code) {
  font-family: var(--wp-mono);
  font-size: 0.81em;
  color: var(--wp-code-ink);
  background: var(--wp-code-bg);
  padding: 0.06em 0.28em;
  border-radius: 2px;
}

.oncoref-whitepaper pre {
  background: var(--wp-tint);
  border: 1px solid var(--wp-rule);
  border-left: 2.5px solid var(--wp-accent);
  border-radius: 2px;
  padding: 0.75rem 1rem;
  font-family: var(--wp-mono);
  font-size: 0.82rem;
  line-height: 1.48;
  margin: 0.9rem 0 1.2rem 0;
}

/* Title block (eyebrow + title + subtitle + download meta bar + hairline rule) */
.oncoref-whitepaper .wp-eyebrow {
  font-family: var(--wp-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--wp-accent);
  margin: 0 0 0.35rem 0;
  text-align: left;
  hyphens: none;
}

.oncoref-whitepaper h1 {
  font-family: var(--wp-sans);
  font-size: 1.78rem;
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.015em;
  color: var(--wp-heading);
  margin: 0 0 0.45rem 0;
}

.oncoref-whitepaper .wp-subtitle {
  font-family: var(--wp-serif);
  font-style: italic;
  font-size: 1.06rem;
  line-height: 1.42;
  color: var(--wp-muted);
  margin: 0 0 0.65rem 0;
  text-align: left;
  hyphens: none;
}

.oncoref-whitepaper .wp-meta-bar {
  font-family: var(--wp-sans);
  font-size: 0.80rem;
  line-height: 1.5;
  color: var(--wp-muted);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--wp-rule-dark);
  text-align: left;
  hyphens: none;
}

.oncoref-whitepaper .wp-meta-bar strong {
  color: var(--wp-ink);
  font-weight: 600;
}

.oncoref-whitepaper .wp-meta-bar a {
  font-weight: 600;
}

/* Framed preprint Abstract box */
.oncoref-whitepaper .wp-abstract {
  background: var(--wp-tint);
  border-left: 2.5px solid var(--wp-accent);
  border-top: 1px solid var(--wp-rule);
  border-bottom: 1px solid var(--wp-rule);
  padding: 0.95rem 1.25rem 0.45rem 1.25rem;
  margin: 0 0 1.65rem 0;
}

.oncoref-whitepaper .wp-abstract h2,
.oncoref-whitepaper .wp-abstract h3 {
  font-family: var(--wp-sans);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp-accent);
  margin: 0 0 0.55rem 0;
  padding: 0;
  border: none;
}

.oncoref-whitepaper .wp-abstract p {
  font-size: 0.94rem;
  line-height: 1.54;
  margin-bottom: 0.55rem;
}

.oncoref-whitepaper .wp-abstract blockquote {
  margin: 0.55rem 0 0.7rem 0;
  padding: 0.35rem 0.85rem;
  background: transparent;
  border-left: 2px solid var(--wp-accent);
  font-family: var(--wp-sans);
  font-size: 0.92rem;
}

/* Quiet jump-to bar harmonized with preprint typography */
.oncoref-whitepaper .section-nav {
  font-family: var(--wp-sans);
  font-size: 0.78rem;
  line-height: 1.62;
  color: var(--wp-muted);
  padding: 0.5rem 0 0.6rem 0;
  margin: 0.5rem 0 1.35rem 0;
  border-top: 1px solid var(--wp-row-rule);
  border-bottom: 1px solid var(--wp-row-rule);
  text-align: left;
  hyphens: none;
}

/* Section kickers (OVERVIEW, DEFINITIONS, RESULTS, METHODS, APPENDIX A...) above H2 */
.oncoref-whitepaper .wp-kicker {
  font-family: var(--wp-sans);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp-accent);
  margin: 2.15rem 0 0.18rem 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--wp-row-rule);
  text-align: left;
  hyphens: none;
}

.oncoref-whitepaper .wp-kicker + h2 {
  margin-top: 0.12rem;
  padding-top: 0;
  border-top: none;
}

.oncoref-whitepaper h2 {
  font-family: var(--wp-sans);
  font-size: 1.30rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--wp-heading);
  margin: 1.9rem 0 0.55rem 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--wp-row-rule);
}

.oncoref-whitepaper h3 {
  font-family: var(--wp-sans);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--wp-heading);
  margin: 1.35rem 0 0.4rem 0;
}

.oncoref-whitepaper h4 {
  font-family: var(--wp-sans);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--wp-heading);
  margin: 1.1rem 0 0.35rem 0;
}

/* LaTeX booktabs tables (overrides Bootstrap table styling) */
.oncoref-whitepaper table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  border: none;
  border-top: 1.5px solid var(--wp-rule-dark);
  border-bottom: 1.5px solid var(--wp-rule-dark);
  border-radius: 0;
  box-shadow: none;
  margin: 1.15rem 0 1.35rem 0;
  font-size: 0.85rem;
  line-height: 1.44;
  font-variant-numeric: tabular-nums;
}

.oncoref-whitepaper table thead th {
  font-family: var(--wp-sans);
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--wp-heading);
  background: transparent;
  border-top: none;
  border-bottom: 1px solid var(--wp-rule-dark);
  padding: 0.48rem 0.58rem;
  text-align: left;
  vertical-align: bottom;
}

.oncoref-whitepaper table tbody td {
  font-family: var(--wp-serif);
  color: var(--wp-ink);
  background: transparent;
  border-top: none;
  border-bottom: 1px solid var(--wp-row-rule);
  padding: 0.44rem 0.58rem;
  vertical-align: top;
}

.oncoref-whitepaper table tbody tr:last-child td {
  border-bottom: none;
}

.oncoref-whitepaper table tbody tr:hover {
  background: var(--wp-tint);
}

/* Table footnote directly after a table */
.oncoref-whitepaper .wp-table-note {
  font-family: var(--wp-serif);
  font-style: italic;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--wp-muted);
  margin: -0.8rem 0 1.2rem 0;
  text-align: left;
}

/* Figures & captions (white card background guarantees crisp contrast) */
.oncoref-whitepaper figure.wp-figure {
  margin: 1.45rem 0 1.45rem 0;
  padding: 0;
}

.oncoref-whitepaper figure.wp-figure .wp-figure-frame {
  background: var(--wp-fig-bg);
  border: 1px solid var(--wp-rule);
  border-radius: 3px;
  padding: 0.65rem;
  text-align: center;
  cursor: zoom-in;
  transition: border-color 0.15s ease;
}

.oncoref-whitepaper figure.wp-figure .wp-figure-frame:hover {
  border-color: var(--wp-accent);
}

.oncoref-whitepaper figure.wp-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.oncoref-whitepaper figure.wp-figure figcaption {
  font-family: var(--wp-serif);
  font-size: 0.87rem;
  line-height: 1.48;
  color: var(--wp-muted);
  margin-top: 0.55rem;
  text-align: justify;
  hyphens: auto;
}

.oncoref-whitepaper figure.wp-figure figcaption strong.wp-fig-label {
  font-family: var(--wp-sans);
  font-weight: 700;
  color: var(--wp-heading);
  font-style: normal;
  margin-right: 0.25rem;
}

/* Blockquote / Methods callout box (matches PDF build_callout_box) */
.oncoref-whitepaper blockquote {
  background: var(--wp-tint);
  border-left: 2.5px solid var(--wp-accent);
  color: var(--wp-ink);
  padding: 0.7rem 1.05rem;
  margin: 0.9rem 0 1.15rem 0;
  font-size: 0.92rem;
  line-height: 1.54;
}

.oncoref-whitepaper blockquote p:last-child {
  margin-bottom: 0;
}

/* Disclosure panels harmonized with preprint style */
.oncoref-whitepaper details {
  margin: 1.05rem 0 1.35rem 0;
  padding: 0.55rem 0.9rem;
  background: var(--wp-tint);
  border: 1px solid var(--wp-rule);
  border-left: 2.5px solid var(--wp-accent);
  border-radius: 2px;
}

.oncoref-whitepaper details > summary {
  font-family: var(--wp-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wp-accent);
  cursor: pointer;
}

/* Lightbox modal for zooming dense scientific figures */
.wp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: zoom-out;
}

.wp-lightbox-inner {
  background: #ffffff;
  border-radius: 4px;
  padding: 1rem;
  max-width: 96vw;
  max-height: 94vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.wp-lightbox-inner img {
  display: block;
  max-width: none;
  width: min(1280px, 90vw);
  height: auto;
}

/* Print media cleanly hides navbar/sidebar chrome and keeps booktabs/figures crisp */
@media print {
  .navbar,
  .col-md-3,
  .section-nav {
    display: none !important;
  }
  .oncoref-whitepaper {
    max-width: 100%;
    width: 100%;
    font-size: 10pt;
  }
  .oncoref-whitepaper figure.wp-figure {
    break-inside: avoid;
  }
}
