@font-face {
	font-family: "IW";
	src: url("../fonts/iw-italic.woff2") format("woff2"),
		url("../fonts/iw-italic.woff") format("woff");
	font-weight: normal;
	font-style: italic;
}

@font-face {
	font-family: "IW";
	src: url("../fonts/iw-roman.woff2") format("woff2"),
		url("../fonts/iw-roman.woff") format("woff");
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: "IW";
	src: url("../fonts/iw-bold.woff2") format("woff2"),
		url("../fonts/iw-bold.woff") format("woff");
	font-weight: bold;
	font-style: normal;
}

@font-face {
	font-family: "IW";
	src: url("../fonts/iw-bolditalic.woff2") format("woff2"),
		url("../fonts/iw-bolditalic.woff") format("woff");
	font-weight: bold;
	font-style: italic;
}

header {
	height: 50px;
	position: fixed;
	top: 0;
	transition: background-color 0.5s ease;
	width: 100%;
	padding-left: 10px;
	background: rgba(17,17,17,0.9);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	z-index: 10;
}

header.day {
	background: rgba(240,240,240,0.9);
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
header.day a, header.day #navleft a { color: #333; }

header.sepia {
	background: rgba(232,223,197,0.9);
	box-shadow: 0 1px 3px rgba(61,54,41,0.12);
}
header.sepia a, header.sepia #navleft a { color: #5C4B3A; }

header.night {
	background: rgba(17,17,17,0.9);
}

/* header always visible */

.topbooknav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 25px;
	max-width: 820px;
	margin: 0 auto;
	padding: 0 7%;
	height: 50px;
}

.topbooknav a {
	color: white;
	margin-right: 10px;
	text-decoration: none;
	text-align: center;
}

#navright {
	display: flex;
	align-items: center;
	gap: 0;
}

#navright a, #navright img {
	display: flex;
	align-items: center;
	height: 50px;
	padding: 0 6px;
}

#navleft {
	display: flex;
	align-items: center;
	gap: 0;
}

#navleft a {
	display: flex;
	align-items: center;
	height: 50px;
	padding: 0 6px;
}

.nav-down a {
	padding-top: 0;
	padding-bottom: 0;
}

a {
	text-decoration: underline;
	color: #888888;
}

#toc {
	font-size: 23px;
}

#toc:not(.mm-menu) {
	display: none;
}

.mm-navbar {
	background-color: silver;
}

.mm-title {
	color: white !important;
}

.mm-listview {
	font-size: 20px !important;
}

html {
	height: 100%;
}

html.day {
	background-color: white;
}

html.night {
	background-color: black;
}

html.sepia {
	background-color: #F0E4C8;
}

body {
	margin: 0;
	font-family: 'IW', serif;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	-webkit-transition: all 0.5s ease;
	-moz-transition: all 0.5s ease;
	-o-transition: all 0.5s ease;
	transition: all 0.5s ease;
}

body.day {
	background-color: white;
	background: url(/static/images/patterns/lightpaperfibers.png) repeat;
}

body.night {
	background-color: black;
	background: url(/static/images/patterns/black_paper.png) repeat;
}

body.sepia {
	background-color: #F0E4C8;
}

#menu {
	flex: 1;
}

main {
	font-size: 21px;
	line-height: 1.5em;
	text-align: justify;
	padding-top: 60px;
	padding-bottom: 60px;
	padding-left: 7%;
	padding-right: 7%;
	margin: 0px auto;
	overflow-wrap: break-word;
	word-wrap: break-word;
	-webkit-hyphens: auto;
	-moz-hyphens: auto;
	-ms-hyphens: auto;
	hyphens: auto;
	-webkit-transition: all 0.5s ease;
	-moz-transition: all 0.5s ease;
	-o-transition: all 0.5s ease;
	transition: all 0.5s ease;
}

main.day {
	color: black;
}

main.night {
	color: #ddd;
}

main.sepia {
	color: #3D3629;
}

main.sepia em {
	color: #7D7567;
}

main.sepia a {
	color: #5C4B3A;
}

.poetry.sepia {
	border-color: #D9D2C3;
}

main {
	margin-left: auto;
	margin-right: auto;
	max-width: 820px;
}

main p {
	text-indent: 20px;
}

h1, h2, h3, h4, h5, h6 {
	text-indent: 0;
	text-align: left;
	word-spacing: normal;
}

main p {
	letter-spacing: 0.2px;
}

main ol p, main ul p {
	text-indent: 0;
}

main.night em {
	color: #c1bc80;
}

main.day em {
	color: #9f090e;
}

.poetry {
	white-space: pre-wrap;
	text-indent: 0;
	font-style: italic;
	padding-left: 2.5em;
}

.break {
	display: inline-block;
	width: 100%;
	text-align: center;
}

code, pre {
	font-family: 'IW';
	font-style: italic;
}

.mergedcolumns_first {
float:left;
}

.mergedcolumns_second {
float:right;

}

footer {
	background: rgba(17,17,17,0.9);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	padding-bottom: 10px;
	transition: background-color 0.5s ease;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 10;
}

footer.day {
	background: rgba(240,240,240,0.9);
	box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
}
footer.day a { color: #333; }

footer.sepia {
	background: rgba(232,223,197,0.9);
	box-shadow: 0 -1px 3px rgba(61,54,41,0.12);
}
footer.sepia a { color: #5C4B3A; }

footer.night {
	background: rgba(17,17,17,0.9);
}

.bottom {
	display: flex;
	justify-content: space-around;
	max-width: 820px;
	margin: 0 auto;
	padding: 0 7%;
}

.tooltipster-box {
	font-family: Helvetica, sans-serif;
}

.tooltipster-box ol, .tooltipster-box ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.tooltipster-box li {
	display: inline;
	padding: 0;
	margin: 0;
}

.tooltipster-base {
	max-width: min(820px, 90vw) !important;
}

.footnotelink {
	color: #999999;
}

#themetoggle, #translation, #menuicon, #closeicon {
	width: 24px;
	height: 24px;
	cursor: pointer;
}

/* Theme-appropriate icon colors via filter */
.day #themetoggle, .day #translation, .day #menuicon, .day #closeicon { filter: invert(1) brightness(0.3); }
.sepia #themetoggle, .sepia #translation, .sepia #menuicon, .sepia #closeicon { filter: invert(1) brightness(0.4) sepia(1); }
.night #themetoggle, .night #translation, .night #menuicon, .night #closeicon { filter: none; }

.mm-menu.mm-offcanvas {
	z-index: 20;
	display: none;
	position: fixed;
	width: 80%;
	min-width: 140px;
	max-width: 440px
}

@media print {
	nav, header, footer {
		display: none;
	}
	
	main {
		font-size: 18px;
		padding-left: 8%;
		padding-right: 8%;
	}
	
}

@media only screen and (min-width: 1080px) {
	main {
		font-size: 27px;
	}
}

@media (max-width: 600px) {
	main {
		font-size: 19px;
		padding-left: 4%;
		padding-right: 4%;
		padding-top: 55px;
		padding-bottom: 55px;
	}

	.topbooknav {
		font-size: 18px;
		padding: 0 4%;
	}

	#themetoggle, #translation, #menuicon, #closeicon {
		width: 20px;
		height: 20px;
	}

	.tooltipster-base {
		max-width: 95vw !important;
	}

	h1 {
		font-size: 1.4em;
	}

	h2 {
		font-size: 1.2em;
	}

	.poetry {
		padding-left: 1em;
		font-size: 0.95em;
	}

	header {
		height: 44px;
	}

	.topbooknav {
		height: 44px;
	}

	footer .bottom {
		padding: 0 4%;
		font-size: 1.4em;
	}

	.mm-menu.mm-offcanvas {
		width: 85%;
		max-width: 320px;
	}
}