/* Seattle Spectrum Analysis — print-friendly CSS (Letter, 1-inch margins)
   Designed to constrain all content within printable margins and avoid overflows. */

:root{
  --text: #000;
  --bg: #fff;
  --muted: #333;
  --rule: #bbb;
}

html, body{
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.35;
}

body{
  /* On screen, mimic Letter with 1-inch margins: 6.5in content width */
  max-width: 6.5in;
  margin: 0 auto;
  padding: 0.5rem 0.25rem;
}

.doc-header h1{
  font-size: 1.35rem;
  margin: 0 0 0.35rem 0;
}

h2{
  font-size: 1.05rem;
  margin: 1.0rem 0 0.35rem 0;
  padding-top: 0.15rem;
  border-top: 1px solid var(--rule);
}

h3{
  font-size: 0.95rem;
  margin: 0.8rem 0 0.25rem 0;
}

p{ margin: 0.35rem 0; }

.meta{
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.callout{
  border: 1px solid var(--rule);
  padding: 0.5rem 0.6rem;
  margin: 0.6rem 0 0.9rem 0;
  font-size: 0.92rem;
}

.note{
  font-size: 0.92rem;
  border-left: 3px solid var(--rule);
  padding-left: 0.6rem;
  margin: 0.5rem 0 0.8rem 0;
}

ul, ol{
  margin: 0.25rem 0 0.35rem 1.1rem;
  padding: 0;
}

ul.tight{
  margin-left: 1.0rem;
}
ul.tight li{
  margin: 0.15rem 0;
}

table.data{
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 0.8rem 0;
  table-layout: fixed; /* important for print constraint */
}

table.data th, table.data td{
  border: 1px solid var(--rule);
  vertical-align: top;
  padding: 0.35rem 0.45rem;
  font-size: 0.88rem;
  overflow-wrap: anywhere; /* prevents overflow past margins */
  word-break: break-word;
}

table.data th{
  font-weight: 700;
  text-align: left;
}

.footnotes{
  margin-top: 1.1rem;
}

.footnotes ol{
  margin-left: 1.2rem;
}

.footnotes li{
  font-size: 0.82rem;
  margin: 0.35rem 0;
  /* MLA-ish hanging indent */
  padding-left: 0.3rem;
}

.footnotes a{
  word-break: break-word;
  overflow-wrap: anywhere;
}

.backref{
  text-decoration: none;
  margin-left: 0.35rem;
}

a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-footer{
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
  padding-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* PRINT */
@media print{
  @page{
    size: Letter;
    margin: 1in;
  }

  body{
    max-width: none;   /* printing is constrained by @page */
    margin: 0;
    padding: 0;
    font-size: 11pt;
  }

  /* Ensure nothing renders outside the printable area */
  *, *::before, *::after{
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  table.data{
    page-break-inside: avoid;
  }

  h2, h3{
    page-break-after: avoid;
  }

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

  /* Prevent awkward breaks in footnotes and lists */
  .footnotes li, ul li, ol li{
    break-inside: avoid;
  }
}
