/*
 * Print styles. Loaded via media="print" so the runtime cost is zero in
 * normal browsing. Targets news articles, research reports, and goals
 * page — the content people actually print.
 *
 * Strategy:
 *   - hide chrome (header, footer, share, back-to-top, breadcrumbs)
 *   - force black-on-white type with predictable margins
 *   - expand all relative href and src URLs so the printed page is
 *     self-citing
 *   - break content cleanly across pages
 */

@page {
  margin: 2cm 2.2cm;
  size: A4;
}

/* ---------- Hide chrome ---------- */

.site-header,
.site-footer,
.back-to-top,
.share-row,
.breadcrumbs,
.skip-link,
.mobile-menu,
.reading-progress,
.newsletter,
.news-filters,
.news-pagination,
.research-filters,
.album-nav,
.section-header__more,
.btn,
.link-arrow,
[hidden],
script {
  display: none !important;
}

/* ---------- Reset background + colour ---------- */

html, body {
  background: #fff !important;
  color: #000 !important;
}

* {
  background: transparent !important;
  color: #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}

/* ---------- Typography in print ---------- */

body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11pt;
  line-height: 1.45;
}

h1 { font-size: 22pt; margin-block: 0 0.5em; }
h2 { font-size: 16pt; margin-block: 1em 0.3em; }
h3 { font-size: 13pt; margin-block: 1em 0.3em; }

.display { font-size: 24pt !important; line-height: 1.15 !important; }

.eyebrow {
  font-size: 9pt !important;
  letter-spacing: 0.12em;
  margin-block-end: 0.4em;
}

.lead, .dek { font-size: 12pt; }

p { orphans: 3; widows: 3; }

/* ---------- Article structure ---------- */

main { display: block; }
.container, .container-prose, .container-tight, .container-wide { max-width: 100%; padding: 0; }
.section, .section-tight { padding: 0; }

article, section { break-inside: auto; }
figure, img, blockquote, table { break-inside: avoid; }

img {
  max-width: 100%;
  height: auto;
  page-break-inside: avoid;
}

.article__lead img { max-height: 12cm; }

blockquote {
  border-left: 2pt solid #000 !important;
  padding-left: 0.8em;
  font-style: italic;
  margin-block: 1em;
}

/* ---------- Expand relative URLs after their links ---------- */

a[href]:not(.no-print-url):after {
  content: " (" attr(href) ")";
  font-size: 9pt;
  font-style: italic;
  font-weight: normal;
  word-break: break-all;
}

/* …but not for in-document anchors or mailto/tel which are self-evident */
a[href^="#"]:after,
a[href^="mailto:"]:after,
a[href^="tel:"]:after,
a[href^="javascript"]:after {
  content: "";
}

a, a:visited {
  color: #000 !important;
  text-decoration: underline;
}

/* ---------- Tables in print ---------- */

table { border-collapse: collapse; width: 100%; }
th, td { border: 1pt solid #ccc; padding: 4pt 6pt; text-align: left; }
thead { display: table-header-group; }
tr { page-break-inside: avoid; }

/* ---------- WACAM-specific clean-ups ---------- */

/* Drop pull-quote serif italic to plain — easier to read on paper */
.serif-pullquote {
  font-style: italic;
  font-size: 14pt;
  text-align: left;
  border-left: 2pt solid #000 !important;
  padding-left: 0.8em;
  margin-block: 1em;
}

/* Drop the masonry/grid layouts on print — let images flow */
.masonry { columns: 1 !important; }
.news-grid, .reports-list, .video-grid, .partners-grid, .wwd-tier {
  display: block !important;
}

/* Drop sticky positioning */
.goals-toc, .about-split__media {
  position: static !important;
}

/* Hide the goals TOC sidebar — table-of-contents is irrelevant on paper */
.goals-toc, .video-card, lite-youtube { display: none !important; }

/* Hide images that exist only as decorative placeholders */
.about-preview__placeholder,
.home-hero__placeholder,
.report-featured__placeholder,
.report-card__placeholder,
.news-card__placeholder {
  display: none !important;
}

/* Print attribution footer */
body::after {
  content: "© " attr(data-year) " WACAM · wacamgh.org · Printed from this page.";
  display: block;
  margin-top: 2em;
  padding-top: 0.5em;
  border-top: 1pt solid #ccc;
  font-size: 9pt;
  color: #555 !important;
}
