/*
 * print.css — shared print stylesheet for every Arabic Companion tool.
 * Loaded with media="print". Hides all site and tool chrome, leaves the
 * .ac-sheet elements alone on the page.
 *
 * Version log
 * 1.0.0  2026-08-05  Initial.
 */

@page { size: A4 portrait; margin: 12mm; }

body.ac-printing-landscape { }
@page ac-landscape { size: A4 landscape; margin: 0; }

@media print {
  /* Kill the whole site around the sheets. */
  body.ac-printing > *:not(.ac-print-root) { display: none !important; }
  body.ac-printing #page,
  body.ac-printing #wrapper,
  body.ac-printing header,
  body.ac-printing footer,
  body.ac-printing .site-header,
  body.ac-printing .site-footer,
  body.ac-printing #kad-banner,
  body.ac-printing #topbar,
  body.ac-printing .kad-header,
  body.ac-printing .cli-bar-container,
  body.ac-printing #cookie-law-info-bar { display: none !important; }

  body.ac-printing {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .ac-print-root {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .ac-print-root .ac-sheet,
  .ac-sheet {
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    page-break-after: always;
    break-after: page;
    background: #fff !important;
  }
  .ac-print-root .ac-sheet:last-child { page-break-after: auto; break-after: auto; }

  /* Certificates carry a background image; browsers strip those unless told. */
  .ac-sheet,
  .ac-sheet * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ac-answer-key { page-break-before: always; break-before: page; }

  .ac-no-print { display: none !important; }

  /* Nothing inside a sheet may be split awkwardly. */
  .ac-ex, .ac-card-cut, .ac-ws-row, .ac-domino, .ac-loopcard {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  a[href]::after { content: none !important; }
}
