/**
 * print-letterhead.css — the header every printed report carries.
 * ============================================================
 * print_letterhead('Class List', ['S.Y. 2026-2027', 'Grade 7 - Rizal'])
 * (includes/ui.php): the school's logo, the DepEd line, name, address
 * and contact from Settings, then the report's title between two rules.
 * Hidden on screen; black on white on paper, in either theme.
 * ============================================================
 */
.print-letterhead { display: none; }
.ph-band    { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ph-logo    { flex: 0 0 auto; width: 60px; height: 60px; object-fit: contain; }
.ph-text    { flex: 0 1 auto; min-width: 0; }
.ph-line-sm { font-size: .78rem; color: #333; }
.ph-name    { font-size: 1.15rem; font-weight: 700; color: #000; white-space: nowrap; margin: 2px 0; }
.ph-title   { font-size: 1rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #000;
              border-top: 2px solid #000; border-bottom: 2px solid #000; padding: 4px 0; margin-top: 8px; }
.ph-subject { font-size: .95rem; font-weight: 600; margin-top: 5px; color: #000; }
.ph-meta    { font-size: .8rem; color: #333; margin-top: 4px; }

@media print {
    .print-letterhead { display: block; text-align: center; margin-bottom: 14px; }

    /* A page that prints a letterhead prints the document only: the
       letterhead is its header, so the screen's title block, summary tiles
       and tab strips stay on the screen (a page's own screen-only parts
       carry .no-print). The figures those tiles show are in the tables. */
    body:has(.print-letterhead) :is(.page-header, .stat-card, .nav-tabs, .nav-pills) { display: none !important; }
    body:has(.print-letterhead) :is([class^="col"], [class*=" col"]):has(> .stat-card) { display: none !important; }

    /* ...on A4 portrait. A named page, so only these pages change size:
       receipts and the other print layouts keep their own @page. A page's
       own @page margin still applies. */
    body:has(.print-letterhead) { page: report-a4; }

    /* A table of ten or more columns is wider than A4 at screen size:
       smaller type and tighter cells keep every column on the paper. */
    body:has(.print-letterhead) .table:has(> thead > tr > :nth-child(10)) { font-size: 8pt; }
    body:has(.print-letterhead) .table:has(> thead > tr > :nth-child(10)) > :not(caption) > * > * { padding: 2px 3px; }
}
@page report-a4 { size: A4 portrait; }
