/* document size (a4=20.99x29.7), orientation (portrait/landscape), margins */

@page {
	size: 20.99cm 29.7cm portrait;
	margin: 20mm 20mm 25mm 20mm;
	padding: 0;
	border-top: thin solid black;
	border-bottom: thin solid black;

/* headers */

	@top {
		font-size: 10pt;
		vertical-align: top;
		margin: 15mm 0 0 0;
	}

/* footers */

	@bottom {
		font-size: 10pt;
		vertical-align: bottom;
		margin: 0 0 15mm 0;
	}
}

/* diferent layout on first page */

@page :first {
	margin: 100mm 20mm 25mm 20mm;
	border-top: none;
	border-bottom: none;
	@top {
		content: normal;
	}
	@bottom {
		content: normal;
	}
}


/* assign values to header/footer strings */

title {
	string-set: title content();
}
h2 {
	string-set: headers content();
	}


/* place headers/footers */

@page {
	@top {
		content: string(title, headers);
	}
	@bottom {
		content: counter(page);
	}
}


/* page breaks */

h1, h2 {
	page-break-after: avoid;
}
h1, h2, p {
	page-break-inside: avoid;
}


/* link formating */

a:link, a:visited {
	color: rgb(0,0,0);
	text-decoration: none;
	border: 0;
}

/* display url after link */

a:link:after, a:visited:after {
	content: " [" attr(href) "]";
}