a img,
label {
	-moz-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

html {
	background-color: white;
}

body::before {
	display: block;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 51px;
	background-color: #f50;
	content: "";
	z-Index: 1;
}

body {
	font-family: sans-serif;
	font-size: 15px;
	color: #555;
	margin: 0 auto;
	padding: 51px 8px 8px 8px;
	max-width: 21cm;
	min-height: calc(100vh - 59px);
	position: relative;
}

body.widescreen {
	max-width: initial;
	padding: 44px 0 0 0;
}

table {
	font-size: inherit;
}

th {
	text-align: left;
	font-weight: normal;
	color: black;
	border-bottom: 1px solid #ddd;
	padding-top: 6px;
}

h1 {
	color: white;
	position: fixed;
	top: 0;
	left: 35px;
	right: 35px;
	margin: 0 auto 8px auto;
	padding: 8px;
	height: 35px;
	line-height: 35px;
	white-space: nowrap;
	max-width: 21cm;
	z-index: 1;
}

h2[data-date] {
	position: relative;
}

h2[data-date]::after {
	position: absolute;
	right: 0;
	color: #ccc;
	font-weight: normal;
	content: attr(data-date);
}

h2, h3, h4 {
	margin: 8px 0;
	font-size: inherit;
	color: black;
}

p, ul.p > li, ol.p > li {
	margin: 8px 0 1em 0;
}

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

a:hover {
	text-decoration: underline;
}

figure {
	text-align: center;
}

figcaption {
	font-size: .9em;
}

ol, ul {
	padding-left: 1em;
}

li > ol, li > ul {
	padding-left: 1cm;
	margin-bottom: 1em;
}

li li > ol, li li > ul {
	margin-bottom: initial;
}

a, span[data-explain] {
	font-style: oblique;
}

span[data-explain]:not([data-explain='']):hover::before {
	content: attr(data-explain);
}

span[data-explain][data-explain=''] > div:first-child {
	display: none;
}

span[data-explain][data-explain='']:hover > div:first-child {
	display: block;
}

span[data-explain]:not([data-explain='']):hover::before,
span[data-explain][data-explain='']:hover > div:first-child {
	position: absolute;
	left: 10%;
	right: 10%;
	max-width: 15cm;
	margin: 1.6em auto 0 auto;
	border-radius: 5px;
	box-shadow: 0 0 5px;
	padding: 4px 8px;
	background-color: white;
	color: #555;
	font-style: normal;
}

*[data-caption] {
	position: relative;
}

*[data-caption]:hover::before {
	content: attr(data-caption);
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: white;
	color: #555;
	font-style: normal;

}

a.download, .downloads > a, .button {
	display: inline-block;
	border: 2px solid #555;
	border-radius: 5px;
	padding: 1px 4px;
	font-size: larger;
	text-decoration: none;
	font-style: normal;
	background-color: white;
}

a.download:hover, .downloads > a:hover {
	background-color: #ddd;
}

a.download::before, .downloads > a::before {
	content: "";
	display: inline-block;
	width: 0.7em;
	height: 0.7em;
	margin-right: 4px;
	background-image: url(download.svg);
	background-size: contain;
}

div.cover {
	width: 185px;
	float: right;
}

div.cover > img {
	display: block;
	width: 100%;
}

div.cover > audio {
	position: static;
	width: 100%;
}

.recipe {
	white-space: pre-line;
}

/******************** Menu ********************/

nav {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 2;
}

nav + label {
	position: fixed;
	top: 0;
	left: 0;
	width: 1em;
	height: 35px;
	line-height: 35px;
	color: white;
	font-size: 2em;
	padding: 8px;
	z-index: 1;
}

nav input, nav + label input {
	display: none;
}

nav > input + label {
	position: fixed;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	background-color: black;
	opacity: 0.5;
	transition: opacity .1s;
}

#menu-close:checked + label {
	visibility: hidden;
	top: 10000px; /* Vivaldi black thumbnail workaround */
	opacity: 0;
	transition: opacity .1s, visibility 0s .1s, top 0s .1s;
}

#menu-close:checked + label + div {
	left: -300px;
	visibility: hidden;
	transition: left .1s, visibility 0s .1s;
}

nav > div {
	position: absolute;
	left: 0;
	height: calc(100vh - 20px);
	width: 220px;
	background-color: white;
	color: black;
	padding: 10px;
	font-weight: bold;
	transition: left .1s;
}

nav > div > div {
	font-weight: normal;
}

nav > div > div:first-child {
	color: #555;
	position: static;
	height: 17px;
	margin: -10px;
	margin-bottom: 0;
	border-bottom: 1px solid #ddd;
	font-size: 1em;
	font-weight: bold;
	padding: 17px 10px;
}

nav > div a,
nav > div a:hover,
nav > div label {
	display: block;
	font-size: 16px;
	font-style: normal;
	padding: 10px 0;
	text-decoration: none;
	cursor: default;
}

nav > div label::after {
	content: "\25be";
	position: absolute;
	right: 10px;
}

nav > div input {
	display: none;
}

nav > div input + div {
	display: none;
	padding-left: 20px;
}

nav > div input:checked + div {
	display: block;
}

@media only screen and (min-width: 30cm) {
	body.widescreen {
		margin: 0 0 0 242px;
	}

	#menu-close + label + div {
		visibility: visible !important;
		left: 0 !important;
		border-right: 1px solid #ddd;
		top: 51px;
		transition: left .1s !important;
	}

	nav > div > div:first-child {
		display: none;
	}

	nav > div > div:first-child + * {
		margin-top: -10px;
	}

	nav + label {
		display: none;
	}
	
	#menu-close + label {
		display: none;
	}

	h1 {
		left: 0;
		right: 0;
	}
}

@media only screen and (min-width: 30cm) and (max-width: 38cm) {
	body, h1 {
		margin: 0 0 0 8cm;
	}
}

/************ Images / gallery **************/

body {
	--aspect: 0.75;
}

body > div.gallery > div {
	display: none;
}

body > div.gallery > div:target {
	display: block;
	position: fixed;
	left: 5%;
	right: 5%;
	top: 3em;
	max-width: calc((100vh - 6em) / var(--aspect));
	margin: 0 auto;
	background-color: white;
	z-index: 3;
}

body > div.gallery > div:not(:target) > * {
	background-image: none !important;
}

body > div.gallery > div:target > * {
	background-image: var(--image); /* No longer used, leave for compatibility with cached HTML */
}

body > div.gallery > div > div {
	width: 100%;
	position: relative;
	padding-top: calc(100% * var(--aspect));
	background-repeat: no-repeat;
	background-position: center top;
	background-size: contain;
}

body > div.gallery > div:target ~ a:last-child {
	display: block;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: black;
	opacity: 0.5;
	z-index: 2;
}

hr {
	border: none;
	border-top: 1px solid #ddd;
}

video {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
}

a[href$=".webm"] {
	position: relative;
}

a[href$=".webm"]::after {
	content: "";
	position: absolute;
	bottom: calc((185px * var(--aspect) - 56px) / 2);
	left: 0;
	right: 0;
	margin: 0 auto;
	width: 56px;
	height: 56px;
	background-image: url(play.png);
	opacity: 0.7;
}

@media only screen and (max-device-width: 20cm) {
	body.grid {
		text-align: center;
	}

	body.grid > * {
		text-align: initial;
	}
}

body.grid {
	margin-top: 5px;
}

.grid > a {
	display: inline-block;
	margin: 3px;
	width: 185px;
}

.grid a[data-more] {
	position: relative;
}

.grid a[data-more] > img {
      opacity: 0.3;
}

.grid a[data-more]::after {
	content: attr(data-more);
	position: absolute;
	top: calc(50% - 0.5em);
	left: 3px;
	right: 3px;
	text-align: center;
	color: white;
	text-shadow: 1px 1px #555;
	font-size: 400%;
}

/****************** Phone *******************/

@media only screen and (max-width: 10cm), only screen and (max-device-width: 10cm) {
	div.cover {
		float: none;
	}
	
	div.cover > img {
		display: none;
	}
	
	div.cover > audio {
		position: fixed;
		left: 0;
		bottom: 0;
	}
}

/**************** Dark mode *****************/

/*@media (prefers-color-scheme: dark) {
	html {
		background-color: #333 !important;
	}

	body::before {
		background-color: #a5b !important;
	}

	body {
		color: #aaa !important;
	}

	h2, h3, h4 {
		color: #eee !important;
	}

	h2[data-date]::after {
		color: #777 !important;
	}
}*/

/****************** Print *******************/

@media only print {
	* {
		background-color: transparent;
		color: black;
	}

	p, h1 {
		color: black;
	}

	a, *[data-explain] {
		font-style: normal;
	}

	body::before {
		display: none;
	}

	body {
		font-family: "Times New Roman", serif;
		font-size: 10pt;
		padding: initial;
	}

	h1, body {
		max-width: none;
		position: static;
		height: auto;
	}

	h1 {
		text-align: center;
	}

	h1, h2, h3 {
		font-family: "Arial", sans-serif;
	}

	nav, nav + label {
		display: none;
	}
}
