/* ---------- Printing (loaded once by the admin shell with media="print") ----------
   The shared print template for every admin page: A4, white paper, black text; none of the on-screen UI (the admin
   shell, menus, bars, banners, the visit header and footer, buttons); links as plain text; an Afiyya letterhead
   (_PrintHeader: a navy band with the logo, white title and subtitle, a thin green rule under it) and footer
   (_PrintFooter: the same navy band with the website footer details in white and the printed date).

   To make any page printable:
   1. Mark the whole on-screen part .no-print, and render what the paper shows as its own block (hidden on screen by
      admin-theme.css's .print-only), so no screen UI ever reaches the printout:
        <div class="print-only print-sheet">
            <partial name="_PrintHeader" model="..." />   (a PrintHeaderViewModel: title, optional subtitle)
            <div class="print-body"> ...the content... </div>
            <partial name="_PrintFooter" />
        </div>
      The sheet is a full A4 page: the bands edge to edge, the content inside 12mm side margins, the footer at the
      bottom of the page (after the content when it runs onto a second page).
   2. The page has no browser margins (@page margin 0), so browsers print no URL, title or date of their own.
   3. Use the helpers: .print-keep (never split across a page), .print-columns (two columns).
   4. Page-specific print layout goes with that page's own styles, in an @media print block. */

/* No browser margins: browsers then print none of their own headers and footers (the URL, title, date, page count);
   the margins are inside our sheet instead */
@page { size: A4; margin: 0; }

html, body, .admin-body, .admin-main { background: #fff !important; color: #000 !important; }
/* The admin shell takes no room on paper: no padding, margins, minimum heights or fixed widths around the sheet (a
   leftover min-height or padding is what spills a blank second page) */
html, body, .admin-body, .admin-shell, .admin-main, .admin-content {
    margin: 0 !important; padding: 0 !important; border: 0 !important; min-height: 0 !important; height: auto !important;
    width: auto !important; max-width: none !important; overflow: visible !important;
}
.admin-shell, .admin-main, .admin-content { display: block !important; }

/* None of the on-screen UI: the admin shell, menus, bars, banners, the visit header, step bar, footer and scroll circle,
   buttons, and anything marked .no-print */
.admin-sidebar, .admin-topbar, .admin-actionbar, .env-banner, .admin-skip-link,
#silktide-wrapper, #silktide-cookie-icon, .pv-head, .pantry-visit-head, .pantry-stepbar, .visit-id-footer, .pv-footer,
.pv-more, .btn, button, .no-print { display: none !important; }

/* Shown only in print */
.print-only { display: block !important; }

/* The sheet: one full A4 page (a hair under 297mm, so rounding never spills a blank page), a column with the footer
   pushed to the bottom; the bands edge to edge, the content inside 12mm side margins */
.print-sheet { display: flex !important; flex-direction: column; min-height: 296mm; margin: 0; padding: 0; }
.print-sheet > .print-footer { margin-top: auto; }
.print-body { flex: 0 0 auto; padding: 0 12mm 8mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Links as plain text */
a, a:visited { color: inherit !important; text-decoration: none !important; }

/* Helpers */
.print-keep { break-inside: avoid; page-break-inside: avoid; }
.print-columns { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4mm; align-items: start; }
.print-columns > * { margin: 0 !important; }

/* The Afiyya bands print in colour */
.print-header, .print-footer { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* The letterhead (_PrintHeader): the navy band, the logo on a white tile, the white title and subtitle; a thin green rule */
.print-header {
    display: flex !important; align-items: center; gap: 5mm; margin: 0 0 6mm; padding: 8mm 12mm 6mm;
    background: #10283A !important; color: #fff !important; border-bottom: 1.5mm solid #8CC63F;
    break-inside: avoid; page-break-inside: avoid;
}
.print-header-logo { flex-shrink: 0; width: 22mm; height: auto; padding: 1.5mm; border-radius: 2mm; background: #fff !important; }
.print-header-text > p { margin: 0; color: #fff !important; }
.print-header-title { font-size: 24pt !important; font-weight: 700; line-height: 1.15; }
.print-header-subtitle { margin-top: 1.5mm !important; font-size: 11.5pt !important; }

/* The footer (_PrintFooter): the same navy band, the website footer details in white, then the printed date */
.print-footer {
    margin-top: 6mm; padding: 5mm 12mm 7mm; background: #10283A !important; border-top: 1.5mm solid #8CC63F;
    break-inside: avoid; page-break-inside: avoid;
}
.print-footer, .print-footer * { color: #fff !important; box-shadow: none !important; opacity: 1 !important; }
.print-footer footer, .print-footer .footer-inner, .print-footer .footer-top, .print-footer .footer-bottom { background: none !important; }
.print-footer footer { margin: 0; padding: 0; text-align: left; font-size: 8.5pt !important; }
.print-footer footer * { font-size: inherit !important; }
.print-footer .footer-top, .print-footer .footer-bottom { padding: 0 !important; border: 0 !important; }
.print-footer .footer-top h6 { margin: 0 0 1mm; font-size: 10pt !important; font-weight: 700; }
.print-footer .footer-bottom { margin-top: 2mm; padding-top: 2mm !important; border-top: 0.5pt solid rgba(255, 255, 255, 0.5) !important; }
.print-footer p { margin: 0 !important; }
.print-footer .footer-social-icon { width: 9pt; height: 9pt; stroke: #fff; }
.print-footer-date { margin-top: 1.5mm !important; font-size: 8pt !important; }
