/* mw-shift-print.css — purpose-built print layout for the shift planner.
 *
 * Renders the plan as plain semantic <table>s cut into page-width chunks that tape
 * left-to-right into one wall chart. Resources are rows on the page's SHORT side and
 * FILL the full page height; the wide time axis paginates across landscape pages. No
 * CSS transforms and nothing ever wider than the page, so neither Chromium print law
 * fires (transform-break in multi-page output; ~2/3 shrink on horizontal overflow).
 * See docs/plans/print-shiftplanner.md ("The proven path").
 *
 * Full-height fill uses --mw-pp-page-content-height, set on .mw-pp-sheet by
 * mw-print.ts's applyLayout (paper height minus margins); the landscape @page rule
 * itself is injected there too, never here (@page is document-global).
 *
 * Class prefix: mw-spp-. Each row carries its group/position colour as one inline
 * custom property --mw-spp-accent (band, rail, default tint); a shift cell may carry
 * its own --mw-spp-tint. The surface's `* { box-shadow: none }` is why rails are
 * borders, not shadows. */

.mw-spp-root {
    color: #18181b;
    font: 12px/1.3 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Each chunk is one landscape page, filled top to bottom. */
.mw-spp-chunk {
    break-before: page;
    height: calc(var(--mw-pp-page-content-height, 186mm) - 1mm);
    overflow: hidden;
}

.mw-spp-chunk:first-child { break-before: avoid; }

.mw-spp-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Position column — present only on the first chunk (leftmost sheet). */
.mw-spp-table col.mw-spp-col-label { width: 46mm; }

.mw-spp-table th,
.mw-spp-table td {
    border: .4px solid #cbcbd1;
    padding: 2px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* repeat the day + time header on every page a tall chunk spills onto */
.mw-spp-table thead { display: table-header-group; }

.mw-spp-table thead th {
    background: #f3f4f6;
    font-size: 10px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.mw-spp-table thead th.mw-spp-corner { text-align: left; }

.mw-spp-table thead th.mw-spp-day { font-weight: 700; border-bottom-width: 1px; }

/* ---- group-header band (spans the whole width; separates teams) ---- */
.mw-spp-group-row { height: 20px; }

.mw-spp-group-label,
.mw-spp-group-band {
    background: color-mix(in srgb, var(--mw-spp-accent, #6366f1) 34%, #ffffff);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.mw-spp-group-label {
    font-weight: 700;
    font-size: 11px;
    border-left: 4px solid var(--mw-spp-accent, #6366f1);
}

/* ---- position rows (no explicit height → they stretch to fill the page) ---- */
.mw-spp-leaf-row td { vertical-align: middle; }

.mw-spp-label {
    font-weight: 600;
    font-size: 11px;
    background: #fafafa;
    border-left: 3px solid var(--mw-spp-accent, #9ca3af);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

/* ---- shift block: light tint from the block's colour (or the row accent) ---- */
.mw-spp-shift {
    text-align: center;
    background: color-mix(in srgb, var(--mw-spp-tint, var(--mw-spp-accent, #6366f1)) 22%, #ffffff);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.mw-spp-shift-name {
    display: block;
    font-weight: 600;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mw-spp-shift-meta {
    display: block;
    font-size: 9px;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mw-spp-cont { color: #6b7280; font-weight: 400; }
