/**
 * @file
 * Print stylesheet. (FND-4 / DONI-544)
 *
 * This file was already registered in hcp_nxt.libraries.yml with
 * `{ media: print }` but was EMPTY — zero bytes — so nothing in it had
 * ever been written. The wiring was correct; the content was missing.
 *
 * THE COMPLIANCE POINT, which is what makes this more than cosmetics:
 * the ISI is regulated content and renders as a FIXED, collapsible
 * footer tray. Fixed positioning is the single most common way a
 * printed page loses content — a `position: fixed` element prints on
 * the first page only, clipped to the tray's own height, so a printout
 * would carry a few lines of Important Safety Information and silently
 * drop the rest. Every rule under "ISI" below exists to stop that.
 *
 * VERIFIED 2026-08-02 (FND-8 / DONI-676). This file was printed for the
 * first time and its core claim held: the ISI prints in full and
 * un-clipped.
 *
 * FIXED HERE — three of the four defects DONI-676 listed, plus two the
 * ticket did not:
 *   - the ISI printed TWICE; it now prints once
 *   - CTA buttons collapsed to hairlines
 *   - cards split their heading from their body across a page break
 *   - the dev canary banner prints, and has no environment guard
 *   - ✏️ DONI-869: efficacy's whole article was an atomic inline, so it
 *     could not start on page 1 and left it 86% blank
 *
 * ⚠️ THIS LIST USED TO CLAIM A SIXTH, "collapsed accordions would have
 * dropped regulated copy silently". IT WAS NOT TRUE and it has been
 * removed. DONI-869 printed the page those accordions ship on and
 * searched the text: the panels print their question and drop their
 * answer, today. The rules are still in this file, still inert, with
 * the measurement written against them at their own section.
 *
 * NOT FIXED — the hero page-break. EIGHT attempts now, each trading the
 * defect for a different one. Left alone with a full account at its
 * section below, because it needs a design answer rather than more CSS.
 * ✏️ Re-printed 2026-08-03: the defect is milder than this file used to
 * say. The artwork, the indication banner and the first headline line
 * all print on page 1; no page is near-empty. What remains is a
 * mid-sentence break in the headline. See the section below.
 *
 * HOW TO RE-VERIFY. There is no visual regression tooling in this repo
 * (Diffy is run by hand from its dashboard), so printing is the test:
 *
 *   fin nxt/drush cr          # or you print the cached old cascade
 *   agent-browser pdf out.pdf # renders with print media applied
 *
 * Do NOT trust `Emulation.setEmulatedMedia`-style print emulation for
 * this: it reported success here while `matchMedia('print').matches`
 * stayed false. Generate a PDF and read it.
 *
 * STILL NOT ESTABLISHED: whether the printed result is ACCEPTABLE for
 * MLR. That is a human judgement about regulated output, and no
 * measurement in this repo settles it.
 */

@page {
  margin: 15mm;
}

html,
body {
  background: #fff !important;
  color: #000;
  font-family: var(--font-agenda);
  font-size: 11pt;
  line-height: 1.35;
}

/* Print in black. Coral on white measures 3.02:1 — acceptable on
   screen for non-text, poor as body copy on paper, and on a greyscale
   printer both corals collapse to the same mid grey. */
* {
  background: transparent !important;
  color: #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* --- ISI: print it once, in full ----------------------------------
 *
 * FND-8. Every page emits the regulated ISI TWICE, from two separate
 * render arrays in hcp_nxt_isi.module:
 *
 *   in-page  main > .layout-content > .isi-footer-content
 *            hcp_nxt_isi.module:217 — #weight 1000, PLUS
 *            #resource_description
 *   tray     body > .isi-tray
 *            hcp_nxt_isi.module:185 — into page_bottom
 *
 * ✏️ CORRECTED 2026-08-04. This named `isi_tray.module` and said the two
 * surfaces rendered `content.maximized` and `content.medium`. Both were
 * true when written and are not now: `hcp_nxt_isi` replaced `isi_tray`
 * on this theme (DONI-872) and holds ONE content field, so the copy is
 * identical on both surfaces by construction. That is the point of the
 * module.
 *
 * FND-4 un-fixed the tray so it would stop printing clipped, which was
 * right, but that left both copies printing in full — the same safety
 * text twice in one document.
 *
 * THE IN-PAGE COPY IS CANONICAL. It used to be canonical because it
 * rendered the richer `maximized` string; now that both render the same
 * copy, the reason is narrower but still holds — it is the only one
 * carrying `resource_description`, the extra regulated copy on resource
 * pages. The tray is viewport chrome, and its whole purpose is
 * persistence while scrolling, which paper does not do.
 *
 * WHY `:has()` AND NOT AN UNCONDITIONAL HIDE. If a page ever emits the
 * tray without the in-page copy, an unconditional rule would print NO
 * safety information at all. That is the one failure this file must
 * never allow, so the tray is suppressed only when the in-page copy is
 * demonstrably present. The failure direction is deliberate: worst case
 * is a duplicate, which is reviewable, never an absence.
 *
 * ⚠️ THE REASON FOR NOT USING A BODY CLASS HAS EXPIRED, and the note
 * that gave it was misleading a future reader. It said a body class set
 * in `isi_tray_preprocess_html` would express this contract more plainly
 * but could not be used, because `isi_tray` is shared with the live
 * `dawnzerahcp_full` theme. `hcp_nxt_isi` is enabled on `hcp_nxt` ONLY —
 * `isi_tray` is uninstalled here — so a body class from
 * `hcp_nxt_isi_preprocess_html()` now costs the live site nothing.
 *
 * It is still not done, for a different and weaker reason: `:has()` needs
 * no PHP and this rule works. If anyone wants the clearer version, the
 * constraint that blocked it is gone — that is the only thing this note
 * is now claiming.
 *
 * Verified 2026-08-04: the selector resolves to exactly one tray and one
 * in-page block in all three tray states. */
body:has(.isi-footer-content) .isi-tray {
  display: none !important;
}

/* The in-page copy is the one that has to survive pagination. */
.isi-footer-content,
.isi-footer-content .isi-tray-content {
  position: static !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  transform: none !important;
  page-break-inside: auto;
  break-inside: auto;
}

.isi-footer-content {
  border-top: 1pt solid #000;
}

/* Belt and braces: if the tray DOES print — because `:has()` did not
   apply, or a page lacks the in-page copy — it must still print whole
   rather than clipped to its on-screen height. This is the FND-4
   behaviour, retained deliberately for that path. */
.isi-tray,
.isi-tray__body,
.isi-tray__content {
  position: static !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  transform: none !important;
  page-break-inside: auto;
  break-inside: auto;
}

/* The expand/collapse control is meaningless on paper. */
.isi-tray__toggle,
.isi-tray__icon {
  display: none !important;
}

/* Keep a heading with the text it introduces. */
.info-title,
.info-subtitle {
  page-break-after: avoid;
  break-after: avoid;
}

/* References and prescribing-information links are regulated too. */
.references,
.references-container,
.prescribing-info-link {
  display: block !important;
  overflow: visible !important;
  page-break-inside: auto;
  break-inside: auto;
}

/* --- Chrome that carries no information on paper ------------------ */
.skip-link,
.navbar,
.main-nav,
.nav-container,
.utility-bar,
.utility-nav,
.breadcrumb,
.footer__social,
.back-to-top,
.hcp-modal,
.external-link-popup,
.ui-dialog,
.eu-cookie-compliance-banner,
#sliding-popup,
video,
iframe[src*="youtube"],
iframe[src*="vimeo"],
[role="dialog"] {
  display: none !important;
}

/* --- Links -------------------------------------------------------- */
a {
  text-decoration: underline;
}

/* Print the destination, since a printed link is otherwise a dead end.
   Suppressed for in-page anchors, javascript: handlers and buttons,
   where the href tells the reader nothing. */
a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: 9pt;
  word-break: break-all;
}

a[href^="#"]::after,
a[href^="javascript:"]::after,
.btn::after {
  content: "";
}

/* --- Pagination --------------------------------------------------- */
h1,
h2,
h3,
h4 {
  page-break-after: avoid;
  break-after: avoid;
}

/* --- DONI-919: a hero headline is a display headline, not a heading -
 *
 * `/resources` printed pages 1 AND 2 substantially blank: page 1 held
 * the audience notice, the "Resources" band and the in-page nav and
 * then stopped, and page 2 held the hero headline alone. Content began
 * on page 3.
 *
 * THE CAUSE IS THE RULE DIRECTLY ABOVE. Bisected in real PDFs, one
 * property at a time:
 *
 *   break-inside: auto on everything   -> no change at all
 *   break-before: auto on everything   -> no change at all
 *   break-AFTER: auto on everything    -> 13pp -> 12pp, no blank page
 *   ...narrowed to h2 alone            -> same result
 *
 * `break-after: avoid` is a good rule for an ordinary heading: it stops
 * one being orphaned at the foot of a page, and costs a line or two.
 * It is the wrong rule for a HERO headline, which here is
 * `h2.RESOURCES-THAT-FLIP`, **282px tall**, and the last child of its
 * parent — so the constraint glues it not to a paragraph but to the
 * next section in the flow, `section.resource-office-tools` at 850px.
 *
 *     282 + 850 = 1132px, and a printable page is ~950px.
 *
 * The pair can NEVER fit together, so the engine pushes both off page
 * 1, then gives up and strands the headline alone on page 2. A rule
 * meant to prevent one bad break was creating two blank pages.
 *
 * Scoped by CONTAINER rather than by class: the offending headline
 * carries a page-specific class (`.RESOURCES-THAT-FLIP`), not
 * `.hero__title`, so a class-based exemption would have missed it and
 * would miss the next page's too. Nine templates put a heading in a
 * hero.
 *
 * This is NOT the FND-8/FND-9 hero page-break, whose eight logged
 * attempts are all `break-inside` and artwork experiments — and
 * `break-inside: auto` on everything changes nothing here, which is
 * what rules that out rather than an argument. */
.hero h2 {
  page-break-after: auto;
  break-after: auto;
}

img,
figure,
table,
/* FND-8: `.card` matched nothing on the homepage — the real classes are
   these. The "Results in patients who switched" panel was splitting its
   heading onto one page and its body onto the next because of it. */
.card,
.homepage_card_wrapper,
.homepage_card_block,
.cards-wrapper > *,
.attack-reduction__item,
.stat,
.callout {
  page-break-inside: avoid;
  break-inside: avoid;
  max-width: 100% !important;
}

/* --- FND-8: buttons were collapsing to hairlines ------------------
 *
 * `.btn` is `display: inline-flex` with `overflow: hidden` and
 * `white-space: nowrap` (buttons.css:13-21). Per the flexbox spec, a
 * flex item whose `overflow` is not `visible` gets an automatic minimum
 * size of ZERO — so under print fragmentation these shrank to nothing
 * while their 3px borders still painted. On paper the four CTAs in the
 * confidence band rendered as tiny dashes.
 *
 * These are CONTENT, not chrome — they carry the claim and its
 * destination — so they are repaired rather than hidden. Hiding them
 * would silently make the printed page differ from the screen an MLR
 * reviewer signed off, which is a worse trade than an unclickable box.
 * Genuine UI (nav, back-to-top, tray toggle) is hidden further up. */
.btn,
a.btn,
button.btn {
  display: inline-block !important;
  overflow: visible !important;
  white-space: normal !important;
  min-height: auto !important;
  height: auto !important;
  border-color: #000 !important;
  page-break-inside: avoid;
  break-inside: avoid;
}

/* --- FND-8/FND-9: the hero page-break is NOT FIXED ----------------
 *
 * ✏️ RE-PRINTED AND RE-DIAGNOSED 2026-08-03 (DONI-678). THE DESCRIPTION
 * BELOW WAS STALE, AND THE DEFECT IS MILDER THAN IT SAYS.
 *
 * It is NOT true that "the hero image fills page 1 and the headline
 * lands on a near-empty page 2". Printed from /home at 6pp:
 *
 *   page 1  audience disclaimer + INDICATION BANNER + full artwork
 *           + the first line of the headline, "FLIP THE SWITCH(TM)"
 *   page 2  the rest of the sentence, then normal content
 *
 * So the regulated indication banner prints, page 2 is not near-empty,
 * and no page is substantially blank. The real remaining defect is
 * narrower: THE HEADLINE SENTENCE BREAKS MID-WAY across the boundary.
 *
 * TWO FURTHER ATTEMPTS, both new, both rejected — and both WORSE than
 * shipping nothing, which is why nothing is shipped:
 *
 *   7. break-inside: avoid on .hero__TITLE alone (never tried before;
 *      the earlier six all targeted .hero, the whole composed block).
 *      The sentence does stay intact — but the whole headline moves to
 *      page 2, leaving MORE white space on page 1 than the split did,
 *      and the last line "prophylactic treatment." is CUT THROUGH THE
 *      GLYPHS by the edge of the beige band. Still 6pp.
 *   8. As 7, plus `overflow: visible` on .hero, on the theory that
 *      `.hero { overflow: hidden }` (homepage.css:8) was the clip.
 *      Byte-for-byte the same output as 7. So overflow is NOT the
 *      mechanism — the section AFTER the hero paints over the
 *      overflowing line. A z-index fix is the obvious next thing to
 *      try and was not tried, because a clean mid-sentence break beats
 *      a clipped line either way.
 *
 * The trade is therefore: a mid-sentence break (today) versus an intact
 * sentence with one clipped line and more white space. Today's is
 * better. That is why this stays unfixed.
 *
 * WHY IT RESISTS. `.hero` is a composed layout: `min-height: 500px`, a
 * 54px gap, a full-bleed photograph, two absolutely positioned gradient
 * layers, and `.hero__container` positioned ABSOLUTELY over all of it
 * (homepage.css:1-11, :104). The regulated indication banner is itself
 * absolutely positioned INSIDE the artwork container. In print these
 * paginate independently.
 *
 * WHAT WAS TRIED, and what each did:
 *   break-inside: avoid on .hero  -> hero jumped whole to page 2,
 *                                    leaving page 1 blank. 6pp -> 8pp.
 *   max-height on the artwork     -> blank band where the photo was.
 *   hiding the gradient layers    -> headline still split across pages.
 *   display:contents on the bg    -> banner printed, tint block stayed,
 *                                    photo lost. No better than before.
 *
 * The tint that survives every attempt is not reachable from the
 * selectors tried, and print media cannot be inspected from this
 * tooling — `matchMedia('print')` stays false under emulation — so each
 * attempt costs a full render with no way to see why it failed.
 *
 * THIS NEEDS A DESIGN ANSWER, not more CSS. ⚠️ But the question is
 * SMALLER than DONI-676 framed it, now that the print has been re-read:
 * the artwork already prints, the indication banner already prints, and
 * no page is substantially blank. Nobody needs to decide "should the
 * hero print at all". The open question is only:
 *
 *   MAY THE HEADLINE SENTENCE BREAK ACROSS A PAGE, OR MUST IT STAY
 *   WHOLE AT THE COST OF MORE WHITE SPACE ON PAGE 1?
 *
 * Still MLR-visible on a regulated page, so still not engineering's
 * call to make silently. Tracked on DONI-678, which is the split-out
 * ticket; DONI-676 closed the other three defects.
 */

/* --- DONI-869: efficacy's article was an ATOMIC INLINE ------------
 *
 * `/dawnzera-results/efficacy` printed a page 1 that was 86% blank —
 * the audience notice, the "Efficacy" headline band, the "Attack
 * reduction" in-page nav, and then nothing. All content began on
 * page 2.
 *
 * THIS IS NOT THE HERO PROBLEM ABOVE, and it was worth proving rather
 * than assuming, because page 2 opened with the hero and that is what
 * FND-8/FND-9 spent eight attempts on. No hero rule is involved. The
 * hero prints exactly as it did, one page earlier.
 *
 * THE CAUSE IS ONE DECLARATION, and it is not a print rule.
 * `css/pages/efficacy.css:101` gives this page's whole content article
 *
 *     .element-d-results .element-results-efficacy { display: inline-flex }
 *
 * An inline-level box is an ATOMIC INLINE, and an atomic inline is
 * MONOLITHIC: CSS fragmentation is not allowed to break one across
 * pages. The article is 3632px tall, so it cannot start on page 1 —
 * it would not fit — and is pushed whole to the top of page 2, then
 * spills down the rest of the document. Page 1 was not missing a
 * break; it held a box that refused to begin there.
 *
 * `display: flex` IS THE ENTIRE FIX. It changes the box from
 * inline-level to block-level and nothing else: `flex-direction:
 * column` and `align-items: flex-start` still apply, and the article's
 * children already stretch to full width. `display: block` was tried
 * too and yields byte-identical extracted text, so the flex formatting
 * context is not load-bearing on paper either — `flex` is used because
 * it is the smaller of the two changes.
 *
 * IT IS FIXED HERE, IN PRINT, RATHER THAN AT SOURCE, because the
 * source declaration is what the screen design asks for and no visual
 * regression check in this repo can be run to clear a screen-cascade
 * change (Diffy is manual, from its dashboard).
 *
 * MEASURED — raster ink extent down each page's printable height:
 *   before  0.14  0.94  0.96  0.96  1.00  0.55  0.60   7pp
 *   after   0.92  0.32  0.94  0.91  0.99  0.41  0.60   7pp
 * Same page count, same total ink, nothing dropped: page 1 now carries
 * the hero and both attack-rate claims. The gaps left on pages 2 and 6
 * are the document's ordinary "an unbreakable chart / the footer would
 * not fit here" gaps, present before this change too.
 *
 * ONE SELECTOR, NOT A BLANKET GUARD, because it was checked: of the
 * seven page types, efficacy is the ONLY one carrying an inline-level
 * box taller than a printed page. That is why the same headline-band-
 * plus-tab chrome paginates normally on /assess-hae-impact. */
article.element-results-efficacy {
  display: flex !important;
}

/* --- FND-8: collapsed disclosure would drop regulated copy --------
 *
 * Accordions ship on Getting Started and Switching. A closed panel
 * prints nothing, so any safety or dosing copy inside one would be
 * silently absent from the printout. Force everything open.
 *
 * 🔴 THESE RULES DO NOT WORK. MEASURED 2026-08-06 (DONI-869), by
 * printing /getting-dawnzera/getting-patients-started and searching the
 * extracted text for copy that only exists inside a closed panel.
 *
 * That page carries SIX closed `<details>`. Every one prints its
 * `<summary>` — "Can I prescribe DAWNZERA electronically?" — and NOT
 * its answer. The strings "prescribed through your EHR", "expected to
 * be covered under the pharmacy benefit" and "Ionis Every Step early in
 * the process" are absent from the printed PDF. The failure this block
 * was written to prevent is the failure the page currently has.
 *
 * `details::details-content { content-visibility: visible }` — the
 * modern pseudo-element for exactly this, and supported by the Chrome
 * that renders these PDFs — was tried as a probe and changed NOTHING:
 * the printed page was identical on all eleven pages, ink for ink. So
 * the mechanism is not simply the UA's closed-state hiding, and this
 * needs its own diagnosis rather than another guessed selector.
 *
 * ⚠️ DO NOT READ THE RULES BELOW AS COVERAGE. They are left in place —
 * they cost nothing and one of them may yet be load-bearing for the
 * `[class*="accordion"]` surfaces, which were NOT measured — but on
 * `<details>`, which is what Getting Started actually ships, they are
 * inert. Nothing in this repo prints a warning when a panel's copy is
 * dropped; only a text search of a real PDF finds it.
 *
 * This is NOT what DONI-869 fixed, and it is unchanged by it: the
 * before and after prints of this page are byte-identical. It is
 * recorded here because the header of this file listed it as fixed. */
details {
  display: block !important;
}

details > summary {
  display: block !important;
}

details:not([open]) > *,
.accordion__panel,
.accordion-content,
[class*="accordion"][aria-hidden="true"],
[class*="accordion"] [hidden] {
  display: block !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  visibility: visible !important;
}

/* --- FND-8: the local dev canary must never reach paper -----------
 *
 * templates/twigify/homepage.html.twig carries a hardcoded CANARY
 * banner with NO environment guard, so it renders wherever the theme
 * does — not only locally. Removing it is out of scope (it is still
 * doing its stated job), but it must not appear on a printout that
 * could go to review. Reported on DONI-676. */
.dev-canary {
  display: none !important;
}

/* Repeat table headers across pages. */
thead {
  display: table-header-group;
}

tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

p,
li,
blockquote {
  orphans: 3;
  widows: 3;
}

/* Table borders survive the blanket colour reset above. */
table,
th,
td {
  border-color: #000 !important;
}

/* --- CHR-2: the footer must reach paper, and be legible on it ------
 *
 * Two separate failures, both found by a real print run on 2026-08-02.
 *
 * 1. It was not printing AT ALL. `css/components/layout.css` carried an
 *    inherited `@media print { .footer { display: none !important } }`,
 *    so the whole footer — links, legal line, and the Veeva job code —
 *    was suppressed on paper. The `.footer__code` rule below was written
 *    by FND-8 to protect the job code and could never fire, because its
 *    ancestor was hidden. That rule has been removed at source; this one
 *    asserts the opposite so a future re-port cannot silently undo it.
 *
 * 2. Even printed, it would have been INVISIBLE. The footer is white
 *    text on a charcoal band, and print drops background colours by
 *    default — so it would have rendered white-on-white. The colours are
 *    inverted for paper rather than relying on `print-color-adjust`,
 *    which is a request to the print engine, not a guarantee.
 *
 * This is regulated surface: a printed page carrying promotional claims
 * has to carry its job code and approval date. */
footer.footer {
  display: block !important;
  border-top: 1pt solid #000;
  margin-top: 12pt;
  padding: 8pt 0 0 !important;
  page-break-inside: avoid;
  break-inside: avoid;
}

/* Colour only — deliberately NOT `display`, which would flatten the
   footer's flex layout to UA defaults. */
footer.footer,
footer.footer p,
footer.footer a,
footer.footer span {
  background: transparent !important;
  color: #000 !important;
}

/* Veeva job code and approval date. Regulated, and layout-sensitive —
   DONI-508 kept the code and date on one line — so it must print, and
   must not wrap. */
.footer__code {
  display: block !important;
  white-space: nowrap;
  font-size: 9pt;
}
