:root {
	--bg: #f7f5f2;
	--surface: #ffffff;
	--text: #22201c;
	--muted: #6f6a62;
	--line: #e3dfd8;
	--accent: #8a4b2a;
	--shadow: 0 1px 3px rgba( 0, 0, 0, 0.12 );
}

@media ( prefers-color-scheme: dark ) {
	:root {
		--bg: #161513;
		--surface: #22201d;
		--text: #ece8e1;
		--muted: #a39d93;
		--line: #34312c;
		--accent: #e0a07a;
		--shadow: 0 1px 3px rgba( 0, 0, 0, 0.5 );
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var( --bg );
	color: var( --text );
	font: 16px/1.5 Georgia, "Iowan Old Style", "Times New Roman", serif;
}

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

a:hover {
	text-decoration: underline;
}

header.site, footer.site {
	padding: 14px 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

header.site {
	border-bottom: 1px solid var( --line );
	font-size: 18px;
	font-weight: 600;
}

header.site a {
	color: var( --text );
}

footer.site {
	margin-top: 40px;
	border-top: 1px solid var( --line );
	font-size: 14px;
	text-align: right;
}

main {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 16px;
}

h1 {
	margin: 20px 0 8px;
	font-size: 30px;
	font-weight: normal;
}

.crumbs {
	margin-top: 14px;
	color: var( --muted );
	font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.crumbs span {
	margin: 0 2px;
}

.description {
	max-width: 46em;
	color: var( --muted );
}

/* Album cards */

ul.albums, ul.photos {
	list-style: none;
	margin: 20px 0;
	padding: 0;
	display: grid;
	gap: 16px;
}

ul.albums {
	grid-template-columns: repeat( auto-fill, minmax( 190px, 1fr ) );
}

ul.albums a {
	display: block;
	height: 100%;
	padding: 8px 8px 10px;
	background: var( --surface );
	border-radius: 6px;
	box-shadow: var( --shadow );
	color: var( --text );
}

ul.albums a:hover {
	text-decoration: none;
	outline: 2px solid var( --accent );
}

ul.albums img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 3px;
	background: var( --line );
}

ul.albums .title {
	display: block;
	margin-top: 8px;
	font-size: 17px;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

ul.albums .count {
	display: block;
	color: var( --muted );
	font: 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Photo thumbnails */

ul.photos {
	grid-template-columns: repeat( auto-fill, minmax( 140px, 1fr ) );
	gap: 8px;
}

ul.photos a {
	display: block;
}

ul.photos img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 3px;
	background: var( --line );
}

ul.photos a:hover img {
	outline: 2px solid var( --accent );
}

/* Single photo */

figure.photo {
	margin: 16px 0 0;
	text-align: center;
}

figure.photo img {
	max-width: 100%;
	max-height: 82vh;
	width: auto;
	height: auto;
	box-shadow: var( --shadow );
	background: var( --line );
}

#zoom img {
	cursor: zoom-in;
}

/* Full-window view, switched on by nav.js */

html.full, html.full body {
	overflow: hidden;
}

html.full #zoom img {
	position: fixed;
	inset: 0;
	z-index: 10;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-width: none;
	max-height: none;
	object-fit: contain;
	background: #000;
	box-shadow: none;
	cursor: zoom-out;
}

figure.photo h1 {
	margin-top: 12px;
	font-size: 22px;
}

figure.photo .description {
	margin: 4px auto;
}

.details {
	margin: 4px 0;
	color: var( --muted );
	font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.pager {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 12px;
	margin: 18px 0;
	font: 15px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.pager #next {
	text-align: right;
}

/* Login */

form.login {
	display: flex;
	gap: 8px;
	max-width: 360px;
}

form.login input {
	flex: 1;
	min-width: 0;
	padding: 8px 10px;
	font-size: 16px;
	border: 1px solid var( --line );
	border-radius: 4px;
	background: var( --surface );
	color: var( --text );
}

form.login button {
	padding: 8px 16px;
	font-size: 16px;
	border: 0;
	border-radius: 4px;
	background: var( --accent );
	color: var( --bg );
	cursor: pointer;
}

.error {
	color: #c0392b;
}
