/*
| A4 printing (HANDOFF, design `22` and `37`).
|
| ⛔ There was not ONE `@media print` or `@page` in the repository, and three
| pages call `window.print()`: the attendance register, the quote printout and
| the customer's copy of the quote. All three are documents that get signed,
| filed and handed to an inspector — printed with the browser's default 1cm
| margins, a navigation rail down the side, and no page numbers.
|
| ⚠ Imported by both panels rather than written twice: the register is printed
| from the office and the quote from the customer's panel, and a margin that
| differed between them would be visible only on whichever one nobody checked.
*/

@page {
    size: A4;

    /*
    | ⚠ 15mm. Wide enough for a hole punch on the left and for the filing
    | strip most Turkish offices use, narrow enough that a 25 person register
    | still fits its columns.
    */
    margin: 15mm;
}

@media print {
    /*
    | ⛔ Nothing but the document. The rail, the bottom bar, the toast and every
    | button are interface — on paper they are ink nobody asked for, and the
    | toast in particular would print a message about something that happened
    | five seconds ago.
    |
    | ⚠ By ROLE and by data attribute rather than by class name: a class list is
    | a list somebody has to remember to add, and the failure is silent.
    */
    nav,
    aside,
    [role='status'],
    [role='alert'],
    [data-print='hide'] {
        display: none !important;
    }

    body {
        background: var(--color-print-paper);
    }

    /*
    | ⛔ The header row repeats on every page. A register that runs to a second
    | sheet is a column of names beside three unlabelled ticks — and the sheet
    | that gets signed is usually the second one.
    */
    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    /*
    | ⚠ A row is not split across a page break. Half a participant on one sheet
    | and half on the next is a signature line with no name over it.
    */
    tr,
    li {
        break-inside: avoid;
    }

    /*
    | ⚠ Nor is a card, and a heading does not end a page on its own.
    */
    section,
    article {
        break-inside: avoid;
    }

    h1,
    h2,
    h3 {
        break-after: avoid;
    }

    /*
    | ⛔ Ink, not colour. A tinted background prints as grey on a mono printer
    | and swallows the text on it; the borders carry the structure instead.
    */
    * {
        background: transparent !important;
        box-shadow: none !important;
        color: var(--color-print-ink) !important;
    }

    [data-print='keep-border'],
    table,
    th,
    td {
        border-color: var(--color-print-rule) !important;
    }

    /*
    | ⚠ A link's address printed beside it, because a printed link cannot be
    | followed. Skipped for in-page anchors, which point at nothing on paper.
    */
    a[href^='http']::after {
        content: ' (' attr(href) ')';
        font-size: 0.75em;
        word-break: break-all;
    }
}
