/* The printed tag sheet (Components/Pages/Sheet.razor). Everything that ends up on paper
   is sized in inches. A sheet is 20 tags, 4 across and 5 down, a block 6in by 10in centred
   on US Letter: 1.25in from the left and right edges, 0.5in from the top and bottom. The
   page margin is 0.25in and the block sits 0.25in into the page box, leaving 0.25in of
   slack below it, so a sheet never spills onto a second page.

   A tag is 1.5in by 2in. Its QR code is 1in square at left 0.25in and top 0.6in, so its
   bottom is at 1.6in; the quiet zone of four modules needs 0.138in, to about 1.74in. The
   punch mark is 0.25in across, centred 0.3in from the top; its lower edge is at 0.425in,
   0.175in above the code. The site's glass (Components/Glass.razor) is in the top-left
   corner, a box 0.27in wide and 0.36in tall at left 0.12in and top 0.1in; the glass drawn
   inside it runs from about x 0.17in to 0.35in and y 0.14in to 0.43in: clear of the punch
   mark (from x 0.625in), above the code's quiet zone (from 0.462in) and more than 0.1in
   from the cut edges. On paper it has no background: black lines, red wine. The brand
   line, "wineblinds.com" in 8pt, is centred across the tag and centred 1.84in from its
   top: clear of the quiet zone and above the bottom cut. The glass and the brand line are
   the same on every tag; nothing on paper tells one tag from another. */

@page {
    size: letter;
    margin: 0.25in;
}

body {
    margin: 0;
    background: #e9e6e1;
    color: #222;
    font-family: system-ui, sans-serif;
}

.sheet-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    max-width: 8.5in;
    margin: 1rem auto;
    padding: 0 1rem;
}

.sheet-toolbar form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sheet-toolbar input {
    width: 4rem;
}

.sheet-toolbar p {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.9rem;
}

.sheet {
    box-sizing: border-box;
    width: 8.5in;
    min-height: 11in;
    margin: 1rem auto;
    padding: 0.5in 0;
    background: #fff;
    box-shadow: 0 1px 6px rgb(0 0 0 / 0.25);
}

.tags {
    display: grid;
    grid-template-columns: repeat(4, 1.5in);
    grid-auto-rows: 2in;
    justify-content: center;
}

/* The outline is the cut line; neighbours share it, so a trimmer takes four cuts each way. */
.tag {
    position: relative;
    outline: 0.5pt solid #999;
}

.tag > svg:not(.glass) {
    position: absolute;
    top: 0.6in;
    left: 0.25in;
    width: 1in;
    height: 1in;
}

.brand {
    position: absolute;
    top: 1.84in;
    left: 0;
    right: 0;
    margin: 0;
    transform: translateY(-50%);
    font-size: 8pt;
    line-height: 1;
    text-align: center;
    color: #222;
}

.tag .logo {
    position: absolute;
    top: 0.1in;
    left: 0.12in;
    width: 0.27in;
    height: 0.36in;
}

/* The sheet does not load app.css, so the glass is drawn here, for paper. */
.tag .glass-line {
    fill: none;
    stroke: #000;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tag .glass-wine {
    fill: #c23a5c;
}

.punch {
    position: absolute;
    top: 0.175in;
    left: 0.625in;
    box-sizing: border-box;
    width: 0.25in;
    height: 0.25in;
    border: 0.5pt solid #999;
    border-radius: 50%;
}

@media print {
    body {
        background: none;
    }

    .sheet-toolbar {
        display: none;
    }

    .sheet {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0.25in 0 0;
        box-shadow: none;
        break-after: page;
    }

    .sheet:last-of-type {
        break-after: auto;
    }
}
