/* ─────────────────────────────────────────────────────────────────────────
   Privacy Sector Intelligence Report — print stylesheet
   Loads via <link rel="stylesheet" media="print"> on intelligence/privacy/.
   Produces the body pages of Privacy-Sector-Intelligence-Report.pdf.
   The cover (page 1) is rendered separately from print-cover.html.

   Built per ~/fas-partners-site/briefs/Privacy-Sector-Report-v5.4-PDF-Brief-May03.md
   Targets both current v3-era HTML and anticipated v5.4 selectors so the
   v5.4 web rebuild needs only a tuning pass, not a re-architecture.

   Page geometry:
     Letter portrait. 0.85in top/bottom (room for running header/footer),
     0.875in left/right. Set in Playwright PDF options, not via @page.
   ───────────────────────────────────────────────────────────────────────── */

/* ─── Force light theme tokens regardless of OS preference ─────────────── */
html, html[data-theme="dark"], html[data-theme="light"] {
  --accent:           #4A90E2;
  --bg:               #ffffff;
  --bg-elevated:      #f3f1ec;
  --text:             #1a1a1a;
  --text-secondary:   #444;
  --border:           rgba(0,0,0,0.10);
  color-scheme:       light;
}

html, body {
  background: #ffffff !important;
  color: var(--text) !important;
  padding-top: 0 !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
  margin: 0 !important;
}

body {
  font-size: 10.5pt;
  line-height: 1.55;
}

/* ─── Hide screen-only chrome ──────────────────────────────────────────── */
.nav-home,
.mobile-nav,
.mobile-toc,
.skip-link,
#chat-cta,
.chat-cta,
.chat-panel,
#openChatBtn,
button[id*="theme" i],
button[aria-label*="theme" i],
button[aria-label*="dark" i],
button[aria-label*="light" i],
.theme-toggle,
.theme-toggle__btn,
.report-sidebar,
.jump-to-project,
.jump-nav,
.jump-to-project__label,
.share-button,
.share-buttons,
.quotable-share,
.quotable__share,
[data-share],
[data-pdf-skip],
.pdf-download,
.download-pdf,
.copy-link,
.anchor-link-icon,
.cluster__caret,
noscript {
  display: none !important;
}

/* The on-page cover composition is hidden in body PDF; cover renders from
   print-cover.html via a separate Playwright pdf() call. */
#cover {
  display: none !important;
}

/* Skip the boot scripts and PostHog noise visually. */
script, style[data-styled] { display: none !important; }

/* ─── Sticky / fixed elements collapse to static flow ──────────────────── */
.report-sidebar,
.report-sidebar *,
[class*="sticky"],
.theme-heatmap th,
.theme-heatmap td,
.theme-heatmap thead th,
.theme-heatmap th:first-child,
.theme-heatmap td:first-child {
  position: static !important;
  top: auto !important;
  left: auto !important;
  max-height: none !important;
  overflow: visible !important;
  z-index: auto !important;
}

/* Tables: drop horizontal scroll wrappers. */
.adoption-table-wrap,
.ns-table-wrap,
.table-wrap,
.scroll-x {
  overflow: visible !important;
  max-width: none !important;
  padding: 0 !important;
}

/* ─── <details> always-expanded inline ─────────────────────────────────── */
/* The web page collapses How-to-Read, methodology detail, and the seven
   token-narrative costume cards behind <details>/<summary>. In print,
   render every section always-open with the toggle hidden. */
details {
  display: block !important;
}
details > summary {
  display: none !important;
}
details > *:not(summary) {
  display: revert !important;
}
details::details-content {
  display: revert !important;
  block-size: auto !important;
  overflow: visible !important;
}

/* Force open via attribute selector for renderers that ignore the above. */
details:not([open]) {
  /* visual fallback: still render contents */
}

/* ─── Layout containers ───────────────────────────────────────────────── */
.report-shell {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.read-column,
.read-wide,
.container,
main,
section {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

section {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

/* The screen page uses var(--s7) = 48px vertical section padding for the
   editorial breathing room. In print, the page break itself is the spacer;
   stacking 48px on top adds half an inch of dead vertical at every break. */
section,
.read-column,
.read-wide {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Per-project mini-sections: tighten internal padding so each card fits on
   one page (Joni's brief decision #4.6: one card per page). */
.mini-section {
  padding: 0 !important;
  border-bottom: none !important;
  margin: 0 !important;
}
.mini-section__inner {
  padding: 0 !important;
  max-width: none !important;
  gap: 0.3in !important;
  grid-template-columns: 2.6in 1fr !important;
  align-items: start !important;
}
.mini-section__spider {
  gap: 0.1in !important;
}
.mini-section__spider-svg {
  width: 2.5in !important;
  height: 2.5in !important;
  max-width: 2.5in !important;
}
.mini-section__body {
  gap: 0.12in !important;
  font-size: 9.5pt !important;
  line-height: 1.45 !important;
}
.mini-section__head {
  margin-bottom: 0.15in !important;
}
.mini-section__name {
  font-size: 16pt !important;
}
/* Per-project CTA link drops in print (no clickable links) — brief 4.9. */
.mini-section__cta {
  display: none !important;
}

/* ─── Force collapsibles open: cluster cards, method-detail-details ────── */
/* Cluster cards (Section 7) toggle .open via JS; force every cluster body
   visible so the printed PDF reads as fully expanded regardless of state. */
.cluster {
  break-inside: auto;
}
.cluster .cluster__head {
  cursor: default !important;
  pointer-events: none;
}
.cluster .cluster__body,
.cluster:not(.open) .cluster__body {
  display: block !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
}
/* Two cluster cards per page where they fit (per brief Section 2.9). */
.cluster + .cluster { margin-top: 0.4in; }

/* ─── Page breaks ─────────────────────────────────────────────────────── */
/* Top-level sections start on a new page. */
section[id] {
  break-before: page;
  page-break-before: always;
}

/* The first section after the (hidden) cover should start at page 1 of the
   body PDF, not break before. The generator strips #cover; the next section
   is the executive summary (v5.4) or orientation (v3). */
section:first-of-type,
section#cover + section,
section#chat-cta + section,
#executive-summary {
  break-before: auto;
  page-break-before: auto;
}

/* Per-project mini-section cards: one card per page (Joni's call). */
.project-card,
.project-mini-section,
.mini-section,
[data-project-card],
section[id^="project-"],
article.project {
  break-before: page;
  page-break-before: always;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Full-spread visualizations earn their own page. */
.signature-chart,
.signature-chart-container,
.sov-composition-chart,
.sov-chart,
.trajectory-chart,
.compliance-composability,
.compliance-composability-scale,
.theme-project-heatmap,
.methodology-pipeline,
.methodology-diagram,
.cluster-overlay-map,
.full-spread,
.full-bleed-chart {
  break-before: page;
  page-break-before: always;
  break-after: page;
  page-break-after: always;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Quotable findings callout: own bordered page at the end of section 3. */
.quotable-findings,
.quotable-findings-callout,
[data-quotable-findings] {
  break-before: page;
  page-break-before: always;
  break-after: page;
  page-break-after: always;
  break-inside: avoid;
}

/* No orphaned section headers. */
h1, h2, h3, h4 {
  break-after: avoid;
  page-break-after: avoid;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Charts, tables, figures keep together when feasible. */
figure,
table,
.chart,
svg,
.dimensions,
.lenses,
.signature-card,
.callout,
.pull-quote {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Table rows: don't split a single row across pages. */
tr, td, th {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Body prose: orphan/widow control + hyphenation. */
p, li {
  orphans: 3;
  widows: 3;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* ─── Anchor de-styling (no clickable affordance in print) ─────────────── */
a {
  color: var(--text) !important;
  text-decoration: none !important;
}

/* External and footnote anchors keep accent so referenced URLs are scannable. */
a[href^="http"]:not(.btn-primary):not(.cta),
a.external,
a.footnote-ref {
  color: var(--accent) !important;
  text-decoration: none !important;
}

/* Strip the pseudo-element "→" treatments meant for hover affordance. */
a::after { content: none !important; }

/* In-section anchor offsets (used to compensate for sticky nav) collapse. */
.anchor,
[id].anchor,
span.anchor {
  display: inline !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ─── Typography for print scale ──────────────────────────────────────── */
.eyebrow {
  font-size: 8.5pt;
  letter-spacing: 0.14em;
  margin-bottom: 0.4em !important;
}

.section-title {
  font-size: 22pt;
  line-height: 1.1;
  margin-top: 0 !important;
  margin-bottom: 0.6em !important;
}

.section-title__num {
  font-size: 11pt;
  margin-right: 0.5em;
}

h2 {
  font-size: 18pt;
  line-height: 1.15;
  margin-top: 0.6em;
  margin-bottom: 0.4em;
}

h3 {
  font-size: 13pt;
  line-height: 1.2;
  margin-top: 0.6em;
  margin-bottom: 0.3em;
}

h4 {
  font-size: 11pt;
  line-height: 1.25;
  margin-top: 0.5em;
  margin-bottom: 0.25em;
}

p.lead {
  font-size: 12pt;
  line-height: 1.55;
  color: var(--text) !important;
}

p.body, p {
  font-size: 10.5pt;
  line-height: 1.55;
  color: var(--text) !important;
  margin-bottom: 0.85em;
}

/* Pull quotes: keep visual treatment; share buttons already hidden above. */
.pull-quote,
blockquote.callout,
.callout--pull-quote {
  font-size: 14pt;
  line-height: 1.4;
  font-style: italic;
  border-left: 3px solid var(--accent) !important;
  padding-left: 1em !important;
  margin: 1em 0 1.2em !important;
  break-inside: avoid;
}

/* Quotable findings styling without share affordance. */
.quotable,
.quotable-findings,
.quotable-findings-callout {
  border: 1px solid var(--border) !important;
  background: var(--bg-elevated) !important;
  padding: 0.6in !important;
  margin: 0 !important;
  text-align: left;
}
.quotable blockquote,
.quotable .quote,
.quotable__line,
.quotable-findings blockquote,
.quotable-findings .quote {
  font-size: 14pt;
  line-height: 1.45;
  font-style: italic;
  margin: 0.6em 0 1.2em !important;
  display: block !important;
}
.quotable__list { list-style: none; padding: 0; margin: 0; }
.quotable__eyebrow {
  font-size: 8.5pt;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent) !important;
  margin-bottom: 1em !important;
}

/* Spider charts: preserve at print scale (~2.5in square). */
.spider-chart,
.spider-svg,
svg.spider {
  width: 2.5in !important;
  height: 2.5in !important;
  max-width: 2.5in !important;
}

/* Heatmap cells: ensure printable contrast even when WebKit color-adjust
   defaults to economical. The body-level color-adjust above forces exact. */
.theme-heatmap td,
.channel-load-heatmap td,
.heatmap-cell {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* SOV composition bars: keep stacked segments visually distinct in print. */
.sov-bar,
.sov-segment--authored,
.sov-segment--third-party {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* ─── Tables ──────────────────────────────────────────────────────────── */
table {
  width: 100% !important;
  font-size: 9pt;
  border-collapse: collapse;
}

th, td {
  padding: 6pt 8pt !important;
  border: 1px solid var(--border) !important;
  vertical-align: top;
}

thead th {
  background: var(--bg-elevated) !important;
  font-weight: 600;
}

/* Vertical-rl rotation in heatmap header doesn't print well; revert. */
.theme-heatmap thead th {
  writing-mode: horizontal-tb !important;
  transform: none !important;
  height: auto !important;
  white-space: normal !important;
}

/* ─── Working session CTA: ink-only treatment ─────────────────────────── */
.btn-primary,
a.btn-primary,
button.btn-primary {
  display: inline-block;
  padding: 0.4em 0.8em !important;
  border: 1.5px solid var(--accent) !important;
  background: transparent !important;
  color: var(--accent) !important;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 4px;
}

/* Working session URL written out so reader knows where to go. */
.working-session-cta::after,
a[href*="/intelligence/privacy/conversation"]::after {
  content: " (https://fas.partners/intelligence/privacy/conversation)";
  font-size: 9pt;
  color: var(--text-secondary) !important;
  font-weight: 400;
  font-style: italic;
}

/* ─── [verify] tag visibility ─────────────────────────────────────────── */
.verify,
[data-verify],
.pending-data {
  background: rgba(255, 230, 100, 0.35) !important;
  padding: 0 0.2em;
  border-radius: 2px;
  font-style: italic;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* ─── Misc ────────────────────────────────────────────────────────────── */

/* Hide the in-page anchor markers used by sticky-nav offset trickery. */
span[id][class="anchor"] { display: inline-block; height: 0; }

/* Remove background gradient banners and decorative full-bleed strips that
   look heavy in print. */
.section-banner,
.gradient-band,
.full-bleed-bg {
  background: none !important;
}

/* Last-resort: any remaining fixed/absolute elements snap to static. */
.fixed,
.floating,
[style*="position: fixed"],
[style*="position:fixed"] {
  position: static !important;
}

/* ─── v5.6: tighten magazine pull quotes and reactive elements for print ─ */
.magazine-quote {
  margin: var(--s4) auto !important;
  padding: var(--s3) 0 !important;
  page-break-inside: avoid;
  break-inside: avoid;
}
.magazine-quote p {
  font-size: 1.05rem !important;
  line-height: 1.35 !important;
}
.magazine-callback__intro,
.magazine-callback__outro {
  font-size: 0.85rem !important;
  margin: var(--s2) auto !important;
}
.magazine-quote[data-eyebrow]::before { margin-bottom: var(--s2) !important; }
/* leader-line stack stays compact for print */
.subtheme-scale__track { height: 90px !important; }
