/*
 * Dealroot report of a period, to save as a PDF.
 *
 * Geologica by the Geologica Project Authors, SIL Open Font License 1.1 (see ../fonts/OFL.txt).
 */

@font-face {
	font-family: "Dealroot Geologica";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(../fonts/geologica-latin.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Dealroot Geologica";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(../fonts/geologica-latin-ext.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Dealroot Geologica";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(../fonts/geologica-cyrillic.woff2) format("woff2");
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
	font-family: "Dealroot Geologica";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(../fonts/geologica-cyrillic-ext.woff2) format("woff2");
	unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}


/* The report of a period, made to be saved as a PDF on A4. */
:root {
	--forest: #0e4a37;
	--ink: #1c2b25;
	--sage: #56695f;
	--line: #d7dfd9;
	--soft: #e7ece8;
	--wash: #f4f6f2;
	--marker: #ffd23f;
}

* {
	box-sizing: border-box;
}

html {
	background: var(--wash);
}

body {
	margin: 0;
	background: var(--wash);
	color: var(--ink);
	font-family: "Dealroot Geologica", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	line-height: 1.45;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}

.report-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	align-items: center;
	padding: 12px 24px;
	border-bottom: 1px solid var(--line);
	background: #fff;
	font-size: 13px;
}

.report-tools a {
	color: var(--forest);
}

.report-tools__back {
	margin-inline-end: auto;
}

.report-tools__periods {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.report-tools__periods a {
	padding: 4px 10px;
	border: 1px solid var(--line);
	border-radius: 999px;
	text-decoration: none;
}

.report-tools__periods a[aria-current] {
	border-color: var(--forest);
	background: var(--forest);
	color: #fff;
}

.report-tools label {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.report-tools input,
.report-tools button {
	font: inherit;
}

.report-tools input {
	padding: 4px 6px;
	border: 1px solid var(--line);
	border-radius: 6px;
}

.report-tools button {
	padding: 6px 14px;
	border: 1px solid var(--forest);
	border-radius: 8px;
	background: #fff;
	color: var(--forest);
	cursor: pointer;
}

.report-tools .report-tools__save {
	background: var(--forest);
	color: #fff;
	font-weight: 600;
}

.report-tools :focus-visible {
	outline: 2px solid var(--forest);
	outline-offset: 2px;
}

.report {
	max-width: 210mm;
	margin: 24px auto;
	padding: 16mm 15mm;
	background: #fff;
	box-shadow: 0 1px 3px rgba(28, 43, 37, 0.12);
}

.report__head {
	margin-bottom: 22px;
	padding-bottom: 14px;
	border-bottom: 3px solid var(--forest);
}

.report__site {
	margin: 0;
	color: var(--sage);
	font-weight: 600;
}

.report h1 {
	margin: 2px 0 4px;
	font-size: 26px;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.report__period {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

.report__made {
	margin: 6px 0 0;
	color: var(--sage);
	font-size: 11px;
}

.report__empty {
	font-size: 15px;
}

.report__tiles {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
}

.report__tiles div {
	padding: 10px 12px;
	border-radius: 8px;
	background: var(--wash);
}

.report__tiles dt {
	color: var(--sage);
	font-size: 11px;
}

.report__tiles dd {
	margin: 2px 0 0;
	font-size: 18px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.report__tiles .report__hint {
	margin-top: 3px;
	color: var(--sage);
	font-size: 10.5px;
	font-weight: 400;
	line-height: 1.35;
}

.report .report__table .report__group th {
	padding-top: 12px;
	color: var(--sage);
	font-size: 11px;
	font-weight: 600;
	text-align: start;
}

.report__section {
	margin-top: 22px;
	break-inside: avoid;
}

.report h2 {
	margin: 0 0 8px;
	font-size: 15px;
}

.report__note {
	margin: 6px 0 0;
	color: var(--sage);
	font-size: 11px;
}

.report__table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.report__table th,
.report__table td {
	padding: 5px 6px;
	border-bottom: 1px solid var(--soft);
	text-align: right;
	vertical-align: top;
	white-space: nowrap;
}

.report__table th[scope="row"],
.report__table thead th:first-child {
	width: 40%;
	text-align: left;
	white-space: normal;
}

.report__table thead th {
	border-bottom-color: var(--line);
	color: var(--sage);
	font-size: 11px;
	font-weight: 500;
}

.report__table--small th[scope="row"] {
	width: 50%;
}

.report__name {
	display: block;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.report__share {
	display: block;
	height: 3px;
	margin-top: 3px;
	border-radius: 2px;
	background: var(--forest);
	opacity: 0.55;
}

.report__pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}

.report__counts {
	display: grid;
	gap: 5px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.report__counts li {
	display: grid;
	grid-template-columns: minmax(0, 38%) 1fr auto;
	gap: 10px;
	align-items: center;
}

.report__count-bar {
	height: 8px;
	border-radius: 4px;
	background: var(--soft);
}

.report__count-bar span {
	display: block;
	height: 100%;
	border-radius: 4px;
	background: var(--forest);
}

.report__count {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

@media (max-width: 700px) {
	.report {
		margin: 0;
		padding: 18px 16px;
	}

	.report__tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.report__pair {
		grid-template-columns: 1fr;
	}

	.report__table th,
	.report__table td {
		white-space: normal;
	}
}

/* Charts, drawn as on the reports screen */
.report__section--chart .dealroot-chart__key {
	margin: -4px 0 12px;
}

.report__pair .dealroot-chart--ring {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}

.report__pair .dealroot-chart--ring svg {
	width: 150px;
	margin: 0 auto;
}

.report__pair .dealroot-chart__legend {
	flex-basis: auto;
}

.report__pair .dealroot-chart__legend li {
	padding: 4px 0;
	font-size: 11.5px;
}

.report .dealroot-outcomes__row {
	grid-template-columns: minmax(130px, 24%) minmax(0, 1fr) 6.5em 7.5em;
	padding: 5px 0;
	font-size: 12px;
}

@page {
	size: A4;
	margin: 14mm 12mm;
}

@media print {
	html,
	body {
		background: #fff;
	}

	.report-tools {
		display: none;
	}

	.report {
		max-width: none;
		margin: 0;
		padding: 0;
		box-shadow: none;
	}

	.report__table tr,
	.report__section--chart,
	.dealroot-outcomes__row {
		break-inside: avoid;
	}
}
