:root {
  --ink: #2d2d2d;
  --ink-muted: #5a5a5a;
  --canvas: #faf8f5;
  --line: #d8d4cc;
  --accent: #2c5282;
  --accent-dark: #122746;
  --accent-light: #4a7ba7;
  --gold: #c9a961;
  --gold-ink: #7a4b00;
  --highlight: #f2efe9;
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0.01em;
}

body.acf-canonical {
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--canvas);
}

/* Container for narrower content width */
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  left: -9999px;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--accent);
  text-decoration: underline;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

main {
  display: block;
}

.canonical-main {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 80px;
  background: var(--canvas);
}

@media (max-width: 768px) {
  .canonical-main {
    padding: 32px 16px 48px;
  }
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 16px;
}

.global-nav {
  background: #0f2138;
  color: #f4f7fb;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.global-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.global-nav__brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
}

.global-nav__title {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
}

.global-nav__tagline {
  font-size: 13px;
  color: #ced9eb;
}

.global-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.global-nav__links a {
  color: #f4f7fb;
  font-size: 15px;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.global-nav__links a:hover,
.global-nav__links a:focus {
  border-color: var(--gold);
  color: #fff;
}

@media (max-width: 800px) {
  .global-nav__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.site-footer {
  background: #0f2138;
  color: #f4f7fb;
  text-align: center;
  padding: 32px 20px;
  border-top: 3px solid var(--accent);
}

.site-footer a {
  color: #a8c4ff;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--accent);
  font-weight: 700;
  margin: 0;
}

h1 {
  font-size: 42px;
  line-height: 1.3;
  margin-bottom: 20px;
}

h2 {
  font-size: 32px;
  margin: 60px 0 30px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 12px;
}

h3 {
  font-size: 26px;
  margin: 40px 0 20px;
  color: var(--accent-light);
}

h4 {
  font-size: 22px;
  margin: 32px 0 16px;
  color: var(--ink);
}

p {
  margin: 1.2em 0;
}

ul,
ol {
  margin: 1.2em 0 1.2em 1.6em;
  padding: 0;
}

li {
  margin: 0.6em 0;
}

blockquote {
  background: var(--highlight);
  border-left: 4px solid var(--accent-light);
  padding: 20px;
  margin: 30px 0;
  font-style: italic;
}

code,
pre {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  background: #f0ede7;
  border-radius: 4px;
}

code {
  padding: 3px 6px;
}

pre {
  padding: 14px;
  overflow-x: auto;
}

.equation-display {
  text-align: center;
  margin: 24px 0;
  font-size: 20px;
  overflow-x: auto;
  overflow-y: hidden;
}

/* MathJax container styling for responsive equations */
mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

mjx-container[jax="SVG"] {
  direction: ltr;
}

/* Ensure display math containers are centered */
.equation-display mjx-container {
  display: inline-block;
  margin: 0 auto;
}

/* Pandoc math class fallback styling */
.math {
  font-style: normal;
}

.math.display {
  display: block;
  text-align: center;
  margin: 24px 0;
  overflow-x: auto;
}

.math.inline {
  display: inline;
}

.toc {
  background: var(--highlight);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  margin: 40px 0;
  box-shadow: 0 2px 8px var(--shadow);
}

.toc h2 {
  border: none;
  padding-bottom: 0;
  margin-top: 0;
}

.toc ul {
  list-style: none;
  margin-left: 0;
}

.toc li {
  margin: 8px 0;
}

.abstract,
.highlight,
.callout,
.hero-box,
.remark,
.example {
  background: var(--highlight);
  border-left: 4px solid var(--gold);
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
  margin: 32px 0;
}

.abstract-title,
.highlight strong,
.callout strong {
  color: var(--accent);
  font-size: 20px;
}

.metric {
  font-size: 40px;
  color: var(--accent);
  font-weight: 700;
  margin: 0;
}

.data-table,
.cross-domain-table,
table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: #fefcf8;
}

tbody tr:hover {
  background: var(--highlight);
}

.theorem,
.proposition,
.lemma,
.corollary,
.definition {
  background: var(--highlight);
  border-left: 4px solid var(--accent-light);
  padding: 24px;
  border-radius: 8px;
  margin: 32px 0;
  box-shadow: 0 2px 8px var(--shadow);
}

.theorem-label,
.proposition-label,
.lemma-label,
.corollary-label,
.definition-label,
.proof-label {
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
}

.proof {
  background: #fbf7ef;
  border-left: 4px solid var(--gold);
  padding: 20px;
  border-radius: 8px;
  margin: 28px 0;
}

.proof-step {
  margin: 12px 0;
  padding-left: 18px;
  border-left: 2px solid var(--line);
}

.qed {
  float: right;
  font-weight: 700;
  color: var(--gold);
}

.btn,
.button,
.proof-link {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn--primary,
.proof-link {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  border-color: transparent;
}

.btn:hover,
.button:hover,
.proof-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44, 82, 130, 0.35);
}

.hero-box {
  background: linear-gradient(135deg, #c62828 0%, #d32f2f 100%);
  color: #fff;
  border-left-color: rgba(255, 255, 255, 0.6);
}

.hero-box h2,
.hero-box p,
.hero-box li {
  color: inherit;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 32px 0;
}

.pillar,
.card,
.stat-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px var(--shadow);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.site-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.site-map-group {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: 0 2px 8px var(--shadow);
}

.site-map-group h3,
.site-map-group h2 {
  margin: 0 0 12px;
  border: none;
  padding: 0;
}

.site-map-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-map-group li {
  margin: 8px 0;
}

.site-map__path {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}

.site-map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 15px;
  color: var(--ink-muted);
}

.integrity-warning {
  color: #c53030;
  font-weight: 600;
}

@media (max-width: 600px) {
  h1 {
    font-size: 32px;
  }
  h2 {
    font-size: 26px;
  }
  h3 {
    font-size: 22px;
  }
  .global-nav__links {
    flex-direction: column;
    align-items: flex-start;
  }
}
.page-header {
  margin: 16px 0 32px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
}

.page-header .meta {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  display: block;
}

/* =====================================================
   LANDING PAGE & HERO SECTION STYLES
   ===================================================== */

/* Subtitle styling */
.subtitle {
  font-size: 24px;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: 15px;
}

/* Meta information */
.meta {
  font-size: 16px;
  color: var(--ink-muted);
  margin-top: 20px;
}

/* Proof link wrapper for centering */
.proof-link-wrapper {
  text-align: center;
  margin: 2em 0;
}

/* Theorem statement styling */
.theorem-statement {
  font-style: italic;
  margin: 15px 0;
}

/* Proof content */
.proof-content {
  color: var(--ink);
  line-height: 1.75;
}

.proof-content hr {
  margin: 15px 0;
  border: none;
  border-top: 1px dashed var(--gold);
}

/* Remark label */
.remark-label {
  font-weight: bold;
  color: var(--ink-muted);
  font-style: normal;
  margin-bottom: 10px;
}

/* Table caption */
.table-caption {
  margin-top: 15px;
  font-size: 16px;
  color: var(--ink-muted);
  font-style: italic;
}

/* Emphasis text */
.emphasis {
  font-weight: bold;
  color: var(--accent);
}

/* Equation number */
.equation-number {
  float: right;
  color: var(--ink-muted);
}

/* Integrity warning hidden state */
.integrity-warning[hidden] {
  display: none;
}

/* =====================================================
   HERO SECTION (LEDE) STYLES
   ===================================================== */

.lede {
  background: var(--canvas);
  color: var(--ink);
  padding: 48px 16px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.lede__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.lede__main h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 36px);
  color: var(--ink);
  border-bottom: none;
  padding-bottom: 0;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lede__sub {
  margin: 0 0 24px;
  color: var(--ink-muted);
  font-size: 17px;
  line-height: 1.6;
}

.lede__date {
  opacity: 0.75;
  font-size: 0.95em;
}

.lede__tldr {
  margin: 0 0 24px;
  padding-left: 0;
  list-style: none;
}

.lede__tldr li {
  margin: 10px 0;
  padding-left: 24px;
  position: relative;
  color: var(--ink);
  line-height: 1.5;
}

.lede__tldr li:before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--gold);
  font-weight: bold;
}

.lede__ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.lede__facts {
  background: var(--highlight);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 6px var(--shadow);
}

.facts {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
}

.facts li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(201, 169, 97, 0.3);
  font-size: 14px;
}

.facts li:last-child {
  border-bottom: none;
}

.facts span {
  font-weight: 600;
  color: var(--gold-ink);
}

.lede__mini {
  display: inline-block;
  margin-top: 6px;
  color: var(--gold-ink);
  font-size: 14px;
  transition: color 0.3s ease;
}

.lede__mini:hover {
  color: var(--accent-light);
}

.lede__toc {
  max-width: 900px;
  margin: 24px auto 0;
  padding: 24px 20px;
  border-top: 2px solid var(--line);
  color: var(--ink-muted);
  text-align: left;
}

.lede__toc strong {
  color: var(--ink);
  font-size: 18px;
  display: block;
  margin-bottom: 12px;
}

#on-this-page {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

#on-this-page li {
  margin: 8px 0;
  line-height: 1.6;
}

#on-this-page a {
  color: var(--accent-dark);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

#on-this-page a:hover {
  color: var(--accent);
  transform: translateX(4px);
}

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

@media (max-width: 980px) {
  .lede__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .cross-domain-table {
    font-size: 14px;
  }

  .cross-domain-table th,
  .cross-domain-table td {
    padding: 10px;
  }
}

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

@media print {
  body {
    font-size: 12pt;
    background: #fff;
  }

  .global-nav,
  .site-footer,
  .skip-link {
    display: none;
  }

  .qed::after {
    content: "";
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .canonical-main {
    padding: 0;
    max-width: none;
  }
}

/* =====================================================
   ACADEMIC PAPER STYLES
   Added 2025-11-20 for academic presentation
   ===================================================== */

/* Abstract section - prominent display */
.abstract {
  background: var(--highlight);
  border-left: 4px solid var(--accent);
  padding: 2rem;
  margin: 2.5rem 0;
  font-size: 1.05rem;
  line-height: 1.8;
  border-radius: 4px;
}

.abstract h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.5rem;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.abstract p {
  margin: 1rem 0;  /* Set both top and bottom margins for proper paragraph spacing */
}

/* Keywords styling */
.keywords, .abstract-keywords {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* Metadata (author, date, version) */
.metadata {
  color: var(--ink-muted);
  font-size: 1.05rem;
  margin: 1rem 0;
  text-align: center;
}

.metadata span {
  margin: 0 1rem;
}

/* Reader navigation guide */
.reader-guide {
  background: #f0f8ff;
  border: 2px solid var(--accent-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.reader-guide h3 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.3rem;
}

.reader-guide ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.reader-guide li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* See Also / Related Materials boxes */
.see-also {
  background: var(--canvas);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 2px 4px var(--shadow);
}

.see-also h4 {
  margin-top: 0;
  color: #8b7355;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.see-also ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: none;
}

.see-also li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 0.5rem;
}

.see-also li::before {
  content: "→";
  position: absolute;
  left: -1rem;
  color: var(--gold);
  font-weight: bold;
}

.see-also a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}

.see-also a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Quick links navigation */
.quick-links {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--highlight);
  border-radius: 4px;
  font-size: 0.95rem;
}

.quick-links strong {
  color: var(--accent);
  margin-right: 1rem;
}

.quick-links a {
  margin: 0 0.5rem;
  white-space: nowrap;
  color: var(--accent-dark);
}

/* References section */
.references {
  list-style: decimal;
  padding-left: 2.5rem;
  counter-reset: ref-counter;
}

.references li {
  margin-bottom: 1.25rem;
  line-height: 1.7;
  position: relative;
}

.references li::marker {
  color: var(--accent);
  font-weight: bold;
}

.citation-authors {
  font-weight: 600;
  color: var(--ink);
}

.citation-year {
  font-weight: normal;
}

.citation-title {
  font-style: italic;
}

.citation-journal {
  font-weight: normal;
}

.citation-volume {
  font-weight: bold;
}

/* Superscript citation links */
sup a {
  color: var(--accent);
  font-weight: bold;
  text-decoration: none;
  padding: 0 0.15em;
}

sup a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

/* Breadcrumb navigation */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
}

.breadcrumb a {
  color: var(--accent-light);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* Paper navigation (in header) */
.paper-nav {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.paper-nav a {
  margin: 0 0.75rem;
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
}

.paper-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Appendices section styling */
.appendices {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 3px double var(--line);
}

.appendices > h2 {
  text-align: center;
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 2rem;
}

/* Print styles for citations */
@media print {
  .references {
    page-break-inside: avoid;
  }

  .references li {
    page-break-inside: avoid;
  }

  sup a::after {
    content: " [" attr(href) "]";
    font-size: 0.8em;
    font-weight: normal;
  }

  .breadcrumb,
  .quick-links,
  .reader-guide {
    display: none;
  }
}

/* =====================================================
   DEDICATION SECTION
   ===================================================== */

.dedication {
  text-align: center;
  margin: 32px auto 48px;
  padding: 24px 20px;
  max-width: 600px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--highlight);
}

.dedication img {
  display: block;
  margin: 0 auto 16px;
  max-width: 180px;
  width: 100%;
  height: auto;
  opacity: 0.88;
  filter: sepia(15%) contrast(1.05);
  border-radius: 4px;
}

.dedication p {
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.6;
}

.dedication p:first-of-type {
  font-style: italic;
  color: var(--ink);
  font-size: 16px;
}

.dedication strong {
  color: var(--accent-dark);
  font-weight: 600;
}

.dedication em {
  color: var(--ink-muted);
}

@media (max-width: 768px) {
  .dedication {
    margin: 24px 16px 32px;
    padding: 20px 16px;
  }

  .dedication img {
    max-width: 140px;
  }

  .dedication p {
    font-size: 14px;
  }
}
