/* ============================================================
   AXOM Research Paper — Academic Publication Stylesheet
   Target aesthetic: Nature / Science / IEEE Transactions
   ============================================================ */

/* --- Page Rules (Print) --- */

@page {
  size: Letter;
  margin: 2.54cm;
}

@page :first {
  margin-top: 3cm;
}

/* --- Base Typography --- */

body {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  font-size: 11.5pt;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Screen Layout --- */

@media screen {
  body {
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
  }
}

@media screen and (max-width: 600px) {
  body {
    padding: 1.5rem 1rem 2.5rem;
  }

  h1, .title-page h1 {
    font-size: 17pt;
  }

  h2 {
    font-size: 12.5pt;
  }

  h3 {
    font-size: 11pt;
  }
}

/* --- Headings --- */

h1 {
  font-size: 20pt;
  font-weight: 400;
  text-align: left;
  color: #1a1a1a;
  margin: 0 0 0.4em;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 14pt;
  font-weight: 600;
  color: #1a2a3a;
  margin: 2.2em 0 0.6em;
  padding-bottom: 0.15em;
  border-bottom: 1px solid #ddd;
  font-variant: small-caps;
  letter-spacing: 0.03em;
}

h3 {
  font-size: 12pt;
  font-weight: 600;
  font-style: italic;
  color: #2a3a4a;
  margin: 1.6em 0 0.5em;
}

h4 {
  font-size: 11.5pt;
  font-weight: 600;
  color: #3a4a5a;
  margin: 1.2em 0 0.4em;
}

/* --- Paragraphs & Body Text --- */

p {
  margin: 0 0 0.8em;
  text-align: left;
}

/* --- Title Page --- */

.title-page {
  text-align: left;
  padding: 2em 0 1.5em;
  margin-bottom: 1.5em;
}

.title-page h1 {
  font-size: 22pt;
  font-weight: 400;
  text-align: left;
  margin-bottom: 0.3em;
  line-height: 1.25;
}

.title-page .subtitle {
  font-size: 14pt;
  font-style: italic;
  color: #3a4a5a;
  margin: 0.2em 0 1.2em;
  font-weight: 400;
}

.title-page .authors {
  font-size: 12pt;
  margin: 0.8em 0 0.2em;
  color: #1a1a1a;
}

.title-page .affiliation {
  font-size: 10.5pt;
  color: #555;
  margin: 0.2em 0;
}

.title-page .date {
  font-size: 10.5pt;
  color: #555;
  margin: 0.8em 0 0;
}

.title-page .correspondence {
  font-size: 9.5pt;
  color: #666;
  margin: 0.5em 0 0;
  font-style: italic;
}

.title-page + hr {
  margin-top: 0;
}

/* --- Abstract --- */

.abstract {
  margin: 1.5em 0 2em;
  font-size: 10.5pt;
  line-height: 1.55;
}

.abstract strong,
.abstract .abstract-label {
  font-weight: 700;
  font-style: normal;
  display: block;
  margin-bottom: 0.3em;
  font-size: 11pt;
  text-align: left;
}

.abstract p {
  text-align: left;
}

/* --- Keywords --- */

.keywords {
  margin: -0.5em 2.5em 2em;
  font-size: 9.5pt;
  color: #444;
}

.keywords strong {
  font-weight: 700;
}

/* --- Horizontal Rules --- */

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 2em 0;
}

/* --- Tables --- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 10pt;
  line-height: 1.4;
}

thead th {
  background: #2c3e50;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9pt;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #1a2a3a;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #e8e8e8;
  vertical-align: top;
}

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

tbody tr:last-child td {
  border-bottom: 2px solid #2c3e50;
}

caption {
  caption-side: bottom;
  font-size: 9.5pt;
  font-style: italic;
  color: #555;
  padding-top: 0.6em;
  text-align: left;
}

/* Table wrapper for screen overflow */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Figures --- */

figure {
  margin: 1.5em 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
}

figcaption {
  font-size: 9.5pt;
  font-style: italic;
  color: #555;
  margin-top: 0.5em;
  text-align: left;
}

/* --- Lists --- */

ul, ol {
  margin: 0.5em 0 1em;
  padding-left: 1.8em;
}

li {
  margin-bottom: 0.3em;
}

li p {
  margin-bottom: 0.3em;
}

/* --- Blockquotes --- */

blockquote {
  margin: 1em 2em;
  padding: 0.5em 1em;
  border-left: 3px solid #ccc;
  color: #444;
  font-size: 10.5pt;
  font-style: italic;
}

/* --- Code / Technical Terms --- */

code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  background: #f4f4f4;
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

pre {
  font-family: 'Courier New', Courier, monospace;
  font-size: 9pt;
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  padding: 1em;
  overflow-x: auto;
  line-height: 1.4;
  margin: 1em 0;
}

/* --- Links --- */

a {
  color: #1a2a3a;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Footnotes / References --- */

.footnote, .reference {
  font-size: 9pt;
  line-height: 1.4;
}

.references {
  font-size: 10pt;
}

.references ol {
  padding-left: 1.5em;
}

.references li {
  margin-bottom: 0.5em;
}

sup {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: super;
}

/* --- Section Numbering (optional, via content author) --- */

.section-number {
  font-weight: 700;
  margin-right: 0.3em;
}

/* --- Utility Classes --- */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-small { font-size: 9.5pt; }
.text-muted { color: #666; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.no-break { page-break-inside: avoid; }

/* --- Print Styles --- */

@media print {
  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  h2 {
    page-break-before: always;
    color: #000;
    border-bottom-color: #999;
  }

  /* Don't break before the first h2 after title/abstract */
  .title-page + hr + .abstract + hr + h2,
  .title-page + hr + .abstract + h2,
  .abstract + hr + h2,
  .abstract + h2,
  hr + h2:first-of-type,
  body > h2:first-of-type {
    page-break-before: auto;
  }

  h3, h4 {
    page-break-after: avoid;
    color: #000;
  }

  p, li, blockquote {
    page-break-inside: avoid;
    orphans: 3;
    widows: 3;
  }

  table {
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  thead th {
    background: #2c3e50 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

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

  pre, code {
    background: none;
    border-color: #ccc;
  }

  a {
    color: #000;
  }

  figure {
    page-break-inside: avoid;
  }

  .no-print {
    display: none;
  }
}
