/* Print-only stylesheet for Summary printing */

/* Page setup */
@page {
  size: A4;
  margin: 12mm;
}

html,
body {
  background: #ffffff !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Force light theme when printing regardless of current dark mode.
   The JS sets data-print-force-light on <html>. Neutralize dark-specific utilities. */
html[data-print-force-light] body,
html[data-print-force-light] {
  color-scheme: light !important;
}
html[data-print-force-light] .dark\:bg-green-950,
html[data-print-force-light] .dark\:bg-blue-900,
html[data-print-force-light] .dark\:bg-amber-900,
html[data-print-force-light] .dark\:bg-green-900,
html[data-print-force-light] .dark\:bg-background,
html[data-print-force-light] .dark\:bg-neutral-900,
html[data-print-force-light] .dark\:bg-gray-900 {
  background-color: #ffffff !important;
}
html[data-print-force-light] .dark\:text-green-100,
html[data-print-force-light] .dark\:text-blue-100,
html[data-print-force-light] .dark\:text-amber-100,
html[data-print-force-light] .dark\:text-green-200,
html[data-print-force-light] .dark\:text-neutral-100,
html[data-print-force-light] .dark\:text-gray-100,
html[data-print-force-light] .dark\:text-foreground {
  color: #111827 !important; /* Tailwind gray-900 */
}
html[data-print-force-light] .dark\:border-green-800,
html[data-print-force-light] .dark\:border-amber-800,
html[data-print-force-light] .dark\:border-border,
html[data-print-force-light] .dark\:border-gray-800,
html[data-print-force-light] .dark\:border-neutral-800 {
  border-color: #d1d5db !important; /* gray-300 */
}
/* Generic dark: variants fallback */
html[data-print-force-light] [class*="dark:bg-"] {
  background-color: #ffffff !important;
}
html[data-print-force-light] [class*="dark:text-"] {
  color: #111827 !important;
}
html[data-print-force-light] [class*="dark:border-"] {
  border-color: #d1d5db !important;
}

/* Clone-and-print strategy: when body has .pj-printing, only the cloned
   summary (#summary-printable-print) is visible for printing. */
@media print {
  body.pj-printing > *:not(#summary-printable-print) {
    display: none !important;
  }
  #summary-printable-print {
    display: block !important;
    position: static !important;
    width: auto !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html,
  body,
  #summary-printable-print {
    height: auto !important;
    overflow: visible !important;
  }
}

/* Helpful utilities */
.print-hidden,
.no-print {
  display: none !important;
}

/* Elements that should only appear in print */
.print-only {
  display: none !important;
}
@media print {
  .print-only {
    display: block !important;
  }
}

/* Avoid awkward page breaks inside cards and key blocks */
[data-slot="card"],
section,
article,
img,
svg,
ul,
ol,
pre,
blockquote {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Optional: tighten spacing a bit for print */
#summary-printable h1,
#summary-printable h2,
#summary-printable h3,
#summary-printable h4 {
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
}
#summary-printable p {
  margin: 0.25rem 0;
}
