/* ==========================================================================
   Printing and "Save as PDF" (linked on every public page with media="print",
   src/features/pwa.js). Strips the site chrome so articles print as clean
   pages: a small masthead, the article in a serif at reading size, the
   address of external links in article text, and at the foot the page
   address, copyright and print date (.pwa-colophon, added by pwa.js).
   Feature stylesheets keep their own @media print tweaks.
   ========================================================================== */

@page { margin: 16mm 16mm 18mm; }

html, body { background: #fff !important; color: #000; }
body { font-family: var(--font-serif, Georgia, 'Times New Roman', serif); font-size: 11pt; line-height: 1.5; }

/* ---- Chrome that has no place on paper ---------------------------------- */
.skip-link, .utility-bar, .main-nav, .nav-toggle, .header-search, .header-tools,
.eg-banner, .site-footer, .route-divider,
.nl-band, .nl-popup, #nl-popup-template, .nl-form,
.pl-share, .xp-share, .nr-share, .jr-share, .ev-share, .tk-share, .pwa-print,
.pl-related, .xp-related, .nr-related, .back-link, .pl-back,
.pl-crumbs, .xp-crumbs, .nr-crumbs, .jr-crumbs, nav[aria-label="Breadcrumb"],
.section-ink.eg-cta, .nr-cta, .hb-cta, .nl-archive-cta, .nl-issue-cta, .ob-cta, main .btn, main form, iframe, video, audio, dialog { display: none !important; }

/* ---- Masthead: the logo and name only ----------------------------------- */
html body .site-header {
  display: block !important; position: static !important; background: none !important; box-shadow: none !important;
  border: 0; border-bottom: 1pt solid #000; padding: 0 0 6pt; margin: 0 0 14pt;
}
.site-header .container { display: block; height: auto !important; min-height: 0; padding: 0; max-width: none; }
.site-header .brand { display: flex; align-items: center; gap: 8pt; color: #000; text-decoration: none; }
.site-header .brand-mark { width: 26pt !important; height: 26pt !important; }
.site-header .brand-text { font-family: var(--font, sans-serif); font-size: 10.5pt !important; color: #000 !important; }
.site-header .brand-text * { color: #000 !important; }
.site-header .brand-text span { font-size: 6.5pt !important; color: #444 !important; }

/* ---- Page body ---------------------------------------------------------- */
.container { max-width: none !important; padding-left: 0 !important; padding-right: 0 !important; }
main .section { padding: 0 0 12pt !important; background: none !important; }
.reveal, .h-reveal { opacity: 1 !important; transform: none !important; }
* { box-shadow: none !important; text-shadow: none !important; }

/* Dark heroes print as plain black on white. */
.page-hero, .nr-hero, .jr-hero, .xp-head, .pl-head, .section-ink {
  background: none !important; color: #000 !important; padding: 0 0 8pt !important; border: 0 !important;
}
.page-hero *, .nr-hero *, .jr-hero *, .section-ink * { color: #000 !important; }
.page-hero .dateline { color: #444 !important; }

h1, h2, h3, h4, h5, h6 { color: #000 !important; break-after: avoid; page-break-after: avoid; }
h1 { font-size: 24pt !important; line-height: 1.15; margin: 0 0 8pt; }
h2 { font-size: 15pt !important; margin-top: 14pt; }
h3 { font-size: 12.5pt !important; }
p, li, dd, dt, td, th, figcaption, blockquote { color: #000; orphans: 3; widows: 3; }
.lede { font-size: 13pt !important; color: #222 !important; }
a { color: #000 !important; text-decoration: underline; text-decoration-thickness: 0.5pt; }

/* Long-form text: serif at reading size. */
.prose, .nr-prose, .xp-prose, .jr-prose, .pl-abstract, .pl-section, .lg-body, .article {
  font-family: var(--font-serif, Georgia, serif) !important; font-size: 11.5pt !important; line-height: 1.55 !important; max-width: none !important;
}
.prose p, .nr-prose p, .xp-prose p, .jr-prose p { font-size: inherit !important; }

/* External links in article text: show where they go. */
:is(.prose, .nr-prose, .xp-prose, .jr-prose, .pl-abstract, .lg-body) a[href^="http"]:not([href*="cupa.org.pk"])::after {
  content: " (" attr(href) ")"; font-family: var(--font, sans-serif); font-size: 8.5pt; color: #444; word-break: break-all;
}
.lg-body a[href^="http"]::after { content: none; } /* legal.css adds its own */
:is(.prose, .nr-prose, .xp-prose, .jr-prose) a[href^="http"] svg { display: none; }

/* Citations: the formatted styles, not the machine formats (BibTeX, RIS). */
.pl-cite-panel:has(.pl-cite-code), .jr-cite-panel:has(.jr-cite-code), .pl-cite-files, .jr-cite-files, .pl-copy, .jr-copy, .xp-copy { display: none !important; }

/* Keep figures, tables, quotes and code whole. */
figure, img, svg, table, pre, blockquote, .pull-quote, .xc-chart, .xp-chart, .card { break-inside: avoid; page-break-inside: avoid; }
img, svg, figure { max-width: 100% !important; height: auto; }
thead { display: table-header-group; }
tr { break-inside: avoid; }
table { border-collapse: collapse; }
th, td { border-bottom: 0.5pt solid #999; }
pre { white-space: pre-wrap; border: 0.5pt solid #999; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ---- Foot of the printout ----------------------------------------------- */
.pwa-colophon[hidden] {
  display: block !important; margin-top: 18pt; padding-top: 6pt; border-top: 0.5pt solid #000;
  font-family: var(--font, sans-serif); font-size: 8pt; color: #333; break-inside: avoid;
}
.pwa-colophon span { display: block; }
.pwa-colophon-url { word-break: break-all; }
