/* CHANGE LOG
   File: static/css/prohrhq_print.css
   Purpose: (1) Styles the /print-all aggregate page for screen and print.
            (2) Loaded media="print" on every public page via base_public.html
                so Ctrl/Cmd-P expands in-DOM hidden content (tabs, split-view
                detail, collapsed <details>, calculator output) instead of
                dropping it. Screen rendering of normal pages is untouched
                because the base_public link is media="print".
   Version History:
   2026-08-14 v1.1 - Added dark-background/white-text print fix for
                     .ph-hero-overlay-text, .ph-dq-strip, .ph-dq-final-cta,
                     and .ph-cta-primary sitewide. Michael: "I can't
                     print it to a PDF that I can read." See the block's
                     own comment below for the full explanation.
   2026-08-13 v1.0 - Initial build.
*/

/* ---------- /print-all: screen + shared page layout ---------- */
.pa-body {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  font: 16px/1.6 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111;
  background: #fff;
}
.pa-title { font-size: 1.7rem; margin: 0 0 .25rem; color: #1f2a44; }
.pa-sub { color: #444; margin: 0 0 .5rem; font-size: .95rem; }
.pa-sub kbd {
  border: 1px solid #bbb; border-radius: .25rem; padding: 0 .3rem;
  font: inherit; background: #f5f5f5;
}
.pa-mode { font-size: .9rem; color: #555; margin: 0 0 1.75rem; }
.pa-mode a { color: #1f2a44; font-weight: 600; }
.pa-toc {
  border: 1px solid #ddd; border-radius: .6rem; padding: 1rem 1.25rem;
  margin: 0 0 2.5rem; background: #fafafa;
}
.pa-toc-title { font-size: 1.1rem; margin: 0 0 .6rem; }
.pa-toc-list { margin: 0; padding-left: 1.25rem; }
.pa-toc-list li { margin: .18rem 0; }
.pa-toc-list a { color: #1f2a44; }
.pa-toc-path { color: #999; font-size: .78rem; margin-left: .5rem; font-family: ui-monospace, Menlo, Consolas, monospace; }

.pa-page {
  border-top: 3px solid #1f2a44;
  padding-top: 1.25rem;
  margin-top: 3rem;
}
.pa-page-title { font-size: 1.4rem; margin: 0 0 .1rem; color: #1f2a44; }
.pa-page-url { color: #999; font-size: .78rem; margin: 0 0 1.1rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pa-page-body { max-width: none; }
.pa-page-body img { max-width: 100%; height: auto; }
.pa-page-body table { border-collapse: collapse; }

/* ---------- Force-expand normally-hidden content ----------
   These rules live at the top level of a print-scoped stylesheet, so on normal
   pages (base_public loads this media="print") they apply ONLY while printing.
   On /print-all the sheet is all-media, so they apply on screen too — which is
   what we want there. */
[hidden] { display: revert !important; }
[aria-hidden="true"] { display: revert !important; }
.ph-calc-hidden { display: block !important; }
.ph-job-review-detail { display: block !important; }
details { display: block !important; }
details > summary { font-weight: 600; }
details:not([open]) > * { display: revert !important; }

/* ---------- Print tuning ---------- */
@media print {
  .pa-body { max-width: none; padding: 0; color: #000; }
  .pa-toc { break-after: page; page-break-after: always; }
  .pa-page { break-before: page; page-break-before: always; }
  .pa-page:first-of-type { break-before: auto; page-break-before: auto; }
  a { color: #000; text-decoration: none; }
  .pa-page-body { break-inside: auto; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  img, table, figure { break-inside: avoid; page-break-inside: avoid; }
}

/* ---------- Dark-background/white-text blocks (all pages) ----------
   This file is loaded media="print" on every public page, so these
   rules apply whenever printing, same as the block above -- wrapped in
   @media print for consistency with it and to avoid affecting
   /print-all's own screen rendering (which loads this file all-media).
   Three blocks set an EXPLICIT white text color on a dark background
   (.ph-hero-overlay-text, .ph-dq-strip, .ph-dq-final-cta). Most
   browsers print with "background graphics" off by default, so each
   block's CSS background gets dropped -- but the explicit white text
   still wins on specificity, so it renders white on the printed page's
   white background: invisible. Michael: "I can't print it to a PDF
   that I can read." .ph-cta-primary gets the same fix everywhere in
   print, not just inside these three -- identical risk anywhere used. */
@media print {
  .ph-hero-overlay-text {
    position: static; background: none; color: #000; text-align: left;
    max-width: none; padding: 0.75rem 0;
  }
  .ph-hero-overlay-eyebrow, .ph-hero-overlay-text h1,
  .ph-dq-final-cta h2, .ph-dq-final-cta-sub, .ph-dq-strip span { color: #000; }
  .ph-dq-strip, .ph-dq-final-cta { background: none; color: #000; border: 1px solid #ccc; }
  .ph-dq-final-cta .ph-cta-primary, .ph-cta-primary {
    background: none; color: #000; border: 1px solid #000;
  }
}

/* 2026-08-14 — Never print an open image lightbox or content modal. */
.ph-ex-lightbox,
.ph-ex-overlay {
  display: none !important;
}

body.ph-ex-lightbox-locked {
  overflow: visible !important;
}
