/* astrochart — PDF document stylesheet.
 *
 * The screen view (with its starfield, ticker, drawer, glyph
 * tooltips) is the wrong starting point for a PDF. This sheet is the
 * RIGHT starting point: a clean document surface that uses the
 * active theme's accent on headings + the brand mark, but keeps the
 * body copy near-black for legibility.
 *
 * Loaded after tokens.css + themes.css so it can reach for the
 * theme's --accent-gold (and friends) for headings, the wheel's
 * structural strokes, and the cover-page mark.
 */

/* ---------------------------------------------------------------
 * Page geometry — Letter, generous margins, page numbers in the
 * bottom-right so multi-page reads stay easy to navigate. The
 * @page-margin counters are WeasyPrint syntax; harmless in browser
 * print where they're ignored.
 * ------------------------------------------------------------- */
@page {
  size: Letter;
  margin: 0.85in 0.85in 0.95in 0.85in;
  /* Bottom-right page counter for multi-page reads. */
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-family: "IBM Plex Mono", monospace;
    font-size: 8pt;
    color: #aaa;
  }
  @bottom-left {
    content: "Asteria";
    font-family: "IBM Plex Mono", monospace;
    font-size: 8pt;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.7;
  }
}
@page :first {
  /* The cover page is a poster — no page numbers, no footer line. */
  margin: 0.85in;
  @bottom-right { content: ""; }
  @bottom-left { content: ""; }
}

/* ---------------------------------------------------------------
 * Document body — light surface, serif + body font from the design
 * system. Strip every screen-only element so the doc surface is
 * pristine even when this file is served as HTML+print fallback.
 * ------------------------------------------------------------- */
html, body {
  background: #fff;
  color: #1a1a1a;
  margin: 0;
  padding: 0;
  font-family: var(--font-body, "Mona Sans", "Helvetica Neue", sans-serif);
  font-size: 11pt;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* If anything from the screen view slips through (a topbar import,
 * a tweaks drawer, a banner) we shouldn't see it on paper. */
.topbar, .starfield, .footer, #beta-welcome,
.tt-bar, .shell-skip, .glyph-tip,
.tweaks, .nav-toggle, .nav-instruments, .chart-header,
.chart-controls, .chart-modal-overlay,
.td-xref-line, .sky-xref, .rd-swap-foot, .sa-swap-foot,
.shell-skip {
  display: none !important;
}

/* ---------------------------------------------------------------
 * Cover page — own page, vertically composed. Uses the theme accent
 * on the brand mark; the chart name in the serif display face.
 * ------------------------------------------------------------- */
.pdf-cover {
  page-break-after: always;
  text-align: center;
  padding-top: 0.4in;
  display: block;
}
.pdf-mark {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9pt;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-gold);
  opacity: 0.85;
}
.pdf-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 8.5pt;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-gold);
  opacity: 0.7;
  margin-top: 12pt;
}
.pdf-cover-name {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 300;
  font-size: 38pt;
  line-height: 1.05;
  color: #111;
  margin: 18pt 0 6pt;
  letter-spacing: -0.01em;
}
.pdf-cover-birth {
  font-family: var(--font-body, "Mona Sans", sans-serif);
  font-size: 11pt;
  color: #555;
  margin: 0 0 24pt;
  letter-spacing: 0.01em;
}
.pdf-cover-wheel {
  margin: 12pt auto 0;
  padding: 0;
  /* The wheel is the cover's hero — claim most of the page width. */
  max-width: 6in;
  width: 100%;
}
.pdf-cover-wheel svg {
  display: block;
  width: 100%;
  height: auto;
}
.pdf-cover-foot {
  margin-top: 28pt;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8pt;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #999;
}

/* Reading-style cover (no wheel) — sized smaller so the body opens
 * higher on page 2. */
.pdf-cover-reading {
  padding-top: 1.2in;
}
.pdf-cover-reading .pdf-cover-name {
  font-size: 32pt;
}

/* ---------------------------------------------------------------
 * Content surface — the placements table / reading body that
 * follows the cover page.
 * ------------------------------------------------------------- */
.pdf-content {
  page-break-before: always;
}

/* Headings: accent on h1/h2 carries the theme; h3+ stays ink-dark
 * so the hierarchy reads cleanly without going carnival. */
.pdf-content h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 22pt;
  color: var(--accent-gold);
  margin: 0 0 0.4em;
  line-height: 1.15;
  page-break-after: avoid;
}
.pdf-content h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 15pt;
  color: var(--accent-gold);
  margin: 1.6em 0 0.4em;
  line-height: 1.2;
  page-break-after: avoid;
}
.pdf-content h3 {
  font-family: var(--font-body, "Mona Sans", sans-serif);
  font-weight: 600;
  font-size: 11pt;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.2em 0 0.3em;
  page-break-after: avoid;
}
.pdf-content h2 + *, .pdf-content h3 + * {
  page-break-before: avoid;
}

.pdf-content .eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 8.5pt;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
  opacity: 0.75;
  margin-bottom: 0.3em;
}

.pdf-content p, .pdf-content li {
  color: #1a1a1a;
  font-size: 11pt;
  line-height: 1.55;
  margin: 0.4em 0;
}
.pdf-content .lead {
  font-size: 12pt;
  color: #222;
  line-height: 1.5;
  margin: 0.5em 0 1em;
  max-width: none;
}
.pdf-content ul, .pdf-content ol {
  margin: 0.4em 0 0.8em 1.2em;
  padding: 0;
}
.pdf-content li + li {
  margin-top: 0.3em;
}
.pdf-content a {
  color: var(--accent-gold);
  text-decoration: none;
}

/* Cards: outline-only on paper, no fills, no shadows, but keep the
 * structural border so sections still read as units. */
.pdf-content [class*="-card"],
.pdf-content [class*="-block"],
.pdf-content .pv-section, .pdf-content .pv-ecl,
.pdf-content .pv-rx-card, .pdf-content .td-headline,
.pdf-content .td-moon-card, .pdf-content .td-tt,
.pdf-content .td-prof-card, .pdf-content .pg-moon-card,
.pdf-content .pg-phase, .pdf-content .sky-card,
.pdf-content .sky-aspect-card {
  background: #fff !important;
  border: 0.5pt solid #c8c8c8 !important;
  box-shadow: none !important;
  padding: 0.4cm !important;
  page-break-inside: avoid;
  margin-bottom: 0.4cm !important;
}

/* Tables — heads repeat across pages, no mid-row breaks, zebra
 * rows for scan-ability. Used by .print-table on the chart PDF
 * and by any ad-hoc reading tables. */
.pdf-content table,
.pdf-content .print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5pt;
  page-break-inside: auto;
  margin: 0.6em 0 1.2em;
}
.pdf-content thead {
  display: table-header-group;
}
.pdf-content tbody tr {
  page-break-inside: avoid;
}
.pdf-content th, .pdf-content td {
  padding: 6pt 10pt;
  border-bottom: 0.5pt solid #d8d8d8;
  vertical-align: top;
  text-align: left;
}
.pdf-content thead th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 8pt;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  border-bottom: 0.6pt solid #999;
}
.pdf-content tbody tr:nth-child(even) td,
.pdf-content tbody tr:nth-child(even) th {
  background: #f7f7f3;
}
.pdf-content tbody th {
  color: #111;
  font-weight: 500;
  font-family: Georgia, serif;
}

/* Figures, SVGs, illustrations: keep on a single page. */
.pdf-content figure,
.pdf-content svg,
.pdf-content .chart,
.pdf-content .wheel,
.pdf-content .sky-wheel-wrap {
  page-break-inside: avoid;
  max-width: 100%;
  height: auto;
}

/* Section-level page-break hygiene — sections start fresh when long. */
.pdf-content section, .pdf-content article {
  page-break-inside: auto;
}
.pdf-content section + section {
  page-break-before: auto;
}

/* Pending-reading placeholder — visible apology when we don't yet
 * have a dedicated body extractor for a page. */
.pdf-pending {
  margin-top: 1in;
  padding: 0.4cm 0.5cm;
  border: 0.5pt solid #ddd;
  background: #fafaf7;
  color: #555;
  font-size: 10.5pt;
  font-style: italic;
}
