/* Print styles — also toggled on-screen via the "Print preview" button
   (which flips this stylesheet's media attribute from "print" to "all"). */

@page {
  size: Letter;
  margin: 0.6in 0.65in 0.75in;
}

.no-print { display: none !important; }

html, body {
  background: #f0efe9 !important;
  color: #111 !important;
  font-size: 11pt;
  line-height: 1.45;
}

/* On-screen preview: frame each "page" like a sheet of paper */
html.print-preview body {
  padding: 0.4in 0 !important;
}
html.print-preview main {
  max-width: 7.5in !important;
  margin: 0 auto !important;
  padding: 0.6in 0.65in 0.75in !important;
  background: white !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}
html.print-preview .print-card {
  position: relative;
}
html.print-preview .print-card::before {
  content: "";
  display: block;
  border-top: 2px dashed #c9a227;
  margin: 0.3in -0.65in 0.25in;
  opacity: 0.5;
}
html.print-preview .print-card:first-of-type::before { display: none; }

/* PDF export: strip the on-screen paper framing since html2pdf handles pages */
html.pdf-export body { padding: 0 !important; background: white !important; }
html.pdf-export main {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}
html.pdf-export .print-card::before { display: none !important; }
html.pdf-export .print-card { page-break-before: always; break-before: page; }
html.pdf-export .print-card:first-of-type { page-break-before: auto; break-before: auto; }
html.pdf-export .no-print { display: none !important; }


/* Neutralize the dark vignette + surface backgrounds */
.vignette,
[class*="bg-surface"],
[class*="bg-background"],
[class*="bg-black"],
[class*="bg-primary/"],
[class*="from-surface"],
[class*="to-black"],
[class*="via-surface"] {
  background: white !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Force readable text everywhere */
.text-muted-foreground,
.text-foreground,
.text-primary-foreground,
[class*="text-foreground/"] {
  color: #222 !important;
}

/* Keep the gold accent visible but printable */
.text-primary,
.gold-underline {
  color: #a07500 !important;
}
.gold-underline {
  background: none !important;
  border-bottom: 2px solid #d4a017 !important;
}

/* Layout: drop the grid + side rail, single column */
main, aside, header, footer, section, div {
  grid-template-columns: none !important;
}
aside { display: none !important; }

/* Headings */
h1 { font-size: 26pt !important; line-height: 1.05 !important; margin-bottom: 0.4rem; }
h2 { font-size: 16pt !important; line-height: 1.15 !important; }
h3 { font-size: 13pt !important; }
h1, h2, h3 {
  break-after: avoid;
  page-break-after: avoid;
}

/* Section cards -> clean numbered blocks with hard breaks */
.print-card {
  background: white !important;
  color: #111 !important;
  border: none !important;
  border-top: 1px solid #999 !important;
  border-radius: 0 !important;
  padding: 0.35in 0 0.25in !important;
  margin: 0 !important;
  break-inside: avoid;
  page-break-inside: avoid;
}
.print-card + .print-card {
  margin-top: 0.15in !important;
}

/* Number badge -> outlined chip */
.print-card [class*="bg-black"] {
  background: white !important;
  color: #a07500 !important;
  border: 2px solid #a07500 !important;
}

/* Checklists */
.print-card ul { list-style: none !important; padding-left: 0 !important; }
.print-card li {
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0.08in 0;
}
.print-card li button {
  padding: 0.05in 0 !important;
  border: none !important;
  background: none !important;
  color: #111 !important;
}
.print-card li svg {
  width: 12pt !important;
  height: 12pt !important;
  color: #111 !important;
  stroke: #111 !important;
}
.print-card li .line-through { text-decoration: line-through !important; }

/* Pull quotes */
blockquote,
.print-card .italic {
  break-inside: avoid;
  page-break-inside: avoid;
  border-left: 3px solid #a07500 !important;
  background: #faf6ea !important;
  color: #222 !important;
  padding: 0.15in 0.2in !important;
  margin: 0.2in 0 !important;
  font-style: italic;
}

/* Warning score callout */
[class*="bg-primary/5"] {
  background: #faf6ea !important;
  border: 1px solid #a07500 !important;
}

/* Links: show URLs after external links */
a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: 9pt;
  color: #555;
  word-break: break-all;
}
a[href^="tel:"]::after,
a[href^="#"]::after { content: ""; }

p, li { orphans: 3; widows: 3; }
