/*
 * Workbook print pages: the match grid, run sheet, scorecards, reports.
 * Pages that stand alone (and may go to paper or to the PDF service) take
 * the admin's type and the brand's colours, and lose their toolbar in print.
 */

@font-face {
	font-family: "Atkinson Hyperlegible Next";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
}
@font-face {
	font-family: "Bricolage Grotesque";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2");
}

:root {
	--brand-primary: #275d8b;
	--brand-secondary: #e8862a;
}
:root {
	--p-ink: oklch(from var(--brand-primary) 0.25 0.035 h);
	--p-soft: oklch(from var(--brand-primary) 0.43 0.03 h);
	--p-line: oklch(from var(--brand-primary) 0.82 0.02 h);
	--p-shade: oklch(from var(--brand-primary) 0.96 0.012 h);
	--p-accent: oklch(from var(--brand-primary) min(l, 0.46) max(min(c, 0.16), 0.04) h);
	--p-brand: oklch(from var(--brand-primary)
		calc(min(l, 0.52) + clamp(0, (l - 0.6) * 1000, 1) * (max(l, 0.72) - min(l, 0.52)))
		c h);
	--p-on-brand: oklch(from var(--p-brand) clamp(0, (0.6 - l) * 1000, 1) 0 0);
	--p-mark: oklch(from var(--brand-secondary) clamp(0.55, l, 0.8) max(c, 0.1) h);
}

* { box-sizing: border-box; }
html { font-size: 100%; }
body {
	margin: 0;
	background: oklch(from var(--brand-primary) 0.975 0.012 h);
	color: var(--p-ink);
	font: 15px/1.45 "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
	font-variant-numeric: tabular-nums;
}
a { color: var(--p-accent); }
:focus-visible { outline: 3px solid var(--p-accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: "Bricolage Grotesque", "Atkinson Hyperlegible Next", sans-serif; line-height: 1.15; margin: 0 0 0.4em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; margin-top: 1.6rem; }
h3 { font-size: 1.1rem; margin-top: 1.2rem; }

.p-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
	padding: 0.85rem 1.25rem;
	background: var(--p-brand);
	color: var(--p-on-brand);
}
.p-bar a, .p-bar button { color: inherit; }
.p-bar :focus-visible { outline-color: var(--p-on-brand); }
.p-brand { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.1rem; }
.p-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.p-button {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	padding: 0.3rem 1rem;
	border: 2px solid currentColor;
	border-radius: 999px;
	background: transparent;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.p-page { max-width: 80rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.p-sheet { padding: 1.25rem; border: 1px solid var(--p-line); border-radius: 14px; background: #fff; }
.p-sheet + .p-sheet { margin-top: 1.25rem; }
.p-meta { color: var(--p-soft); margin: 0 0 1rem; }
.p-scroll { overflow-x: auto; }

table.p-table { width: 100%; border-collapse: collapse; }
.p-table th, .p-table td { padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--p-line); text-align: left; vertical-align: top; }
.p-table thead th { color: var(--p-soft); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 2px solid var(--p-line); }
.p-table tbody th { font-weight: 700; }
.p-table .p-num { text-align: right; }
.p-table tbody + tbody { border-top: 2px solid var(--p-line); }

/* The match grid: grounds across, kick-off times down. */
.p-grid { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; }
.p-grid th { padding: 0.35rem; background: var(--p-shade); border-radius: 6px; font-size: 0.85rem; }
.p-grid tbody th { width: 4.5rem; text-align: center; }
.p-grid td { vertical-align: top; padding: 0; }
.p-match {
	padding: 0.35rem 0.45rem;
	border: 1px solid var(--p-line);
	border-left: 4px solid var(--p-mark);
	border-radius: 6px;
	background: #fff;
	font-size: 0.82rem;
	line-height: 1.25;
}
.p-match + .p-match { margin-top: 3px; }
.p-match h4 { margin: 0; font-size: 0.82rem; }
.p-match small { color: var(--p-soft); font-weight: 400; }
.p-match p { margin: 0.15rem 0 0; }
.p-match.p-video { border-color: var(--p-accent); box-shadow: inset 0 0 0 1px var(--p-accent); }

/* Scorecards: two to a landscape page. */
.p-cards { display: flex; flex-wrap: wrap; gap: 0.7cm; }
.p-card { width: 13.5cm; height: 8.7cm; border: 2px solid var(--p-ink); border-collapse: collapse; page-break-inside: avoid; break-inside: avoid; background: #fff; }
.p-card th, .p-card td { border: 1px solid var(--p-ink); padding: 3px 5px; font-size: 0.8rem; }
.p-card thead tr:first-child th { border-left: 0; border-right: 0; }
.p-card .p-card-team { border-top-width: 2px; font-weight: 800; text-align: center; font-size: 0.95rem; }
.p-card tbody td { height: 0.75cm; }
.p-card .p-card-score { vertical-align: top; width: 2.5cm; }

@media print {
	body { background: #fff; font-size: 10pt; }
	.p-bar { padding: 0 0 0.4cm; background: none; color: #000; border-bottom: 2pt solid #000; }
	.p-tools { display: none; }
	.p-page { max-width: none; padding: 0.4cm 0 0; }
	.p-sheet { border: 0; padding: 0; border-radius: 0; }
	a { color: inherit; text-decoration: none; }
	.p-grid th { background: #eee; }
	.p-break { break-before: page; }
}
.p-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.p-grid thead th:first-child { width: 5rem; }
.p-sheet > h2:first-child, .p-sheet > h3:first-child { margin-top: 0; }
@media print { .p-screen { display: none; } }
