/* lorebook.css: the Lorebook (hub, tile pages and content pages). */

:root {
	--lb-ink: #2b211c;
	--lb-ink-soft: #5b4a40;
	--lb-rust: #6f4e37;
	--lb-gold: #febb26;
	--lb-bone: #f4ede3;
	--lb-paper: #fbf8f3;
	--lb-line: #e2d8cb;
	--lb-night: #1c1512;
}

/* general.css pads every <p>, centres headings and stretches buttons; undo inside the Lorebook. */
.lb-band p,
.lb-layout p,
.lb-hub p {
	padding: 0;
}

.lb-layout h1,
.lb-layout h2,
.lb-layout h3,
.lb-hub h2,
.lb-hub h3 {
	text-align: left;
	color: var(--lb-ink);
}

.lb-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.lb-cap {
	text-transform: capitalize;
}

/* ---------- band at the top ---------- */

.lb-band {
	color: #fff;
	background:
		linear-gradient(rgba(20, 13, 10, 0.7), rgba(20, 13, 10, 0.7)),
		url('/assets/img/Black_Cave._Krasnodar_region._Russia._03_1.jpg') center / cover no-repeat;
}

.lb-band-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 18px 24px;
	display: flex;
	align-items: baseline;
	gap: 16px;
	flex-wrap: wrap;
}

.lb-band-home {
	font-family: 'Kaushan Script', cursive;
	font-weight: 400;
	font-size: 2.2rem;
	line-height: 1.1;
	color: #fff;
	text-decoration: none;
	margin: 0;
}

a.lb-band-home:hover {
	color: var(--lb-gold);
}

.lb-band-sub {
	font-size: 0.8rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--lb-gold);
	margin: 0;
}

.lb-band-sub a {
	color: var(--lb-gold);
	text-decoration: none;
}

.lb-band-sub a:hover {
	text-decoration: underline;
}

.lb-band--hub .lb-band-inner {
	display: block;
	padding: 36px 24px 32px;
	text-align: center;
}

.lb-band--hub .lb-band-home {
	font-size: clamp(3rem, 8vw, 4.4rem);
	text-align: center;
	color: #fff;
}

.lb-band--hub .lb-band-sub {
	margin: 6px 0 22px;
}

/* ---------- search box ---------- */

.lb-search {
	position: relative;
	margin: 0 0 16px;
}

.lb-search input {
	width: 100%;
	margin: 0;
	font: inherit;
	font-size: 1rem;
	padding: 10px 12px;
	border: 1px solid var(--lb-line);
	border-radius: 3px;
	background: #fff;
	color: var(--lb-ink);
	box-sizing: border-box;
}

.lb-search input:focus {
	outline: 2px solid var(--lb-gold);
	outline-offset: 1px;
	border-color: var(--lb-gold);
}

.lb-search--big {
	max-width: 560px;
	margin: 0 auto;
}

.lb-search--big input {
	font-size: 1.1rem;
	padding: 14px 16px;
	border: none;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.lb-suggest {
	position: absolute;
	z-index: 20;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	background: #fff;
	border: 1px solid var(--lb-line);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	max-height: 360px;
	overflow-y: auto;
	text-align: left;
}

.lb-suggest a {
	display: block;
	padding: 8px 12px;
	color: var(--lb-ink);
	text-decoration: none;
	border-bottom: 1px solid #f1ebe2;
}

.lb-suggest a span {
	display: block;
	font-size: 0.78rem;
	color: var(--lb-ink-soft);
}

.lb-suggest a:hover,
.lb-suggest a.is-active {
	background: var(--lb-bone);
}

.lb-suggest .lb-suggest-all {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--lb-rust);
}

.lb-suggest-none {
	margin: 0;
	padding: 10px 12px !important;
	color: var(--lb-ink-soft);
	font-size: 0.9rem;
}

mark {
	background: #fde7a6;
	color: inherit;
	padding: 0 1px;
}

/* ---------- layout for tile and content pages ---------- */

#content.lb-layout {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 40px;
	padding: 28px 32px 40px;
	box-sizing: border-box;
	width: 100%;
}

.lb-aside {
	position: sticky;
	top: 150px;
	align-self: start;
}

.lb-toc summary,
.lb-topics summary {
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
	padding: 6px 0;
}

.lb-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lb-toc > ul > li {
	border-top: 1px solid #f1ebe2;
}

.lb-toc a {
	display: block;
	padding: 6px 0;
	color: var(--lb-ink);
	text-decoration: none;
	font-size: 0.93rem;
}

.lb-toc a:hover {
	color: var(--lb-rust);
}

.lb-toc li.is-current > a {
	font-weight: 700;
}

.lb-toc li ul a {
	padding: 4px 0 4px 12px;
	border-left: 2px solid var(--lb-line);
	font-size: 0.88rem;
}

.lb-toc a[aria-current="page"] {
	color: var(--lb-rust);
	font-weight: 700;
}

.lb-toc li ul a[aria-current="page"] {
	border-left-color: var(--lb-rust);
}

/* ---------- a page ---------- */

.lb-page {
	max-width: 720px;
	color: var(--lb-ink);
	line-height: 1.65;
	font-size: 1.02rem;
}

.lb-crumbs {
	font-size: 0.85rem;
	color: var(--lb-ink-soft);
	margin-bottom: 6px;
}

.lb-crumbs a {
	color: var(--lb-ink-soft);
}

.lb-page h1 {
	font-size: 2.1rem;
	line-height: 1.2;
	margin: 0 0 12px;
}

.lb-tile-page h1 {
	font-family: 'Kaushan Script', cursive;
	font-weight: 400;
	color: var(--lb-rust);
	font-size: 2.6rem;
}

.lb-page h2 {
	font-size: 1.3rem;
	margin: 30px 0 8px;
	padding-top: 4px;
}

.lb-page h3 {
	font-size: 1.1rem;
	margin: 22px 0 6px;
}

.lb-page h2[id],
.lb-page h3[id] {
	scroll-margin-top: 150px;
}

.lb-page p {
	margin: 0 0 14px;
}

.lb-page ul {
	margin: 0 0 16px;
	padding-left: 22px;
}

.lb-page li {
	margin-bottom: 6px;
}

.lb-page a {
	color: var(--lb-rust);
}

/* The elder's opening words */
.lb-epigraph {
	margin: 0 0 18px;
	padding: 2px 0 2px 18px;
	border-left: 2px solid #c7bcaf;
	font-family: Georgia, 'Times New Roman', serif;
	font-style: italic;
	font-size: 1.12rem;
	line-height: 1.6;
	color: var(--lb-ink-soft);
}

.lb-epigraph p {
	margin: 0;
}

.lb-summary {
	font-size: 1.12rem;
	color: var(--lb-ink);
	font-weight: 700;
	margin: 12px 0 22px !important;
}

/* Status chips */
.lb-status {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 2px;
	vertical-align: middle;
	white-space: nowrap;
}

.lb-status.is-in-game {
	background: #e6efd8;
	color: #3e5a1f;
}

.lb-status.is-in-development {
	background: #fdeecb;
	color: #7a4f00;
}

.lb-status.is-planned {
	background: #e9ebec;
	color: #4c5157;
}

/* Note box */
.lb-note {
	background: var(--lb-bone);
	border-left: 3px solid var(--lb-rust);
	padding: 12px 16px;
	margin: 20px 0;
	color: var(--lb-ink);
	font-size: 0.95rem;
	line-height: 1.6;
}

/* Step path: a trail of stones */
.lb-path {
	list-style: none;
	counter-reset: step;
	margin: 18px 0 24px;
	padding: 0 !important;
}

.lb-path li {
	counter-increment: step;
	position: relative;
	padding: 0 0 18px 48px;
	margin: 0;
}

.lb-path li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: -2px;
	width: 32px;
	height: 28px;
	border-radius: 50% 50% 46% 54% / 60% 55% 45% 40%;
	background: #8d8379;
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	display: grid;
	place-items: center;
	box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.lb-path li::after {
	content: '';
	position: absolute;
	left: 15px;
	top: 28px;
	bottom: 2px;
	border-left: 2px dotted #c7bcaf;
}

.lb-path li:last-child {
	padding-bottom: 0;
}

.lb-path li:last-child::before {
	background: var(--lb-rust);
}

.lb-path li:last-child::after {
	display: none;
}

/* Page footer: topics, see also, previous/next */
.lb-foot {
	margin-top: 36px;
	border-top: 1px solid var(--lb-line);
	padding-top: 18px;
}

.lb-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px !important;
}

.lb-tags span {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
	margin-right: 4px;
}

.lb-tags a {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--lb-ink);
	background: #f6ecdc;
	border: 1px solid #ead9bd;
	padding: 3px 10px;
	text-decoration: none;
	white-space: nowrap;
	text-transform: capitalize;
}

.lb-tags a:hover {
	border-color: var(--lb-rust);
	color: var(--lb-rust);
}

.lb-foot h2 {
	font-size: 1.05rem;
	margin: 20px 0 8px;
}

.lb-related {
	list-style: none;
	padding: 0 !important;
	margin: 0 0 20px !important;
}

.lb-related li {
	padding: 8px 0;
	border-bottom: 1px solid #f1ebe2;
	margin: 0;
}

.lb-related a {
	font-weight: 700;
}

.lb-related span {
	display: block;
	font-size: 0.88rem;
	color: var(--lb-ink-soft);
}

.lb-pager {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 8px;
}

.lb-pager a {
	flex: 1;
	max-width: 48%;
	border: 1px solid var(--lb-line);
	padding: 10px 14px;
	text-decoration: none;
	color: var(--lb-ink);
	font-weight: 700;
	background: var(--lb-paper);
}

.lb-pager a:hover {
	border-color: var(--lb-rust);
}

.lb-pager span {
	display: block;
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
	font-weight: 700;
}

.lb-pager .lb-next {
	text-align: right;
	margin-left: auto;
}

/* Cards (tile pages and search results) */
.lb-cards {
	list-style: none;
	margin: 0 0 8px !important;
	padding: 0 !important;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
}

.lb-cards li {
	margin: 0;
}

.lb-cards a {
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 100%;
	box-sizing: border-box;
	padding: 14px 16px;
	background: var(--lb-paper);
	border: 1px solid var(--lb-line);
	border-top: 3px solid #8d8379;
	color: var(--lb-ink);
	text-decoration: none;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.lb-cards a:hover {
	border-color: var(--lb-rust);
	transform: translateY(-2px);
}

.lb-cards--feature a {
	border-top-color: var(--lb-gold);
	background: #fff8e6;
}

.lb-cards h3 {
	margin: 0;
	font-size: 1.05rem;
	color: var(--lb-ink);
}

.lb-cards p {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--lb-ink-soft);
	flex: 1;
}

.lb-cards .lb-status {
	align-self: flex-start;
}

.lb-card-sec {
	font-size: 0.75rem;
	color: var(--lb-ink-soft);
}

/* Topics not yet written */
.lb-upcoming {
	list-style: none;
	padding: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.lb-upcoming li {
	margin: 0;
	font-size: 0.88rem;
	color: var(--lb-ink-soft);
	border: 1px dashed #cfc4b6;
	padding: 4px 10px;
}

/* ---------- the hub ---------- */

#content.lb-hub {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 220px;
	gap: 32px;
	padding: 28px 32px 36px;
	box-sizing: border-box;
	width: 100%;
	color: var(--lb-ink);
}

.lb-tiles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.lb-tile {
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
	padding: 20px 20px 16px;
	background: var(--lb-paper);
	border: 1px solid var(--lb-line);
	border-top: 4px solid var(--lb-rust);
	color: var(--lb-ink);
	text-decoration: none;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.lb-tile:hover {
	border-color: var(--lb-rust);
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(43, 33, 28, 0.12);
}

.lb-tile h2 {
	font-family: 'Kaushan Script', cursive;
	font-weight: 400;
	font-size: 1.75rem;
	line-height: 1.15;
	color: var(--lb-rust);
	margin: 0 0 10px;
}

.lb-tile-epigraph {
	font-family: Georgia, 'Times New Roman', serif;
	font-style: italic;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--lb-ink-soft);
	margin: 0 0 12px !important;
	flex: 1;
}

.lb-tile-blurb {
	font-size: 0.9rem;
	line-height: 1.45;
	margin: 0 0 12px !important;
}

.lb-tile-count {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--lb-ink-soft);
}

.lb-results {
	margin-bottom: 24px;
}

.lb-results-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 12px;
}

.lb-results-head h2 {
	margin: 0;
	font-size: 1.2rem;
}

.lb-clear {
	color: var(--lb-rust);
	font-weight: 700;
	font-size: 0.9rem;
}

.lb-legend .lb-status {
	margin: 0 2px;
}

/* Topic list on the right */
.lb-hub-side {
	align-self: start;
	position: sticky;
	top: 150px;
}

.lb-topics ul {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	border-top: 1px solid var(--lb-line);
}

.lb-topics a {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 10px;
	color: var(--lb-ink);
	text-decoration: none;
	border-bottom: 1px solid #f1ebe2;
	font-size: 0.95rem;
}

.lb-topic-name {
	text-transform: capitalize;
}

.lb-topic-count {
	color: var(--lb-ink-soft);
	font-size: 0.85rem;
}

.lb-topics a:hover {
	background: var(--lb-bone);
	color: var(--lb-rust);
}

.lb-topics a.is-on {
	background: var(--lb-rust);
	color: #fff;
}

.lb-topics a.is-on .lb-topic-count {
	color: #f4d9cc;
}

/* ---------- phones and narrow windows ---------- */

@media (max-width: 900px) {
	#content.lb-layout {
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 16px 16px 32px;
	}

	.lb-aside,
	.lb-hub-side {
		position: static;
	}

	.lb-toc,
	.lb-topics {
		border: 1px solid var(--lb-line);
		padding: 2px 12px;
		margin-bottom: 8px;
	}

	.lb-topics ul {
		border-top: none;
	}

	.lb-page h1 {
		font-size: 1.7rem;
	}

	.lb-tile-page h1 {
		font-size: 2.2rem;
	}

	#content.lb-hub {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 16px 16px 28px;
	}

	.lb-hub-side {
		order: -1;
	}

	.lb-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.lb-band-inner {
		padding: 14px 16px;
	}

	.lb-band--hub .lb-band-inner {
		padding: 26px 16px 24px;
	}
}

@media (max-width: 560px) {
	.lb-tiles {
		grid-template-columns: 1fr;
	}

	.lb-pager {
		flex-direction: column;
	}

	.lb-pager a {
		max-width: none;
	}

	.lb-pager .lb-next {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lb-cards a,
	.lb-tile {
		transition: none;
	}

	.lb-cards a:hover,
	.lb-tile:hover {
		transform: none;
	}
}
