@import "fonts.css";
@import "paging.css";
@import "screen.css" screen;
@import "print.css" print;

:root {
	--font-sans-serif: jost, sans-serif;
	--font-serif: eb garamond, serif;
	--font-serif: crimson pro, eb garamond, serif;
	--font-size-body: 12pt;
	--line-height: 1.3;

	--font-mono: inconsolata, noto sans mono, monospace;
	--font-size-code: 11pt;

	--top-border: 2px solid #888;
}

body {
	font-family: var(--font-serif);
	font-size: var(--font-size-body);
	line-height: var(--line-height);
	hyphens: auto;
}

code {
	font-family: var(--font-mono);
}

header, header p {
	text-align: center;
}

header {
	margin-top: 10em;
	h1 { font-weight: bold; }
	.author {
		font-size: 150%;
	}
}

figure {
	margin: 0 0 2em 0;
	text-align: center;

	figcaption {
		width: 12cm;
		margin: 1em auto 0 auto;
		font-size: 90%;
		font-family: var(--font-sans-serif);
		&::before {
			content: "Obrázek: ";
			font-weight: bold;
		}
	}
}

img {
	max-width: 13cm;
}

ul, ol {
	padding-left: 24px;
}

ul {
	list-style-type: square;
}

h1:not(.title) {
	counter-increment: chapter;
	--space: 6px;
	string-set: chapter-number "Kapitola " counter(chapter), chapter-name content();
	&::before {
		content: "Kapitola " counter(chapter);
		display: block;
		text-align: right;
		border-bottom: var(--top-border);
		padding-bottom: var(--space);
		margin-bottom: var(--space);
	}
}


h1, h2, h3 {
	font-family: var(--font-sans-serif);
	font-weight: normal;
	page-break-after: avoid;  /* nadpis spojeny s naslednym textem */
	& + * { margin-top: 0 !important; /* prebijime mj. pandoc .sourceCode */ }
}

h2 {
	/* default 5/6 em */
	margin-top: 2em;
	margin-bottom: 0;
}

h3 {
	/* default 1 em */
	margin-top: 2em;
	margin-bottom: 0;
}

ol > li::marker {
	font-weight: bold;
}

code {
	font-size: var(--font-size-code);
}

pre {
	background-color: #e6e6e6;
}

p {
	text-align: justify;
}

p code, li > code {
	font-weight: bold;
}

li p {
	margin: 0.5em 0;
}

#TOC {
	font-family: var(--font-sans-serif);

	h2 { margin: 0 0 0.5em 0; }
	ul { list-style: none; }

	> ul {
		padding-left: 0;
		> li {
			counter-increment: toc-chapter;
			> a {
				font-weight: bold;
				&::before {
					content: "Kapitola " counter(toc-chapter) ": ";
				}
			}
		}
	}

	li {
		page-break-inside: avoid;
	}

	a {
		text-decoration: none;
		color: inherit;

		&::after {
			content: " " leader(dotted) " " target-counter(attr(href), page);
		}
	}
}
