/* ==========================================================================
   Prometheus Research Group — Shared Research Paper Stylesheet
   ========================================================================== */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Georgia', 'Times New Roman', 'Palatino Linotype', serif;
  line-height: 1.75;
  color: #1a1a1a;
  background: #fafaf8;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.paper-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Header */
.paper-header {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 2px solid #2c5f7c;
  margin-bottom: 2.5rem;
}

.paper-header .org-name {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #2c5f7c;
  margin-bottom: 1.5rem;
}

.paper-header h1 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.paper-header .author {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 0.25rem;
}

.paper-header .affiliation {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.paper-header .date {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Table of Contents */
.toc {
  background: #f0f4f7;
  border: 1px solid #d0dce4;
  border-radius: 6px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}

.toc h2 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c5f7c;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.toc ol {
  list-style-type: none;
  counter-reset: toc-counter;
  padding-left: 0;
}

.toc > ol > li {
  counter-increment: toc-counter;
  margin-bottom: 0.35rem;
}

.toc > ol > li::before {
  content: counter(toc-counter) ". ";
  font-weight: 600;
  color: #2c5f7c;
}

.toc > ol > li > ol {
  list-style-type: none;
  counter-reset: toc-sub-counter;
  padding-left: 1.5rem;
  margin-top: 0.2rem;
}

.toc > ol > li > ol > li {
  counter-increment: toc-sub-counter;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.toc > ol > li > ol > li::before {
  content: counter(toc-counter) "." counter(toc-sub-counter) " ";
  color: #5a8fa8;
}

.toc a {
  color: #2c5f7c;
  text-decoration: none;
}

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

/* Abstract */
.abstract {
  background: #f7f5f0;
  border-left: 4px solid #2c5f7c;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 6px 6px 0;
}

.abstract h2 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2c5f7c;
  margin-bottom: 0.75rem;
}

.abstract p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #333;
}

/* Section Headings */
h2.section-heading {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c5f7c;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #d0dce4;
}

h3.subsection-heading {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #3a7a96;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4.subsubsection-heading {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #4a8aa6;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Paragraphs */
p {
  margin-bottom: 1rem;
  text-align: justify;
  hyphens: auto;
}

/* Links */
a {
  color: #2c5f7c;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #1a4a5c;
}

/* Equations */
.equation {
  text-align: center;
  margin: 1.5rem 0;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.equation-numbered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.equation-numbered .eq-content {
  flex: 0 1 auto;
  text-align: center;
}

.equation-numbered .eq-number {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: #666;
}

/* Lists */
ul, ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

/* Description Lists */
dl {
  margin: 0.75rem 0 1rem 0;
}

dt {
  font-weight: 700;
  color: #333;
  margin-top: 0.75rem;
}

dd {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Block Quotes */
blockquote {
  border-left: 3px solid #2c5f7c;
  margin: 1.25rem 0 1.25rem 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #f7f9fb;
  border-radius: 0 4px 4px 0;
}

blockquote p {
  margin-bottom: 0.5rem;
}

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

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

table caption {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  text-align: left;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

thead {
  background: #2c5f7c;
  color: #fff;
}

thead th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
}

tbody tr {
  border-bottom: 1px solid #ddd;
}

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

tbody tr:hover {
  background: #eef3f7;
}

tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}

table.compact {
  width: auto;
}

table.compact td,
table.compact th {
  padding: 0.35rem 0.75rem;
}

/* Figures */
figure {
  margin: 1.5rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
}

figcaption {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Footnotes & Notes */
.note {
  font-size: 0.85rem;
  color: #555;
  padding: 0.5rem 0;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-style: italic;
}

/* Verification Status Tags */
.status-supported {
  display: inline-block;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: #d4edda;
  color: #155724;
}

.status-qualitative {
  display: inline-block;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: #fff3cd;
  color: #856404;
}

.status-speculative {
  display: inline-block;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: #f8d7da;
  color: #721c24;
}

.status-open {
  display: inline-block;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: #e2e3e5;
  color: #383d41;
}

/* Assumption / Limitation / Failure Boxes */
.disclosure {
  background: #fff8f0;
  border: 1px solid #e8d8c0;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.disclosure strong {
  color: #8b6914;
}

/* References Section */
.references {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid #2c5f7c;
}

.references h2 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #2c5f7c;
  margin-bottom: 1rem;
}

.references ol {
  list-style-type: none;
  counter-reset: ref-counter;
  padding-left: 0;
}

.references ol li {
  counter-increment: ref-counter;
  padding-left: 2.5rem;
  text-indent: -2.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #444;
}

.references ol li::before {
  content: "[" counter(ref-counter) "] ";
  font-weight: 700;
  color: #2c5f7c;
}

/* Cite This Paper Box */
.cite-box {
  background: #f0f4f7;
  border: 1px solid #d0dce4;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.cite-box h3 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2c5f7c;
  margin-bottom: 0.75rem;
}

.cite-box pre {
  background: #fff;
  border: 1px solid #ccc;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Related Papers */
.related-papers {
  background: #f7f9fb;
  border: 1px solid #d0dce4;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.related-papers h3 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2c5f7c;
  margin-bottom: 0.75rem;
}

.related-papers ul {
  list-style: none;
  padding-left: 0;
}

.related-papers li {
  margin-bottom: 0.5rem;
}

.related-papers a {
  font-weight: 600;
}

/* Footer */
.paper-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid #2c5f7c;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
}

.paper-footer .footer-logo {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #2c5f7c;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.paper-footer p {
  text-align: center;
  margin-bottom: 0.25rem;
}

/* Acknowledgments */
.acknowledgments {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.acknowledgments h2 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #2c5f7c;
  margin-bottom: 0.75rem;
}

.acknowledgments p {
  font-size: 0.9rem;
  color: #555;
}

/* Appendix */
.appendix h2.section-heading {
  color: #5a7a4c;
  border-bottom-color: #a8c896;
}

/* Inline Code / Math Emphasis */
code {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.88em;
  background: #f0f2f5;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* Strong emphasis */
strong {
  font-weight: 700;
}

/* Emphasis */
em {
  font-style: italic;
}

/* Small Caps (for verification status in-text) */
.sc {
  font-variant: small-caps;
  font-weight: 600;
}

/* MathJax overrides */
mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .paper-container {
    padding: 1rem 1rem 3rem;
  }

  .paper-header h1 {
    font-size: 1.4rem;
  }

  h2.section-heading {
    font-size: 1.2rem;
  }

  h3.subsection-heading {
    font-size: 1.05rem;
  }

  table {
    font-size: 0.8rem;
  }

  thead th, tbody td {
    padding: 0.4rem 0.5rem;
  }

  .toc {
    padding: 1rem 1.25rem;
  }

  .abstract {
    padding: 1rem 1.25rem;
  }

  .equation-numbered {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .paper-header h1 {
    font-size: 1.2rem;
  }

  .paper-container {
    padding: 0.75rem 0.75rem 2rem;
  }
}
