:root {
	color-scheme: light dark;

	--header_bgcolor: light-dark(#b6ccff, #444);
	--body_bgcolor: light-dark(#fff, #1c1b22);
	--link_color: light-dark(#111, #fff);
	--border_mono_color: light-dark(#000, #fff);
	--border_mono_color2: light-dark(#333, #ddd);
}

@keyframes front-slideshow {
	0% {
		background-image: url('../img/slide/1.png');
	}
	33.33% {
		background-image: url('../img/slide/2.png');
	}
	66.66% {
		background-image: url('../img/slide/3.png');
	}
	100% {
		background-image: url('../img/slide/1.png');
	}
}

body {
	margin: 0;
}

a:link { text-decoration: underline; }
a:hover { text-decoration: none; }

header {
	background-color: var(--header_bgcolor);
	display: grid;
	grid-template-columns: auto auto;
	gap: 1em;
	margin-bottom: 2em;
	padding: 2em 2em;
	box-sizing: border-box;
	border-bottom: solid 1em;
	border-image: linear-gradient(to right, var(--header_bgcolor), var(--body_bgcolor)) 100;

	h1 {
		font-size: 1.5em;
		margin: 0 auto 0 0;

		a {
			color: var(--link_color);

			&:link {
				text-decoration: none;
			}
		}
	}

	nav {
		font-weight: bold;
		text-align: right;

		ul:first-child {
			line-height: 1.5em;
			vertical-align: middle;
			display: inline-block;
			list-style: none;
			margin: 0 0 0 auto;

			& > li {
				padding: 0 1em;
				float: left;

				&:nth-child(n + 2) {
					border-left: solid 1px var(--border_mono_color);
				}

				&:last-child {
					padding-right: 0;
				}

				&:hover {
					ul {
						display: block;

						li {
							float: inherit;
						}
					}
				}
			}

			ul {
				background-color: var(--header_bgcolor);
				display: none;
				position: absolute;
				padding: 0.5em 1em;
				list-style: none;

				li {
					padding: 0.5em;

					&:nth-child(n + 2) {
						border-top: solid 1px var(--border_mono_color);
					}
				}
			}
		}
	}
}

ul#breadcrumbs {
	margin: 1em auto;
}
ul#breadcrumbs li {
	display: inline-block;
}
ul#breadcrumbs li::before {
	content: ">";
	margin: 0 1ex;
}
ul#breadcrumbs li:first-child::before {
	content: "🏚";
}


div#toc {
	height: min-content;
	position: sticky;
	top: 0;

	li {
		&.toc-level-2 { margin-left: 1em; }
		&.toc-level-3 { margin-left: 2em; }

		line-height: 1.8;
		margin: 0.6em auto;
	}
}

main {
	max-width: 100%;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4em;
	margin: 2em 4em 4em;

	&:has(div#slshow) {
		grid-template-columns: 1fr 1fr;
	}

	ul, ol {
		margin: 2em auto;

		li {
			line-height: 1.8;
			margin: 1em auto;
			padding-left: 1ex;
		}
	}

	.file {
		width: 100%;
		height: 50vh;
	}

	article {
		width: inherit;

		*:not(ul):not(ol):first-child {
			margin-top: 0;
		}

		img {
			border-radius: 10px;
		}

		h1 {
			font-size: 1.8em;
			border-left-style: solid;
			border-left-width: 0.5em;
			border-radius: 0.3em;
			padding-left: 0.5em;
			margin: 4em auto 2em;
		}

		h2 {
			font-size: 1.5em;
			border-left-style: solid;
			border-left-width: 0.5em;
			border-radius: 0.3em;
			padding-left: 0.5em;
			margin: 3em auto 2em;
		}

		h3 {
			font-size: 1.2em;
			border-left-style: solid;
			border-left-width: 0.5em;
			border-radius: 0.3em;
			padding-left: 0.5em;
			margin: 3em auto 2em;
		}
		p {
			line-height: 1.8;
			margin: 1em auto;
		}

		table {
			border-collapse: collapse;
			border: solid 3px var(--border_mono_color2);
			margin: 2em auto;

			th, td {
				border-style: solid;
				border-width: 1px;
				padding: 0.8em;
			}
		}
	}

	div#toc {
		width: 18em;

		h1 {
			max-width: 100%;
			font-size: 1em;
			font-weight: bold;
			border-bottom: solid 2px var(--border_mono_color);
			padding: 0.5em;
		}
	}

	@keyframes front-slideshow {
		0% {
			background-image: url('../img/slide/1.png');
			background-color: white;
		}
		33.33% {
			background-image: url('../img/slide/2.png');
		}
		66.66% {
			background-image: url('../img/slide/3.png');
		}
		100% {
			background-image: url('../img/slide/1.png');
			background-color: red;
		}
	}

	div#slshow {
		aspect-ratio: 13.8 / 9;
		background-color: #333;
		background-image: url('../img/slide/1.png');
		background-size: contain;
		animation: front-slideshow 15s infinite;
		box-shadow: 10px 10px 3px rgba(0,0,0,0.5);
	}
}

footer {
	background-color: var(--header_bgcolor);
	text-align: center;
	margin-top: 4em;
	padding: 2em;
	box-sizing: border-box;

	h1 {
		font-size: 1em;
		margin: 0 auto;
	}

	address {
		display: flex;
		justify-content: center;
		gap: 1em;

		p {
			margin: 1em 0 0;
		}
	}
}

@media screen and (max-width: 60em){
	header {
		grid-template-columns: 100%;
		grid-template-rows: auto auto;
		margin-bottom: 2em;

		nav ul:first-child {
			display: block;
			margin: 0 auto 0 0;
			padding-left: 0;

			&> li {
				margin-top: 1em;

				&:first-child {
					padding-left: 0;
				}
			}
		}
	}

}

@media screen and (max-width: 50em) {
	main {
		display: block;
		margin: 3em 2em;

		&> * {
			margin: 3em 0;
		}

		div#toc {
			position: initial;
		}

		article {
			h1 {
				font-size: 1.5em;
			}

			th, td {
				display: block;
			}
		}
	}

	footer {
		address {
			display: block;
		}
	}
}

