/* ═══════════════════════════════════════════════════════
   PRINT STYLES — Clean academic PDF output
   Loaded via <link rel="stylesheet" href="/print.css" media="print">
   Non-blocking for screen devices.
   ═══════════════════════════════════════════════════════ */

/* ─── Page Setup ─── */
@page {
  size: A4;
  margin: 18mm 15mm 18mm 15mm;
}

/* ─── Reset body for print ─── */
body {
  background: white !important;
  color: #1a1a1a !important;
  font-size: 11pt !important;
  line-height: 1.5 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ─── Hide UI chrome (navbar, footer, side nav, mobile bar, buttons) ─── */
header,
footer,
aside,
nav[aria-label="Mobile Quick Jump"],
nav[aria-label="Table of Contents"],
.print\:hidden,
button,
[class*="sticky"] {
  display: none !important;
}

/* ─── Remove max-width / padding constraints — use full page width ─── */
main,
main > * {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ─── Force single-column layout (override lg:grid-cols) ─── */
.grid {
  display: block !important;
}

.grid > * {
  width: 100% !important;
  max-width: 100% !important;
}

/* ─── Section cards: no shadows, subtle borders ─── */
section,
[class*="rounded-lg"] {
  box-shadow: none !important;
  border-radius: 4px !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* ─── Headings: tighter spacing for print ─── */
h1 {
  font-size: 18pt !important;
  margin-bottom: 6pt !important;
}

h2 {
  font-size: 13pt !important;
  margin-top: 10pt !important;
  margin-bottom: 4pt !important;
}

h3,
h4 {
  font-size: 11pt !important;
}

/* ─── Links: show URL in print ─── */
a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: 8pt;
  color: #666;
  word-break: break-all;
}

/* Don't show URL for internal/anchor links or ORCID badges */
a[href^="#"]::after,
a[href^="/"]::after,
a[class*="orcid"]::after,
nav a::after {
  content: none !important;
}

/* ─── Section spacing for print ─── */
.space-y-12 > * + *,
.space-y-14 > * + *,
.space-y-16 > * + * {
  margin-top: 16pt !important;
}

.space-y-6 > * + *,
.space-y-8 > * + * {
  margin-top: 8pt !important;
}

/* ─── Page-break intelligence ─── */
/* Keep section headers with their content */
[class*="border-s-4"] {
  break-after: avoid;
  page-break-after: avoid;
}

/* Avoid breaking inside cards, timeline items */
[class*="hover\\:shadow"],
[class*="hover\\:border"] {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* ─── Background colours: flatten for print ─── */
[class*="bg-slate-50"],
[class*="bg-slate-100"],
[class*="bg-blue-50"],
[class*="bg-emerald-50"] {
  background-color: #f8f9fa !important;
}

/* ─── Remove hover effects ─── */
* {
  transition: none !important;
  animation: none !important;
}

/* ─── Ensure images print ─── */
img {
  max-width: 100% !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* ─── Metric badges: compact grid for print ─── */
.grid-cols-2,
.grid-cols-4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8pt !important;
}

/* ─── Bottom CTA banner: hide or simplify ─── */
[class*="bg-slate-50\\/80"] {
  border: 1px solid #ccc !important;
  background: white !important;
}
