/*=========================================
*            Custom properties            *
=========================================*/
/* Fonts */
:root {
	--font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;
}

/* Colors */
@media (prefers-color-scheme: light) {
	:root {
		--foreground: hsl(0 0% 20%);
		--light-foreground: hsl(0 0% 30%);
		--background: hsl(0 0% 95%);
		--dark-background: hsl(0 0% 90%);
		--border: hsl(0 0% 53%);
		--overlay: hsla(0 0% 10% / 0.5);
		--splash-overlay: hsl(0 0% 90% / 0.5);
		--action-color: hsl(261, 68%, 66%);
	}
}
@media (prefers-color-scheme: dark) {
	:root {
		--foreground: hsl(0 0% 95%);
		--light-foreground: hsl(0 0% 85%);
		--background: hsl(0 0% 10%);
		--dark-background: hsl(0 0% 15%);
		--border: hsl(0 0% 47%);
		--overlay: hsla(0 0% 90% / 0.5);
		--splash-overlay: hsl(0 0% 15% / 0.5);
		--action-color: hsl(261, 68%, 86%);
	}
}
[data-theme="light"] {
	--foreground: hsl(0 0% 20%);
	--light-foreground: hsl(0 0% 30%);
	--background: hsl(0 0% 95%);
	--dark-background: hsl(0 0% 90%);
	--border: hsl(0 0% 53%);
	--overlay: hsla(0 0% 10% / 0.5);
	--splash-overlay: hsl(0 0% 90% / 0.5);
	--action-color: hsl(261, 68%, 66%);
}
[data-theme="dark"] {
	--foreground: hsl(0 0% 95%);
	--light-foreground: hsl(0 0% 85%);
	--background: hsl(0 0% 10%);
	--dark-background: hsl(0 0% 15%);
	--border: hsl(0 0% 47%);
	--overlay: hsla(0 0% 90% / 0.5);
	--splash-overlay: hsl(0 0% 15% / 0.5);
	--action-color: hsl(261, 68%, 86%);
}

:root {
	color-scheme: light dark;
	/* Justified grid */
	--justified-row-ratio: 0.2;
	--justified-gap: 0.5rem;

	/* Instagrid grid */
	--ig-img-size: 15rem;
	--ig-gap: 0.5rem;
	--ig-transform-scale: 1.05;

	/* MonoColumn grid */
	--monocolumn-spacing: 3rem;

	/* Masonry grid */
	--masonry-img-width: 15rem;

	/* Slideshow */
	--slideshow-delay: 4s;
	--slideshow-duration: 1s;

	/* Typography */
	--h1-font-size: 1.7em;
	--h2-font-size: 1.5em;
	--h3-font-size: 1.4em;
	--h4-font-size: 1.3em;
	--h5-font-size: 1.2em;
	--h5-font-size: 1.1em;

	/* Misc */
	--transition: 300ms ease-in-out;
	--animation-duration: 1.5s;
	--networkIconSize: 1.5rem;
	--footer-nav-gap: 1rem;
}

/*=========================================
*                 Animations              *
=========================================*/
@keyframes fader {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}
@keyframes fadeInUp {
  0% {
    transform: translateY(5%);
    opacity: 0;
  }
  100% {
    transform: translateY(0%);
    opacity: 1;
  }
}

/*=========================================
*                  Global                 *
=========================================*/
html,
body {
	padding: 0;
	margin: 0 auto;
}

body {
	font-family: var(--font-family);
	color: var(--foreground);
	background-color: var(--background);
	line-height: 1.6;
}

h1 {
	font-size: var(--h1-font-size);
}
h2 {
	font-size: var(--h2-font-size);
}
h3 {
	font-size: var(--h3-font-size);
}
h4 {
	font-size: var(--h4-font-size);
}
h5 {
	font-size: var(--h5-font-size);
}
h6 {
	font-size: var(--h6-font-size);
}

:is(h1, h2, h3, h4, h5, h6) {
	line-height: 1.2;
}

a[href] {
	color: var(--action-color);
	text-decoration: underline;
}
a[href]:is(:hover, :focus-visible) {
	text-decoration: none;
}

article {
	font-size: 1.25em;
	margin: 0 auto;
	padding: 1rem;
}

p {
	margin-block-start: 0;
}

:where(ol, ul) p {
	margin: 0;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 1em 0;
	font-size: 0.7em;
	overflow: auto;
}

table thead {
	border-bottom: 1px solid var(--border);
}

table tbody tr:nth-child(even) {
	background-color: var(--dark-background);
}

table :is(th, td) {
	padding: 0.5rem;
}

blockquote {
	position: relative;
	padding: 1rem;
	background-color: var(--dark-background);
	border-inline-start: 0.5rem solid var(--border);
	font-style: italic;
}
blockquote::before,
blockquote::after {
	position: absolute;
	width: 100%;
	left: 0;
	content: "";
	display: block;
	height: 1px;
	background-image: linear-gradient(
		90deg,
		var(--border) 5%,
		rgba(34, 34, 34, 0) 30%
	);
}
blockquote::before {
	top: 0;
}
blockquote::after {
	bottom: 0;
}
blockquote p {
	margin: 0;
}

img {
	display: block;
	max-width: 100%;
	width: 100%;
	height: auto;
}
dt {
	font-weight: bold;
}

hr {
	position: relative;
	border: none;
	border-top: 1px solid var(--border);
	overflow: visible;
	width: 70%;
	margin: 3em auto;
}

hr::after {
	content: "ƒ";
	position: absolute;
	color: var(--foreground);
	font-size: 1.5em;
	font-style: italic;
	line-height: 1;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

figcaption {
	text-align: center;
	font-size: 0.8em;
	font-style: italic;
	color: var(--light-foreground);
}

/*=========================================
*                Utilities                *
=========================================*/
.visually-hidden {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.skip {
	overflow: hidden;
	position: absolute;
	z-index: 1;
	top: 0;
	height: 0;
	width: 100%;
	text-align: center;
	background-color: var(--background);
}
.skip:focus-within {
	height: auto;
}
.skip a {
	display: block;
	margin: 1rem;
}

a.icon-only,
a.icon-only > * {
	display: block;
}

*:focus-visible {
	border-radius: 0.5rem;
	outline-offset: 0.25rem;
	outline: 2px solid var(--action-color);
}

.centered {
	text-align: center;
}

.left-aligned {
	text-align: center;
}

/*=========================================
*              Main grid                *
=========================================*/
.main {
	display: grid;
	height: 100dvh;
	grid-template-columns: minmax(auto, 12.5rem) auto;
	grid-template-rows: 1fr;
	grid-template-areas: "Sidebar Content";
}

.sidebar {
	position: relative;
	grid-area: Sidebar;
	overflow: auto;
}
.content {
	grid-area: Content;
	overflow: auto;
}

@media (orientation: portrait), (max-width: 40em) {
	.main:not(.splash) {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"Sidebar"
			"Content";
	}
	.content {
		padding-block-end: 3rem;
	}
}

.splash {
	grid-template-columns: auto;
	grid-template-rows: 1fr;
	grid-template-areas: "Content";
	header {
		position: absolute;
		z-index: 30;
		background-color: var(--splash-overlay);
		inset: 0;
	}
	header nav {
		display: none;
	}
	.logo {
		margin-block-end: auto;
		max-height: 5rem;

		& > :is(img, svg) {
			width: auto;
			height: 100%;
		}
	}
	.network {
		width: auto;
		margin-inline-start: auto;
		gap: 1rem;
	}
	.splash-cta {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 2rem;
	}
	.splash-line {
		text-align: center;
		font-style: italic;
		font-family: serif;
		font-size: 2.5em;
		text-shadow: 2px 2px 6px var(--background);
	}
	.splash-link {
		border: 2px solid var(--foreground);
		border-radius: 0.5rem;
		padding: 0.5rem 2rem;
		font-size: 1.5em;
		text-decoration: none;
		color: var(--foreground);
		transition:
			color var(--transition),
			background-color var(--transition),
			border-color var(--transition);

		&:where(:hover, :focus-visible) {
			--button-color: var(--action-color);
			border-color: var(--button-color);
			background-color: var(--button-color);
			color: var(--dark-background);
		}
	}
}

.slideshow {
	position: relative;
	padding: 0;
	margin: 0 auto;
	width: 100vw;
	height: 100vh;
	list-style: none;

	& img {
		min-height: 100%;
		object-fit: cover;
		object-position: center;
	}
	& > li {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		display: flex;
	}
	& > li:first-of-type {
		z-index: 20;
	}
	& > li:nth-of-type(2) {
		z-index: 10;
	}
	& > li:nth-of-type(n + 3) {
		display: none;
	}
}
.playpause {
	display: none;
	align-items: center;
	justify-content: center;
	position: absolute;
	left: 1rem;
	bottom: 1rem;
	background: transparent;
	border: 2px solid var(--foreground);
	padding: 0.5rem;
	border-radius: 50%;
	width: 3rem;
	height: 3rem;
	cursor: pointer;
	font-size: 2em;
	line-height: 1;
	transition:
		background-color var(--transition),
		color var(--transition);

	&[data-paused="true"],
	&:where(:hover, :focus-visible) {
		background-color: var(--foreground);
		color: var(--background);

		& svg {
			stroke: var(--background);
		}
	}

	& svg {
		stroke: var(--foreground);
		width: 100%;
		height: 100%;
		display: block;
	}

	&:not([data-paused="true"]) .play-icon,
	&[data-paused="true"] .pause-icon {
		display: none;
	}
}
@media not (prefers-reduced-motion) {
	.slideshow > li:first-of-type {
		animation-name: fader;
		animation-delay: var(--slideshow-delay);
		animation-duration: var(--slideshow-duration);
	}
	.slideshow > li.paused {
		animation-play-state: paused;
	}
	.playpause {
		display: flex;
	}
}

/*=========================================
*                Sidebar                  *
=========================================*/
.sidebar {
	display: flex;
	flex-direction: column;
	padding: 1rem;
}
a.logo {
	display: block;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	font-weight: bold;
	font-size: 2em;
	word-wrap: break-word;
	color: var(--foreground);
	margin-block-end: 1rem;
}
a.logo > :is(img, svg) {
	width: 100%;
	height: auto;
	max-height: 5rem;
}
a.logo svg {
	fill: var(--foreground);
}

.menu {
	display: none;
	border: 0;
	padding: 0;
	background-color: transparent;
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
}

.menu svg {
	display: block;
	stroke: var(--foreground);
	width: 2rem;
	height: 2rem;
}

.nav {
	box-sizing: border-box;
	margin-block-end: auto;
}
.nav > ul {
	padding-block-start: 1rem;
}
.nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.nav .tags-list {
	padding-inline: 1rem;
	font-size: 0.8em;
}
.nav-item {
	margin-block-end: 1rem;
	font-size: .8em;
	text-transform: uppercase;
	letter-spacing: .125rem;
}
.nav-item a {
	display: block;
	color: inherit;
	text-decoration: none;
	border-block-end: 1px solid transparent;
	text-indent: 0;
	transition: color var(--transition), text-indent var(--transition);
}
.tags-list a {
	display: block;
	padding-block: .125rem;
	color: var(--light-foreground);
}
.nav-item a:is(:hover, :focus-visible) {
	color: var(--action-color);
	opacity: 1;
	text-indent: .5rem;
}
.nav-item a[aria-current] {
	border-block-end: 1px solid var(--border);
	color: var(--action-color);
}

.network {
	box-sizing: border-box;
	display: flex;
	width: 100%;
	margin-block: auto 0;
	padding: 1rem 0;
	align-items: center;
	justify-content: space-around;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
}
.network-icon {
	fill: var(--foreground);
	display: block;
	width: var(--networkIconSize);
	height: var(--networkIconSize);
	transition: fill var(--transition);
}
.network a:is(:hover, :focus-visible) .network-icon {
	fill: var(--action-color);
}

@media (orientation: portrait), (max-width: 40em) {
	.js {
		.main:not(.splash) {
			.logo {
				margin: 0 3rem 0;
			}
			.menu {
				display: block;
			}
			.nav {
				max-height: 0;
				overflow: hidden;
				transition: max-height var(--transition);
			}
			.nav.open {
				max-height: 100dvh;
			}
			.network {
				position: fixed;
				z-index: 1;
				bottom: 0;
				left: 0;
				right: 0;
				background-color: var(--background);
			}
		}
	}
}

/*=========================================
*                Content                  *
=========================================*/
.grid {
	padding: 0;
	margin: 0;
	list-style: none;
}
.animated .grid img {
	animation-name: fader;
	animation-duration: var(--animation-duration);
	animation-direction: reverse;
}

:where(.grid:not(.monocolumn), .article) .post-title {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 1rem;
	opacity: 0;
	transition: opacity var(--transition);
	background-color: var(--overlay);
	color: var(--background);
	font-size: 1em;
	text-align: center;
	font-weight: bold;
}
:where(.grid:not(.monocolumn), .article)
	a:is(:hover, :focus-visible)
	.post-title {
	opacity: 1;
}

/* justified grid */
.justified {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--justified-gap);
}
.justified .post {
	position: relative;
	width: 20rem;
}
.justified .post-title {
	align-items: end;
}
@media (max-width: 28.75em) {
	.justified {
		flex-direction: column;
		flex-wrap: nowrap;
	}
	.justified .post {
		width: 100%;
	}
}

/* Instagrid grid */
.instagrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--ig-img-size), 1fr));
	grid-auto-flow: row;
	gap: var(--ig-gap);
	padding: var(--ig-gap) 0;
}
.instagrid .post {
	position: relative;
	overflow: hidden;
}
.instagrid img {
	width: fit-content;
	aspect-ratio: 1;
	object-fit: cover;
	object-position: center;
	transition: transform var(--transition);
}
.instagrid a:is(:hover, :focus-visible) img {
	transform: scale(var(--ig-transform-scale));
}

@media (orientation: portrait), (max-width: 40em) {
	.instagrid {
		padding: 0 var(--ig-gap);
	}
}

/* Monocolumn grid */
.monocolumn {
	height: auto;
	overflow: auto;
	scroll-snap-type: y mandatory;
	flex-basis: 100%;
}
.monocolumn .post {
	display: flex;
	flex-direction: column;
	scroll-snap-align: center;
	scroll-snap-stop: normal;
	padding: var(--monocolumn-spacing) 0;
}
.monocolumn .post a {
	display: block;
	margin: 0 auto;
	text-decoration: none;
	color: inherit;
}
.monocolumn .post img {
	height: auto;
	max-width: 100%;
	max-height: calc(100dvh - var(--monocolumn-spacing) * 3);
	transition: filter var(--transition);
}
.monocolumn a:is(:hover, :focus-visible) img {
	filter: grayscale(80%);
}
.monocolumn .post-title {
	text-align: center;
	margin-block-end: 0;
}
.content:has(.monocolumn) {
	height: 100dvh;
	display: flex;
	flex-direction: column;
}

@media (orientation: portrait), (max-width: 40em) {
	.content:has(.monocolumn) {
		height: auto;
		display: block;
	}
	.monocolumn {
		height: auto;
	}
	.monocolumn .post {
		padding-block-start: 0;
	}
	.monocolumn .post img {
		max-height: none;
	}
}

/* Masonry grid */
.masonry .post {
	width: var(--masonry-img-width);
	position: relative;
}

@media (orientation: portrait), (max-width: 31em) {
	.masonry .post {
		--masonry-img-width: 100%;
	}
}

/*=========================================
*                Article                  *
=========================================*/
.article-title,
.article-content {
	max-width: 65ch;
	margin: 0 auto;
	padding-inline: 1rem;
}
.article-title {
	text-align: center;
	margin-block: 1rem;
}
.article-content img {
	margin: 0 auto;
	width: auto;
}

.photo {
	margin: 0 auto;
}
.photo img {
	display: block;
	max-height: 90dvh;
	max-width: 100%;
	width: auto;
	height: auto;
	margin: 0 auto;
}
.animated .photo img {
	animation: var(--animation-duration) fadeInUp;
}

.exif {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	width: fit-content;
	margin: 0 auto;
	padding: 1rem;
	color: var(--light-foreground);
	background-color: var(--dark-background);
	font-size: 0.7em;
}
.exif > div {
	display: flex;
	align-items: center;
}
.exif dt {
	display: inline-flex;
	align-items: center;
	font-weight: bold;
}
.exif dd {
	margin-inline: 0.5rem;
}
.exif dd span:not(:last-child)::after {
	content: "•";
	display: inline-block;
	margin-inline: 0.25rem;
}
.exif-icon {
	display: inline-block;
	width: 1.5rem;
	height: 1.5rem;
	fill: var(--light-foreground);
}
.exif-icon--settings {
	stroke: var(--light-foreground);
}
.tags {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	font-size: 0.8em;
}
.tags a:not(:last-child)::after {
	content: "•";
	display: inline-block;
	margin-inline: 0.25rem;
	color: var(--foreground);
}
.tags-icon {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	fill: var(--light-foreground);
	margin-inline-end: 0.5rem;
}

.prints {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;

	& .prints-count {
		font-style: italic;
		font-size: 0.8em;
	}
	& .prints-link {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		background: transparent;
		border: 2px solid var(--foreground);
		padding: 0.25rem 0.5rem;
		border-radius: 0.5rem;
		color: var(--foreground);
		font-size: 0.9em;
		text-decoration: none;
		transition:
			color var(--transition),
			background-color var(--transition),
			border-color var(--transition);

		& svg {
			transition: fill var(--transition);
		}

		&:where(:hover, :focus-visible) {
			--button-color: var(--action-color);
			border-color: var(--button-color);
			background-color: var(--button-color);
			color: var(--dark-background);

			& svg {
				fill: var(--dark-background);
			}
		}
	}
}

/*=========================================
*                Footer                   *
=========================================*/
.footer-nav {
	display: flex;
	list-style: none;
	gap: var(--footer-nav-gap);
	margin: 0;
	padding: 0;
}
.footer-nav > * {
	flex: 0 0 calc(50% - var(--footer-nav-gap) / 2);
	height: 95dvh;
	overflow: hidden;
	position: relative;
}
.footer-nav-prev {
	clip-path: polygon(20% 0, 100% 0%, 100% 100%, 20% 100%, 0 50%);
	margin-block-end: auto;
}
.footer-nav-next {
	clip-path: polygon(0 0, 80% 0%, 100% 50%, 80% 100%, 0 100%);
	margin-block-start: auto;
}
.footer-nav :is(a, picture) {
	display: block;
	height: 100%;
	width: 100%;
}
.footer-nav img {
	width: 100%;
	height: 100%;
	max-height: none;
	object-fit: cover;
	object-position: center;
}
@media (orientation: portrait), (max-width: 40em) {
	.footer-nav > * {
		height: 70dvh;
	}
}