body {
	font-family: "Lava 6", sans-serif;
	background: rgb(142,145,143);
	display: grid;
	margin: 0;
	padding: 2em 1em;
	gap: 1em;
	grid-auto-rows: fit-content(90vh);
}
body:has(main) {
	padding: 2em;
}
h1, p {
	margin: auto;
	font-weight: 400;
	font-size: 3em;
}
p {
	font-size: 2em;
	margin-bottom: 1em;
}
p:has(+ h1) {
	margin-bottom: 0;
}
p + h1 {
	margin-block-end: .7em;
}
h1 a,
p:first-child a {
	color: black;
	text-decoration: none;
}
h1 a:hover,
p:first-child a:hover {
	text-decoration: underline;
}
@media (max-width: 28em) {
	h1 {
		font-size: 2em;
		text-align: center;
	}
	p {
		font-size: 1em;
	}
}
img {
	width: auto;
	max-height: 95vh;
	max-height: calc(100vh - 2em);
	max-width: calc(100vw - 2em);
	margin: 1em auto;
}
nav {
	max-width: calc(100vw - 2em);
	margin: 2em auto;
	display: grid;
	grid-template-columns: auto auto;
	gap: 1em;
}
nav a {
	color: black;
	display: flex;
	gap: .2em;
	transition: .2s;
}
nav a:hover {
	color: white;
}
a[rel="prev"] {
	grid-column-start: 1;
}
a[rel="prev"]::before {
	content: '←';
}
a[rel="next"] {
	grid-column-start: 2;
}
a[rel="next"]::after {
	content: '→';
}
@media (max-width: 24em) {
	nav a:not(:only-child) span {
		clip: rect(0 0 0 0); 
		  clip-path: inset(50%);
		  height: 1px;
		  overflow: hidden;
		  position: absolute;
		  white-space: nowrap; 
		  width: 1px;
	}
}

footer p {
	font-size: 1em;
	text-align: center;
}


main {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(18em,1fr));
	gap: 2em;
	justify-content: center;
	align-content: end;
}
main img {
	min-height: 40vh;
	height: 18em;
	width: 100%;
	min-height: auto;
	object-fit: cover;
	transition: .9s;
	margin: auto;
}
main article {
	display: grid;
	align-content: end;
	border-block-end: 1px solid black;
}
/* main article:nth-last-of-type(3n + 3) {
	padding-block-end: 2em;
}
main article:nth-of-type(3n + 3) {
	align-content: start;
} */
main img,
main a {
	grid-column: 1/2;
	grid-row: 1/2;
	height: 18em;
	box-sizing: border-box;
}

main a {
	z-index: 1;
	background-image: linear-gradient(transparent 80%, black 110%);
	color: white;
	padding: .5em;
	background-size: 100% 100%;
	text-decoration: none;
	display: flex;
	align-items: end;
	background-position: bottom;
}
a:hover {
	background-size: 100% 500%;
}
a:focus-visible {
	background-size: 100% 500%;
	outline: 2px dashed white;
}

@media (prefers-reduced-motion: no-preference) {
	main a {
		transition: .4s;
	}
	article a:hover + img,
	article a:focus + img {
		object-position: 60% 60%;
	}
	article:nth-of-type(2n) a:hover + img,
	article:nth-of-type(2n) a:focus + img {
		object-position: 40% 40%;
	}
}