/* Printable view of a single gazette entry. The sheet takes the size of the allocated
   format, set by the page itself through an @page rule, and the block is already sized in
   millimetres: screen and paper share the same geometry. */

@page {
    margin: 0;
}

.gazette-print-toolbar {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    flex-wrap: wrap;
    padding: 1.6rem 2.4rem;
    background: #fff;
    border-bottom: 1px solid #dbe0e5;
}

.gazette-print-hint {
    font-size: 1.3rem;
    color: #666;
    margin-right: auto;
}

.gazette-print-warning {
    padding: 1.2rem 2.4rem;
    background: #fff4e0;
    border-bottom: 1px solid #f0d5a8;
    color: #6b4b12;
    font-size: 1.3rem;
    line-height: 1.45;
}

.gazette-print-warning strong {
    display: block;
    margin-bottom: .4rem;
}

.gazette-print-warning p {
    margin: .6rem 0 0;
}

.gazette-print-sheets {
    display: flex;
    justify-content: center;
    padding: 8mm 0;
    background: #f4f6fa;
}

.gazette-print-page {
    background: #fff;
    overflow: hidden;
    box-shadow: 0 0 6px rgba(0, 0, 0, .15);
}

.gazette-print-page-fit {
    width: auto;
    height: auto;
}

.gazette-print-blocks {
    display: flex;
}

.gazette-print-page,
.gazette-print-page * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

@media print {
    /* The portal reset gives the body a 320px minimum. A gazette sheet is narrower than that
       — a quarter page is 228px — so the body cannot fit and the printer shrinks the whole
       page to make it, at 228/320 of its size. The entry then floats inside its own frame. */
    html, body {
        background: #fff;
        min-width: 0;
    }

    .d-print-none {
        display: none !important;
    }

    /* The UserWay accessibility widget is injected on every page and sits fixed in a corner,
       which browsers print on the first sheet. It is not ours to mark up, so it is matched on
       its own name. */
    .uwy,
    [id*="userway" i],
    [class*="userway" i] {
        display: none !important;
    }

    .gazette-print-sheets {
        display: block;
        padding: 0;
        background: #fff;
    }

    /* The sheet takes its size from the page box instead of restating the same millimetres.
       Chrome does not round the two the same way — on a quarter page the page box comes out
       half a pixel narrower than 60.5mm — and the sheet then overflows by that fraction,
       which the printer shaves off the right edge.

       Whichever way it rounds, the sheet is painted on whole pixels and the last fraction of a
       millimetre of the page is left to the ground underneath: the single entry views paint
       that ground in the colour of the frame, so it does not read as a white edge.

       Three classes deep on purpose: the size the slot gets from its component stylesheet is
       written .gazette-slot[b-xxxxx], which scores the same as a two-class selector and is
       linked after this file — a shorter selector here would lose the tie and never apply. */
    .gazette-print-page {
        box-shadow: none;
        width: 100vw;
        height: 100vh;
    }

    .gazette-print-page-fit .gazette-print-blocks .gazette-slot {
        width: 100vw;
        height: 100vh;
    }
}
