/* ==========================================================
   print.css — Clean printouts
   Hides navigation and interface, prints the content in
   black on white with link targets written out.

   Print colors live in tokens.css (the @media print block).
   page.js opens every "Check yourself" answer before printing;
   layout.js does the same for the "Other regions" of regional blocks.

   CUSTOMIZE HERE:
   - Remove the "a[href]::after" rule if you do not want
     link addresses printed after links.
   ========================================================== */

@media print {
  .skip-link,
  .site-header,
  .site-footer,
  .sidebar,
  .toc-column,
  .pager,
  .copy-button,
  .heading-anchor,
  .drawer-backdrop,
  .palette,
  .term-tip,
  .letter-bar,
  .glossary-tools,
  .group-nav,
  .hero__search,
  .hero__hint {
    display: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
  }

  .layout,
  .layout--doc {
    display: block;
    padding: 0;
  }

  .content > * {
    max-width: none;
  }

  .content pre {
    border: var(--line) solid var(--color-line-soft);
    white-space: pre-wrap;
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  .tldr,
  .callout,
  .term {
    break-inside: avoid;
  }

  .content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: var(--color-muted);
  }

  /* Regional blocks: every region on paper, each with its label (from
     components.css). layout.js opens the "Other regions" details before
     printing; its summary is interface, not content. */
  .regional__others > summary {
    display: none !important;
  }

  .regional > [data-region],
  .regional__others > [data-region] {
    break-inside: avoid;
  }

  /* The interactive regex tester makes no sense on paper. */
  [data-regex-tester] {
    display: none !important;
  }

  /* A game cannot run on paper; its code (opened by page.js) is printed. */
  .game,
  .game__code > summary {
    display: none !important;
  }
}
