/*
 * The shell's print gate (infra, 2026-09-09).
 *
 * A screen that puts ink on paper opts in from its own template:
 *
 *     {% block bodyclass %}{{ block.super }} wl-print-plain{% endblock %}
 *
 * and everything the shared shell drew around the page drops out BY NAME. The
 * shell marks its own chrome with `wl-noprint`: the header band
 * (templates/unfold/helpers/header.html), the module tab strip
 * (templates/admin/_module_tabs.html) and the messages tray
 * (templates/admin/base_site.html). A module that grows a print screen writes
 * one bodyclass line and never has to know the shell's markup.
 *
 * Why this file exists. ADR 0007 turned the header into one shared template,
 * so a module could no longer put a class on it from its own commit. Bảo trì's
 * Reports (Slice 85) was left describing the header and the tab strip by DOM
 * SHAPE — `#main > *:not(:has(#content)):not(#content)` — which had already
 * failed once (both bars printed above the Woodsland letterhead, ~130px of
 * paper, found on a real PDF) and, per its own seatbelt comment, would print a
 * BLANK sheet the day the shell made `#content` a direct child of `#main`. A
 * rule like that is a trap for whoever next edits the shell, written in a file
 * they have no reason to open.
 *
 * Plain CSS on purpose: Unfold ships a PRECOMPILED Tailwind sheet holding only
 * the utilities it uses itself, and it has no print variants at all.
 *
 * Anything a print page wants dropped that is its OWN (a filter bar, a tab
 * strip of reports, a banner) stays that page's business — Bảo trì keeps
 * `.mnt-noprint` for exactly that.
 */

@media print {
  /* The sidebar and any fixed wrapper of it: whatever `#page` holds besides
     `#main`. Kept as a shape rule on purpose — `#page` has exactly two
     children by Unfold's own skeleton (sidebar, main), the sidebar template is
     not one we shadow, and dropping the wrong one here is visible on the first
     sheet rather than silent. */
  body.wl-print-plain #page > *:not(#main) { display: none !important; }

  /* The shell chrome, by name. */
  body.wl-print-plain .wl-noprint { display: none !important; }

  /* Let the two flex columns collapse so the page starts at the top of the
     sheet instead of inheriting a screen-height frame. */
  body.wl-print-plain #page,
  body.wl-print-plain #main { display: block !important; min-height: 0 !important; }
  body.wl-print-plain #content { max-width: none !important; padding: 0 !important; }
}
