@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,700;1,400;1,700&family=Rubik:ital,wght@0,600;1,600&display=swap");

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	/* Color scheme */

	--textcolor: #21272c;
	--bgcolor: #fefffe;
	--highlight: #e7131a;
}

@media (prefers-color-scheme: dark) {
	* {
		--textcolor: #f5f5f5;
		--bgcolor: #1e1e1e;
		--highlight: #fe5247;
	}
}

body {
	position: relative;
	margin: 0 auto; /* centers the layout */
	max-width: 64em; /* remove this for a full-width layout */
	background: var(--bgcolor);
	color: var(--textcolor);
	font-size: 18px;
	font-family: "EB Garamond", serif, system-ui;
	line-height: 1.4;
}

/* ------- Sections ------- */

section {
	position: absolute;
	top: 0;
	/* ! Everything below is needed ! */
	display: none;
	padding: calc(6em + 5vw) 5vw 8vw 5vw;
	min-height: 100vh;
	width: 100%;
	background: var(--bgcolor);
}

section:target {
	/* Show section */
	display: block;
}

section#home {
	/* Show #home by default */
	display: block;
}

/* ------- Header ------- */

header {
	position: absolute;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	padding: 5vw 5vw 0 5vw;
	width: 100%;
}

header h1 {
	flex: 1; /* pushes nav to the right */
	padding: 0 5vw 0.5em 0;
	white-space: nowrap;
	font-size: 1.5em;
	font-family: "Rubik", sans-serif, system-ui;
}

nav a:not(:last-of-type) {
	margin-right: 1.5vw;
}

/* ------- General ------- */

a {
	color: var(--highlight);
	text-decoration: none;
}

a:hover {
	border-bottom: 1px solid;
}

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

h2,
h3,
h4 {
	margin: 1.6em 0 0.6em 0;
	font-weight: 700;
	font-size: 1.1em;
}

p,
ul,
ol,
article {
	margin-bottom: 0.6em;
	max-width: 60ch; /* Limit line-length to 60 characters */
}

ul {
	list-style-type: none;
}

ul li::marker {
	content: "\2022   ";
}

li {
	margin-bottom: 0.2em;
}

ul,
ol {
	padding-left: 2ch;
}

b,
strong {
	font-weight: 600;
}

small {
	font-size: 0.85em;
}

hr {
	margin: 1.2em 0;
	height: 1px;
	border: 0;
	background: currentColor;
	opacity: 0.1;
}

abbr {
	text-decoration: none;
}

abbr[title]:hover {
	opacity: 0.7;
	cursor: help;
}

blockquote {
	position: relative;
	margin-bottom: 0.6em;
	padding-left: 2ch;
	opacity: 0.7;
}

blockquote:before {
	position: absolute;
	top: 0.3em;
	bottom: 0.3em;
	left: 0;
	width: 1px;
	background: currentColor;
	content: "";
	opacity: 0.2;
}

img,
svg,
video,
audio {
	display: block;
	max-width: 100%;
	height: auto;

	fill: currentColor;
}

code,
textarea {
	font-size: 1em;
	font-family: ui-monospace, SF Mono, Menlo, Monaco, Andale Mono, monospace;
	opacity: 0.7;
}

a code {
	opacity: 1;
}

pre,
textarea {
	position: relative;
	display: block;
	margin: 0.8em 0 1em 0;
	padding: 0.6em 0.9em;
	width: 100%;
	border: 0;
	border-radius: 4px;
	background: rgba(255, 255, 100, 0.075);
	box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.2),
		inset -1px -1px 0 rgba(0, 0, 0, 0.04);
	color: inherit;
	white-space: pre;
	/* for code samples */
	font-size: 0.9em;
	line-height: inherit;
}

/* Inline footnotes */

label {
	padding-left: 0.1em;
	vertical-align: super;
	font-size: 0.75em;
	line-height: 1;
	cursor: pointer;
}

label:hover {
	color: var(--highlight);
}

label:before {
	content: "[";
}

label:after {
	content: "]";
}

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

input:checked + small {
	display: block;
	padding: 0.8em 0 1em 2.5vw;
}

/* Figures */

figure {
	margin: 2em 0 1.5em 0;
}

figure figcaption {
	margin: 0.8em 0 0 0;
	font-size: 0.85em;
	opacity: 0.7;
}

/* Responsive video embeds */

figure.video {
	position: relative;
	overflow: hidden;
	padding-bottom: 56.25%; /* 16:9 */
	height: 0;
}

figure.video iframe,
figure.video object,
figure.video embed {
	position: absolute;
	top: 0;
	left: 0;
	visibility: hidden; /* so loading="lazy" should work? */
	width: 100%;
	height: 100%;
	border: 0;
}

section:target iframe {
	visibility: visible;
}

/* External links */

a[href*='//']:after
{
	color: var(--textcolor);
	content: "\2197"; /* top right arrow: ↗ */
	font-weight: 300;
	font-size: 0.85em;
	opacity: 0.25;
}

a[href*='//']:hover:after
{
	color: var(--highlight);
	opacity: 1;
}

/* File links */

a:before {
	margin-right: 0.4em;
	font-size: 0.7em;
}

/* Add more filetypes here if you want */

a[href$=".pdf"]:before {
	content: "PDF";
}

a[href$=".txt"]:before {
	content: "TXT";
}

a[href$=".mp3"]:before {
	content: "MP3";
}

a[href$=".zip"]:before {
	content: "ZIP";
}

a[href$=".rar"]:before {
	content: "RAR";
}

a[href$=".jpeg"]:before,
a[href$=".jpg"]:before,
a[href$=".gif"]:before,
a[href$=".png"]:before {
	content: "IMG";
}

/* ------- News ------- */

article + article {
	margin-top: 4.5em;
}

article h2 {
	margin: 0 0 1em 0;
	font-weight: 700;
}

article time {
	margin-left: 0.6em;
	font-weight: 400;
	font-size: 0.8em;
	opacity: 0.7;
}

/* ------- Images Grid ------- */

.grid {
	display: grid;
	padding: 2em 0;

	grid-gap: 5vmin;
	grid-template-columns: repeat(
		auto-fill,
		minmax(150px, 1fr)
	); /* 150px = minimum image size */
	grid-auto-flow: dense;
}

.grid a {
	position: relative;
	border: 0;
}

.grid a:hover {
	transform: scale(0.975);
}

/* For a square ratio */
.grid a:before {
	display: block;
	padding-top: 100%;
	content: "";
}

.grid a img {
	position: absolute;
	top: 0;
	width: 100%;
	height: 100%;

	object-fit: contain;
}

/* ------- Slideshow ------- */

.slides {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	overflow-y: scroll;
	height: 100vh;

	scroll-snap-type: y mandatory;
}

.slides figure {
	display: grid;
	align-content: center;
	margin: 0;
	padding: 0 5vw;
	height: 100vh;

	place-items: center;
	scroll-snap-align: center;
}

.slides figure img {
	max-height: 88vh; /* Adjust if needed */
}

.slides figure.cover {
	padding: 0;
}

.slides figure.cover img {
	position: absolute;
	z-index: -1;
	max-height: none;
	width: 100vw;
	height: 100vh;

	object-fit: cover;
}

/* ------- Lightbox ------- */

.lightbox {
	display: none;
	color: var(--textcolor);
}

.lightbox:target {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	display: grid;
	align-content: center;
	border: 0;
	background: var(--bgcolor);

	place-items: center;
}

.lightbox img {
	z-index: 4;
	max-height: 100vh;
}

.lightbox:target:before {
	position: absolute;
	display: block;
	width: 2em;
	height: 2em;
	border: 1px solid;
	border-right-color: transparent;
	border-radius: 50%;
	/* Loading spinner */
	content: "";
	opacity: 0.25;
	transform: translateX(-50%);
	animation: spin 0.8s infinite linear;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

.lightbox:target:after {
	position: fixed;
	top: 0.75em;
	right: 0.5em;
	z-index: 4;
	/* × to close */
	content: "\00D7";
	font-weight: 200;
	font-size: 2em;
	line-height: 0;
}

/* ------- Smaller screens ------- */

@media only screen and (max-width: 680px) {
	body {
		font-size: 16px;
	}
}

@media only screen and (max-width: 540px) {
	nav {
		width: 100%;
	} /* Fix for older webkit versions */
}

/* ------- Print ------- */

@media print {
	nav,
	.lightbox:target:after {
		display: none;
	}

	article,
	figure,
	img {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	/* Inline footnotes */

	label + input + small {
		display: inline;
	}

	label + input + small:before {
		content: "[";
	}

	label + input + small:after {
		content: "]";
	}

	/* Slides */

	.slides,
	.slides figure {
		position: relative;
		padding: 0;
		height: auto;
	}

	.slides figure img,
	.slides figure.cover img {
		position: relative;
		z-index: 1;
		max-height: auto;
		width: auto;
		height: 100vh;

		object-fit: contain;
	}
}
