/* ═══════════════════════════════════════════════════════════
   SAFOS — Unified Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── 01  Fonts ─────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400..700;1,400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Jim+Nightshade&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Libre+Barcode+39+Extended&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Milonga&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Goudy+Bookletter+1911&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&display=swap');

@font-face {
	font-family: "3OF9";
	src: url('/fonts/3OF9_NEW.TTF') format('truetype');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: "Anglican";
	src: url('/fonts/AnglicanText.TTF') format('truetype');
	font-weight: normal;
	font-style: normal;
}

/* ── 02  Variables & Base ──────────────────────────────── */

:root {
	color: white;
	background-color: rgb(12, 6, 6);
	font-family: "Atkinson Hyperlegible Next", sans-serif;
	letter-spacing: .5px;
	font-size: 16px;
	font-weight: 400;
	overflow-y: auto;
	overflow-y: overlay;

	/* Theme colours */
	--accent: rgb(136, 10, 19);
	--accent-rgb: 183, 17, 29;
	--surface: rgb(46, 25, 26);
	--surface-overlay: #101010;

	/* Accent tints (opacity stops used ≥ 5×) */
	--a06: rgba(var(--accent-rgb), 0.06);
	--a25: rgba(var(--accent-rgb), 0.25);
	--a35: rgba(var(--accent-rgb), 0.35);
	--a40: rgba(var(--accent-rgb), 0.4);
	--a50: rgba(var(--accent-rgb), 0.5);

	/* Gold (infobox accents) */
	--gold: rgb(173, 143, 59);
	--gold-light: rgb(238, 219, 168);
	--gold-line: rgba(241, 213, 133, 0.6);
	--gold-bright: #f1d585;

	/* Subtle backgrounds */
	--glass: rgba(255, 255, 255, 0.03);

	/* Layout */
	--content-w: 96%;

	/* Typography */
	--font-display: "inknut Antiqua", serif;
}

::selection {
	background: rgba(255, 255, 255, 0.2);
	color: inherit;
}

/* ── 03  Scrollbar ─────────────────────────────────────── */

html {
	scroll-behavior: smooth;
	overflow-y: scroll;
	scrollbar-gutter: stable;
	scrollbar-color: var(--accent) transparent;
	background-color: rgb(19, 16, 16);
	background-image:
		linear-gradient(to bottom, rgba(50, 0, 0, 0.5) 0%, transparent 25%),
		linear-gradient(to top, rgba(50, 0, 0, 0.5) 0%, transparent 25%);
	background-attachment: fixed;
	background-size: 100% 100%, 100% 100%;
	cursor: url("/public/cursor.svg") 16 16, auto;
}

a, button, [role="button"], label, select, summary,
[tabindex]:not([tabindex="-1"]),
[onclick], .shard-card, .wiki-heading,
.wiki-table--sortable th {
	cursor: url("/public/cursor_hover.svg") 16 16, pointer;
}


body::after {
	content: '';
	position: fixed;
	inset: 0;
	background-image: url('/public/skulls.svg');
	background-size: 10%;
	background-attachment: fixed;
	pointer-events: none;
	z-index: -1;
	opacity: 0;
	transition: opacity 0.4s ease;
}

body.bg-ready::after {
	opacity: 1;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: var(--accent) transparent }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.6); }

/* ── 04  Keyframes ─────────────────────────────────────── */

@keyframes page-dissolve-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes random-spin {
	to { transform: rotate(-360deg); }
}

@keyframes site-nav-open {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes corruption-link-glitch {
	0%    { transform: translate(0); text-shadow: none; }
	4%    { transform: translate(-1px, 0); text-shadow: 2px 0 #ff0040, -2px 0 #00ffcc; }
	5%    { transform: translate(0); text-shadow: none; }
	30%   { transform: translate(0); text-shadow: none; }
	32%   { transform: translate(1px, 0); text-shadow: -1px 0 #ff0040, 1px 0 #00ffcc; }
	33%   { transform: translate(0); text-shadow: none; }
	60%   { transform: translate(0); text-shadow: none; }
	61%   { transform: translate(-1px, 0); text-shadow: 1px 0 #ff0040, -1px 0 #00ffcc; }
	62%   { transform: translate(0); text-shadow: none; }
	100%  { transform: translate(0); text-shadow: none; }
}

@keyframes corruption-static {
	0%    { background-position: 0 0; opacity: 0.04; }
	10%   { background-position: -5% 10%; opacity: 0.08; }
	20%   { background-position: 10% -5%; opacity: 0.04; }
	30%   { background-position: -10% 5%; opacity: 0.07; }
	40%   { background-position: 5% -10%; opacity: 0.03; }
	50%   { background-position: -5% -5%; opacity: 0.08; }
	60%   { background-position: 10% 10%; opacity: 0.04; }
	70%   { background-position: -10% -10%; opacity: 0.07; }
	80%   { background-position: 5% 5%; opacity: 0.05; }
	90%   { background-position: 0 -5%; opacity: 0.08; }
	100%  { background-position: 0 0; opacity: 0.04; }
}

@keyframes corruption-tear {
	0%    { clip-path: inset(0); transform: none; }
	3%    { clip-path: inset(12% 0 82% 0); transform: translateX(4px); }
	4%    { clip-path: inset(0); transform: none; }
	18%   { clip-path: inset(0); transform: none; }
	20%   { clip-path: inset(55% 0 25% 0); transform: translateX(-5px); }
	21%   { clip-path: inset(0); transform: none; }
	40%   { clip-path: inset(0); transform: none; }
	42%   { clip-path: inset(30% 0 60% 0); transform: translateX(3px); }
	43%   { clip-path: inset(0); transform: none; }
	65%   { clip-path: inset(0); transform: none; }
	66%   { clip-path: inset(70% 0 15% 0); transform: translateX(-3px); }
	67%   { clip-path: inset(0); transform: none; }
	85%   { clip-path: inset(0); transform: none; }
	87%   { clip-path: inset(8% 0 85% 0); transform: translateX(5px); }
	88%   { clip-path: inset(0); transform: none; }
	100%  { clip-path: inset(0); transform: none; }
}

@keyframes corruption-flicker {
	0%    { opacity: 1; }
	4%    { opacity: 0.99; }
	5%    { opacity: 0.95; }
	15%   { opacity: 1; }
	16%   { opacity: 0.96; }
	17%   { opacity: 0.99; }
	18%   { opacity: 1; }
	35%   { opacity: 1; }
	36%   { opacity: 0.99; }
	38%   { opacity: 1; }
	55%   { opacity: 1; }
	56%   { opacity: 0.9; }
	57%   { opacity: 0.99; }
	58%   { opacity: 1; }
	75%   { opacity: 0.95; }
	76%   { opacity: 0.998; }
	78%   { opacity: 1; }
	90%   { opacity: 1; }
	91%   { opacity: 0.95; }
	92%   { opacity: 1; }
	100%  { opacity: 0.99; }
}

@keyframes corruption-link {
	0%    { transform: translate(0); text-shadow: none; }
	4%    { transform: translate(-2px, 0); text-shadow: 3px 0 #ff0040, -3px 0 #00ffcc; }
	5%    { transform: translate(0); text-shadow: none; }
	25%   { transform: translate(0); text-shadow: none; }
	27%   { transform: translate(2px, 0); text-shadow: -2px 0 #ff0040, 2px 0 #00ffcc; }
	28%   { transform: translate(0); text-shadow: none; }
	55%   { transform: translate(0); text-shadow: none; }
	56%   { transform: translate(-1px, 0); text-shadow: 2px 0 #ff0040, -2px 0 #00ffcc; }
	57%   { transform: translate(0); text-shadow: none; }
	80%   { transform: translate(0); text-shadow: none; }
	82%   { transform: translate(1px, 0); text-shadow: -1px 0 #ff0040, 1px 0 #00ffcc; }
	83%   { transform: translate(0); text-shadow: none; }
	100%  { transform: translate(0); text-shadow: none; }
}

/* ── 05  Accessibility & Reduced Motion ────────────────── */

.skip-to-content {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10000;
	padding: 0.5rem 1rem;
	background: var(--accent);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.9rem;
}

.skip-to-content:focus { left: 0; }

.aotd-random-icon.is-spinning {
	animation: random-spin 0.4s cubic-bezier(0.1, 0, 0.2, 0.3) forwards;
}

@media (prefers-reduced-motion: reduce) {
	body { animation: none; }
	.aotd-random-icon.is-spinning { animation-duration: 0.01s; }
	.wiki-link--corruption { animation: none; }
}

/* ── 06  Layout ────────────────────────────────────────── */

body {
	width: min(80%, 800px);
	margin: 2.5rem auto;
	display: flex;
	flex-direction: column;
	text-align: center;
	border: 2px solid var(--accent);
	background-color: var(--surface);
	min-height: calc(100vh - 5rem);
	padding: 1rem;
	box-sizing: border-box;

}

.main-body {
	margin-top: 1.25rem;
	width: var(--content-w);
	margin-left: auto;
	margin-right: auto;
}

.database-page {
	width: var(--content-w);
	margin: 0.75rem auto 1.5rem;
	text-align: left;
}

.page-desc {
	margin: 0.5rem 0 1.25rem;
	max-width: 70ch;
	opacity: 0.7;
	font-weight: 400;
	font-size: 0.95rem;
}

@media (max-width: 1500px) {
	body {
		min-width: 100%;
		margin: 0;
		display: flex;
		flex-direction: column;
		text-align: center;
		border: 2px solid var(--accent);
		background-color: rgb(48, 22, 22);
		min-height: 100vh;
		padding: 1rem;
		box-sizing: border-box;
	}
}

/* ── 07  Header & Navigation ───────────────────────────── */

.site-header {
	min-height: 140px;
	padding: 20px 24px 0;
	display: flex;
	flex-direction: column;
	position: relative;
}

.site-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
}

.site-header-brand {
	position: absolute;
	left: 50%;
	top: 15%;
	transform: translateX(-50%);
	pointer-events: none;
}

.site-header-brand img { pointer-events: auto; }

.site-header-logo {
	display: block;
	width: 80px;
	height: auto;
}

.site-header-controls {
	position: absolute;
	top: 20px;
	right: calc(20px + min(250px, 44vw) + 16px);
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
}

#social-links {
	position: absolute;
	align-items: center;
	pointer-events: auto;
	margin-top: 5px;
	top: 50px;
	right: -265px;
}

#social-links img {
	display: inline;
	margin: 0 5px;
}

.site-nav-toggle {
	display: none;
	flex-direction: column-reverse;
	justify-content: center;
	gap: 5px;
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	padding: 6px 0;
}

.site-nav-toggle-bar {
	display: block;
	width: 24px;
	height: 2px;
	background: currentColor;
}

.site-nav {
	margin-top: auto;
	display: flex;
	justify-content: center;
	gap: 25px;
	flex-wrap: wrap;
}

.site-nav-link {
	color: inherit;
	text-decoration: none;
	padding-bottom: 12px;
	border-bottom: 2px solid transparent;
	font-weight: 500;
}

.site-nav-link:hover {
	border-bottom-color: var(--a50);
}

.site-nav-link.is-active {
	border-bottom-color: var(--accent);
}

.site-nav-sub-group { display: none; }
.site-nav-item--has-sub { display: contents; }
.site-nav-sub-toggle { display: none; }
.site-nav-sub-dropdown { display: none; }

/* Pages without subheader: compensate for missing subheader height */
.site-header + :not(.site-subheader) {
	margin-top: 2.5rem;
}

@media (max-width: 1500px) {
	.site-header {
		min-height: unset;
		padding: 12px 16px 0;
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"brand   brand"
			"search  controls"
			"nav     nav";
	}

	.site-header-top {
		grid-area: brand;
		display: flex;
		justify-content: center;
		position: static;
		padding-bottom: 6px;
	}

	.site-header-brand {
		position: static;
		top: auto;
		transform: none;
		pointer-events: auto;
		margin-top: 0px;
		margin-bottom: 3px;
	}

	.site-header-controls {
		grid-area: controls;
		position: static;
		width: auto;
		display: flex;
		align-items: center;
		gap: 10px;
		align-self: center;
		margin-left: 12px;
	}

	.site-nav-toggle {
		grid-area: unset;
		display: flex;
		align-self: center;
		margin-left: 0;
	}

	.site-nav {
		grid-area: nav;
		display: none;
		flex-direction: column;
		gap: 0;
		margin-top: 8px;
		overflow: hidden;
	}

	.site-nav.is-open {
		display: flex;
		animation: site-nav-open 0.25s ease;
	}

	.site-nav-link {
		padding: 12px 16px;
		border-bottom: 1px solid var(--a25);
		text-align: center;
	}

	.site-nav-link.is-active {
		border-bottom-color: var(--a25);
		background: var(--a50);
	}

	.site-nav-item--has-sub {
		display: flex;
		flex-direction: column;
		border-bottom: 1px solid var(--a25);
	}

	.site-nav-item--has-sub > .site-nav-link,
	.site-nav-item--has-sub > .site-nav-sub-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.site-nav-item--has-sub .site-nav-sub-row {
		display: flex;
		flex-direction: row;
		align-items: stretch;
		position: relative;
	}

	.site-nav-item--has-sub .site-nav-link {
		width: 100%;
		border-bottom: none;
		text-align: center;
	}

	.site-nav-sub-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 0;
		bottom: 0;
		right: 0;
		width: 44px;
		background: none;
		border: none;
		border-left: 1px solid var(--a25);
		color: inherit;
		cursor: pointer;
		font-size: 0.85em;
		opacity: 0.7;
	}

	.site-nav-sub-toggle:hover {
		opacity: 1;
		background: var(--a50);
	}

	.site-nav-sub-dropdown {
		display: flex;
		flex-direction: column;
		width: 100%;
		overflow: hidden;
		max-height: 0;
		transition: max-height 0.25s ease;
	}

	.site-nav-sub-dropdown.is-open {
		max-height: 300px;
	}

	.site-nav-sub-link {
		display: block;
		padding: 10px 16px 10px 32px;
		color: inherit;
		text-decoration: none;
		border-bottom: 1px solid var(--a25);
		opacity: 0.75;
		font-size: 0.9em;
	}

	.site-nav-sub-link:hover {
		background: var(--a50);
		opacity: 1;
	}

	.site-nav-sub-link.is-active {
		background: var(--accent);
		opacity: 1;
	}

	#social-links {
		display: inline;
		right: 10px;
		top: 0px;
	}
}

/* ── 08  Search ────────────────────────────────────────── */

.site-header-search {
	position: absolute;
	top: 20px;
	right: 20px;
	width: min(250px, 44vw);
}

.site-search-input {
	width: 100%;
	padding: 10px 12px;
	border: 2px solid var(--a50);
	background: rgba(0, 0, 0, 0.0);
	color: inherit;
	font: inherit;
	outline: none;
	box-sizing: border-box;
}

.site-search-input:focus { border-color: var(--accent); }

.site-search-input::-webkit-search-cancel-button {
	filter: invert(1);
	cursor: pointer;
	color: white;
}

.site-search-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	display: none;
	background: rgb(30, 16, 17);
	border: 1px solid rgba(var(--accent-rgb), 0.45);
	max-height: 360px;
	overflow-y: auto;
	z-index: 20;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.site-search-results.is-open { display: block; }

.site-search-result {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid var(--a25);
}

.site-search-result-title { font-weight: 500; }

.site-search-snippet {
	font-size: 0.82em;
	opacity: 0.7;
	line-height: 1.4;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}

.site-search-highlight {
	background: var(--a35);
	color: inherit;
	border-radius: 2px;
	padding: 0 1px;
}

.site-search-result:hover,
.site-search-result.is-focused {
	background: rgba(var(--accent-rgb), 0.12);
}

.site-search-empty {
	padding: 10px 12px;
	opacity: 0.6;
	font-weight: 400;
	font-size: 0.9em;
}

@media (max-width: 1500px) {
	.site-header-search {
		grid-area: search;
		position: static;
		width: 100%;
		align-self: center;
	}
}

/* ── 09  Subheader ─────────────────────────────────────── */

.site-subheader {
	padding: 8px 24px 0;
	display: flex;
	justify-content: center;
}

.sub-nav {
	display: flex;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
}

.sub-nav-link {
	color: inherit;
	text-decoration: none;
	padding-bottom: 10px;
	border-bottom: 2px solid transparent;
	font-weight: 500;
	opacity: 0.9;
}

.sub-nav-link:hover {
	border-bottom-color: var(--a50);
}

.sub-nav-link.is-active {
	border-bottom-color: var(--accent);
	opacity: 1;
}

@media (max-width: 1500px) {
	.site-subheader { display: none; }
}

/* ── 10  Footer ────────────────────────────────────────── */

.site-footer {
	width: var(--content-w);
	margin: auto auto 0.75rem;
	text-align: left;
	bottom: 0;
}

.site-footer-location {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	font-weight: 700;
	padding: 0.75rem 1rem;
	border: 1px solid var(--a50);
	background: var(--surface);
}

.site-footer-page-title {
	font-family: "3OF9", "Libre Barcode 39 Extended", monospace;
	line-height: 1;
	color: rgba(255, 255, 255, 1);
	letter-spacing: 0;
	white-space: nowrap;
	font-size: 20px;
	font-weight: 60;
	align-self: center;
	display: inline-flex;
	align-items: center;
	transform: scaleX(1.6);
	transform-origin: right center;
 	-webkit-user-select: none;
 	-ms-user-select: none;
  	user-select: none;
}

.site-footer-location a { color: inherit; text-decoration: none; }
.site-footer-location a:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent);
}

.site-footer-updated {
	text-align: right;
	margin-right: 0.25rem;
	margin-top: 0.45rem;
	opacity: 0.5;
	font-size: 0.7rem;
	border: none;
	background: transparent;
	padding: 0;
}

.site-footer-updated a { color: inherit; text-decoration: none; }
.site-footer-updated a:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent);
}

@media (max-width: 1500px) {
	.site-footer { width: 90%; margin: auto auto 0.75rem; }
}

@media (max-width: 700px) {
	.site-footer { margin-top: 1.5rem; }
	.site-footer-page-title { display: none; }
}

/* ── 11  Page Title & Headings ─────────────────────────── */

.page-title {
	margin: 0 0 0.5rem;
	font-size: 2rem;
	border-bottom: 2px solid var(--accent);
	padding-bottom: 0.4rem;
	text-align: left;
}



/* ── 12  Categories ────────────────────────────────────── */

.category-list-section { margin-bottom: 1.5em; }

.category-letter {
	font-size: 1.15em;
	font-weight: 600;
	margin: 1.2em 0 0.3em 0;
	color: #ffffff;
	text-align: left;
	padding-bottom: 0.15em;
}

.category-article-list {
	list-style: disc;
	margin: 0 0 0 1.2em;
	padding: 0;
	text-align: left;
}

.category-article-list li {
	margin: 0.15em 0;
	padding: 0;
	font-size: 17px;
	text-align: left;
}

.category-columns {
	columns: 3 14em;
	column-gap: 2.5em;
	column-fill: auto;
}

.category-columns .category-list-section { break-inside: avoid; }

.category-article-list a { color: #fff; text-decoration: none; }
.category-article-list a:hover { text-decoration: underline; }

/* Shared filter bar for listing pages */
.listing-filter {
	display: block;
	width: 100%;
	max-width: 480px;
	margin-bottom: 1.5rem;
	padding: 10px 12px;
	background: rgba(0, 0, 0, 0.0);
	color: inherit;
	border: 2px solid var(--a50);
	font: inherit;
	outline: none;
	box-sizing: border-box;
}
.listing-filter:focus { outline: none; border-color: var(--accent); }

/* Category-tree specific */
.category-tree-count { opacity: 0.5; font-size: 0.85em; margin-left: 0.3em; }

.categories-line {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 0.4em;
	margin: 1.5em auto .5em;
	width: var(--content-w);
	font-size: 17px;
	max-width: 90vw;
	text-align: left;
}

.category-link { color: white; font-weight: 400; text-decoration: none; }
.category-link:hover { text-decoration: underline; }

@media (max-width: 700px) {
	.category-columns { columns: 1; height: auto; }
	.categories-line { margin-left: auto; margin-right: auto; }
	.database-page { width: 92%; padding: 0 0.5rem; box-sizing: border-box; }
	.database-page .page-title { font-size: 1.4rem; }
	.category-article-list li { font-size: 15px; }
	.category-letter { font-size: 1rem; }
}

@media (max-width: 1500px) {
	.database-page { width: 90%; max-width: 100%; }
	.category-columns { column-gap: 1.5em; height: auto; }
}

/* ── 13  Article Layout ────────────────────────────────── */

.article {
	text-align: left;
	width: var(--content-w);
	margin: 0.75rem auto 1.5rem;
	box-sizing: border-box;
	position: relative;
}

.article .page-title { margin-bottom: 2rem; }

.article-tagline {
	margin: 0 0 1.25rem;
	opacity: 0.65;
	font-style: italic;
	font-size: 0.95rem;
}

.article-body {
	display: block;
	width: 100%;
}

.article-body::after {
	content: "";
	display: block;
	clear: both;
}

.article-content { min-width: 0; }

@media (max-width: 700px) {
	.article { padding: 1rem; }
	.article-body { display: block; }
}

/* ── 14  Infobox ───────────────────────────────────────── */

.infobox {
	float: right;
	border: 1px solid var(--a40);
	overflow: hidden;
	font-size: 14px;
	font-weight: 400;
	margin: 0 0 1.5rem 1.75rem;
	width: min(100%, 310px);
	background: var(--glass);
	cursor: text;
	position: relative;
	z-index: 1;
}

.infobox-title {
	font-family: var(--font-display);
	font-weight: 500;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	cursor: text;
	background-color: rgba(var(--accent-rgb), .25)
}

.infobox-sigil {
	position: absolute;
	top: 50%;
	right: 5px;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	object-fit: contain;
	opacity: 0.85;
	z-index: 1;
	cursor: pointer;
}


.infobox-title-inner {
	position: relative;
	text-align: center;
	padding: 0.5rem 0.5rem;
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: -0.02em;
	font-size: 20px;
	color: white;
	cursor: text;
}

.infobox-title-inner::before { top: 0; }
.infobox-title-inner::after { bottom: 0; }

.infobox-office {
	position: relative;
	padding: 0.7rem 0.65rem;
	margin: 0.35rem 0;
	text-align: center;
	font-family: var(--font-display);
	font-weight: 400;
}

.infobox-office::before,
.infobox-office::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(to right, transparent, var(--gold-line), transparent);
}

.infobox-office::before { top: 0; }
.infobox-office::after { bottom: 0; }

.infobox-office-label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.78;
	margin-bottom: 0.18rem;
}

.infobox-office-value {
	font-size: 0.96rem;
	font-weight: 700;
	color: var(--gold-bright);
}

/* Royal fields under office */
.infobox-label {
	font-weight: 700;
	font-size: 0.82rem;
	opacity: 0.78;
}

.infobox-reign,
.infobox-coronation {
	padding: 0.3rem 0.65rem;
	font-size: 0.82rem;
	line-height: 1.45;
}

/* Predecessor / Successor nav (arrows like book infobox) */
.infobox-succession {
	display: flex;
	justify-content: space-between;
	padding: 0.45rem 0.65rem;
	font-size: 0.78rem;
	border-top: 1px solid rgba(var(--accent-rgb), 0.25);
}

.infobox-succession-item {
	flex: 1;
	text-align: center;
}

.infobox-succession-item .infobox-label {
	display: block;
	font-size: 0.68rem;
	font-weight: 400;
	opacity: 0.6;
	margin-bottom: 0.1rem;
}

.infobox-image {
	width: 100%;
	height: auto;
	display: block;
	background: rgba(255, 255, 255, 1);
	cursor: pointer;
}

.infobox-image-placeholder {
	width: 100%;
	height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.25);
	opacity: 0.4;
	font-size: 0.8rem;
}

.infobox table { width: 100%; border-collapse: collapse; }

.infobox th,
.infobox td {
	padding: 0.35rem 0.65rem;
	vertical-align: top;
	cursor: text;
}

.infobox th {
	font-weight: 700;
	white-space: nowrap;
	width: 42%;
	text-align: left;
}

.infobox td {
	font-weight: 400;
	opacity: 1;
	line-height: 1.45;
}

.infobox th.infobox-divider {
	position: relative;
	letter-spacing: 0.04em;
	padding: 0.5rem 0.65rem;
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 16px;
	color: white;
	background-color: rgba(var(--accent-rgb), .15);
	text-align: center;
	white-space: normal;
	border-top: none;
}

.infobox th.infobox-divider::before { top: 0; }
.infobox th.infobox-divider::after { bottom: 0; }

/* ── Infobox Tabs ──────────────────────────────────────── */
.infobox-tabs { width: 100%; }

.infobox-tab-bar {
	display: flex;
	border-bottom: 2px solid rgba(var(--accent-rgb), 0.3);
}

.infobox-tab-btn {
	flex: 1;
	padding: 0.45rem 0.5rem;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	color: inherit;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	opacity: 0.6;
	cursor: pointer;
	transition: opacity 0.15s, border-color 0.15s;
}

.infobox-tab-btn:hover { opacity: 0.85; }

.infobox-tab-btn.is-active {
	opacity: 1;
	border-bottom-color: var(--accent);
	color: var(--accent);
}

.infobox-tab-panel[hidden] { display: none; }

.infobox-native-name {
	font-weight: 400;
	text-align: center;
	cursor: text;
}

.infobox-romanised-name {
	font-weight: 400;
	text-align: center;
	cursor: text;
	margin-bottom: 7px;
}
.infobox-romanised-name::after {
	content: '';
	display: block;
	height: 1px;
	margin-top: 4px;
	background: rgba(var(--accent-rgb), .25)
}

@media (max-width: 700px) {
	.infobox {
		float: none;
		width: 100%;
		margin: 0 auto 1.25rem;
	}
}

/* ── 15  Infobox Tabs ──────────────────────────────────── */

.infobox-tabs {
	display: flex;
	border-bottom: 1px solid rgba(var(--accent-rgb), 0.3);
}

.infobox-tab {
	flex: 1;
	padding: 0.45rem 0.5rem;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	color: inherit;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	opacity: 0.5;
	transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}

.infobox-tab:hover {
	opacity: 0.8;
	background: var(--a06);
}

.infobox-tab.is-active {
	opacity: 1;
	border-bottom-color: var(--accent);
	background: rgba(var(--accent-rgb), 0.1);
}

.infobox-tab:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

.infobox-tab-panel { display: none; }
.infobox-tab-panel.is-active { display: block; }

/* ── Infobox: type label (settlement type, geographic feature type) */
.infobox-type-label {
	text-align: center;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	opacity: 0.6;
	padding: 0.4rem 0.5rem 0;
}

/* ── Infobox: flag + crest / seal side by side */
.infobox-flag-pair {
	display: flex;
	gap: 14px;
	justify-content: center;
	align-items: flex-end;
	padding: 0px 7px 7px;
}

.infobox-flag-pair .infobox-flag,
.infobox-flag-pair .infobox-crest {
	flex: 1;
	max-width: calc(50% - 14px);
	height: auto;
	object-fit: contain;
}
.infobox-flag-pair::after {
	border: 5px solid black;
}

/* ── Infobox: single full-width flag or crest */
.infobox-flag--full,
.infobox-crest--full {
	display: block;
	width: calc(100% - 14px);
	height: auto;
	margin: 8px 7px 4px;
	object-fit: contain;
}

/* ── Infobox: location / area map */
.infobox-map {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* ── Infobox: motto / words / nickname / tagline block */
.infobox-motto {
	text-align: center;
	font-style: italic;
	font-size: 0.82rem;
	padding: 0.5rem 1rem;
}

/* ── Infobox: anthem line */
.infobox-anthem {
	text-align: center;
	font-size: 0.78rem;
	padding: 0.35rem 1rem;
}

/* ── Infobox: royal style block */
.infobox-royal-style {
	text-align: center;
	padding: 0.5rem 0.85rem;
	border-top: 1px solid rgba(var(--accent-rgb), 0.25);
	border-bottom: 1px solid rgba(var(--accent-rgb), 0.25);
}

.infobox-royal-style-label {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	opacity: 0.6;
	margin-bottom: 0.15rem;
}

.infobox-royal-style-value {
	font-style: italic;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--gold-bright, #f1d585);
}

/* ── Infobox: book series navigation */
.infobox-book-nav {
	display: flex;
	justify-content: space-between;
	padding: 0.45rem 0.65rem;
	font-size: 0.78rem;
	border-top: 1px solid rgba(var(--accent-rgb), 0.25);
}

.infobox-book-nav-item {
	flex: 1;
	text-align: center;
}

.infobox-book-nav-item .infobox-label {
	display: block;
	font-size: 0.68rem;
	opacity: 0.6;
	margin-bottom: 0.1rem;
}

/* ── Infobox: small symbol (religion, faction, military insignia) */
.infobox-symbol {
	display: block;
	width: 72px;
	height: 72px;
	margin: 8px auto 4px;
	object-fit: contain;
}

/* ── Infobox: language sample-text block */
.infobox-sample-text {
	font-style: italic;
	text-align: center;
	font-size: 1.05rem;
	padding: 0.6rem 1rem;
	border-top: 1px solid var(--a40, rgba(255,255,255,0.15));
	border-bottom: 1px solid var(--a40, rgba(255,255,255,0.15));
	letter-spacing: 0.03em;
}

/* ── Infobox: conflict belligerents two-column table */
.infobox-belligerents {
	width: 100%;
	border-collapse: collapse;
	border-top: 1px solid rgba(var(--accent-rgb), 0.25);
}

.infobox-belligerents thead th {
	font-weight: 700;
	text-align: center;
	padding: 0.45rem 0.5rem;
	width: 50%;
	border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
}

.infobox-belligerents tbody td {
	text-align: center;
	padding: 0.35rem 0.5rem;
	width: 50%;
	vertical-align: top;
}

.infobox-belligerents thead th:first-child,
.infobox-belligerents tbody td:first-child {
	border-right: 1px solid rgba(var(--accent-rgb), 0.2);
}

/* ── Infobox: extinct dagger (species) */
.infobox-extinct {
	font-size: 0.85em;
	opacity: 0.75;
	margin-left: 0.2em;
}

/* ── 16  TOC ───────────────────────────────────────────── */

.toc {
	display: inline-block;
	min-width: 180px;
	max-width: 280px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--a25);
	padding: 0.75rem 1rem;
	margin: 0 0 1.5rem;
	font-size: 0.88rem;
}

.toc-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 700;
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	opacity: 0.8;
}

.toc-toggle {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 400;
	opacity: 0.7;
	padding: 0 0 0 0.5rem;
	white-space: nowrap;
}

.toc-toggle:hover { opacity: 1; }

.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: 0.2rem 0; }
.toc-item--level-3 { margin-left: 0.4rem; }
.toc-item--level-4,
.toc-item--level-5,
.toc-item--level-6 { margin-left: 0.8rem; }

.toc a { color: inherit; text-decoration: none; opacity: 0.8; }
.toc a:hover {
	opacity: 1;
	text-decoration: underline;
	text-decoration-color: var(--accent);
}

@media (max-width: 700px) {
	.toc { display: none; }
}

/* ── 17  Wiki Sections & Headings ──────────────────────── */

.section { margin-top: 1.75rem; }

.section-header {
	display: flow-root;
	font-size: 1.25rem;
	margin: 0 0 0.5rem;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid rgba(var(--accent-rgb), 0.3);
	scroll-margin-top: 80px;
}

.wiki-heading {
	display: flow-root;
	margin: 1.75rem 0 0.65rem;
	padding-bottom: 0.28rem;
	border-bottom: 1px solid rgba(var(--accent-rgb), 0.32);
	line-height: 1.25;
	scroll-margin-top: 80px;
	max-width: 100%;
	clear: none;
	text-align: left;
}

.wiki-heading--level-2 { font-size: 1.4rem; }
.wiki-heading--level-3 { font-size: 1.2rem; }
.wiki-heading--level-4 { font-size: 1.05rem; }
.wiki-heading--level-5, 
.wiki-heading--level-6 { font-size: 0.95rem; }

.section p {
	margin: 0.5rem 0;
	line-height: 1.7;
	opacity: 0.9;
	font-weight: 400;
}

.article-content > p {
	margin: 0.5rem 0;
	line-height: 1.7;
	opacity: 0.9;
	font-size: 16px;
	font-weight: 200;
}

.wiki-section-toggle {
	float: right;
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	padding: 0 0 0 0.5rem;
	opacity: 0.65;
	line-height: 1.6;
	display: none;
}

.wiki-section-toggle:hover { opacity: 1; }

.wiki-section-toggle-arrow {
	width: 0.85em;
	height: 0.85em;
	vertical-align: middle;
	transition: transform 0.25s ease;
	filter: invert(1);
}

@media (max-width: 700px) {
	.wiki-heading { cursor: pointer; }
	.wiki-section-toggle { display: inline; }
}

/* ── 18  Wiki Content ──────────────────────────────────── */

/* Lists */
.wiki-list {
	margin: 0.5rem 0 0.5rem 1.5rem;
	padding: 0;
	font-weight: 400;
	line-height: 1.7;
	opacity: 0.9;
}

.wiki-list--ul { list-style: disc; }
.wiki-list--ol { list-style: decimal; }
.wiki-list .wiki-list { margin-top: 0.15rem; margin-bottom: 0.15rem; }
.infobox td .wiki-list { margin-top: -5px; margin-bottom: 0; }

/* Definition list */
.wiki-dl { margin: 0.5rem 0; font-weight: 400; line-height: 1.7; opacity: 0.9; }
.wiki-dl dt { font-weight: 700; margin-top: 0.4rem; }
.wiki-dl dd { margin: 0 0 0 2rem; }

/* Horizontal rule */
.wiki-hr {
	border: none;
	border-top: 1px solid var(--a35);
	margin: 1.5rem 0;
}

/* Indented paragraph */
.wiki-indent { margin-left: 2rem; font-weight: 400; opacity: 0.9; }

/* Poem */
.wiki-poem {
	font-style: italic;
	font-weight: 400;
	line-height: 1.85;
	opacity: 0.9;
	margin: 0.75rem 0 0.75rem 1.5rem;
	border-left: 2px solid var(--a35);
	padding-left: 1rem;
}

.wiki-poem--bilingual {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	border-left: none;
	padding-left: 0;
	margin-left: 0;
}

.wiki-poem-col {
	border-left: 2px solid var(--a35);
	padding-left: 1rem;
}

@media (max-width: 700px) {
	.wiki-poem--bilingual { grid-template-columns: 1fr; }
}

/* Blockquote */
.wiki-blockquote {
	margin: 0.75rem 0 0.75rem 1.5rem;
	padding: 0.6rem 1rem;
	border-left: 3px solid var(--a50);
	background: var(--a06);
	font-style: italic;
	font-weight: 400;
	opacity: 0.9;
	line-height: 1.7;
}

/* Tables */
.wiki-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
	font-size: 0.92rem;
	font-weight: 400;
}

.wiki-table th,
.wiki-table td {
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--a25);
	text-align: left;
	vertical-align: top;
	line-height: 1.5;
}

.wiki-table th {
	background: rgba(var(--accent-rgb), 0.18);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.wiki-table tr:nth-child(even) td {
	background: rgba(var(--accent-rgb), 0.05);
}

.wiki-table caption {
	caption-side: bottom;
	font-size: 0.8rem;
	font-style: italic;
	opacity: 0.65;
	padding-top: 0.4rem;
	text-align: center;
}

.wiki-table--sortable th { cursor: pointer; user-select: none; }
.wiki-table--sortable th:hover {
	background: rgba(var(--accent-rgb), 0.28);
}

/* Footnotes / References */
.wiki-ref-marker { font-size: 12px; vertical-align: super; line-height: 1; }

.wiki-ref-marker a,
.wiki-reference-backlink { color: white; text-decoration: none; }

.wiki-ref-marker a:hover,
.wiki-reference-backlink:hover { text-decoration: underline; }

/* Bottom fallback list — visible only on narrow screens */
.wiki-references { margin-top: 1.5rem; font-size: 0.88rem; }
.wiki-references-list { margin: 0.5rem 0 0 1.5rem; padding: 0; }
.wiki-reference { margin: 0.25rem 0; line-height: 1.5; }

/* ── Sidenotes column ───────────────────────────────────── */
/* sidenotes are absolutely positioned to the right of the article box,
   in the viewport margin outside the body — .article already has position:relative */

.wiki-sidenotes-column {
	position: absolute;
	left: 110%;
	top: 0;
	width: 210px;
	/* children are absolutely positioned by JS to align with their sups */
}

.wiki-sidenote {
	font-size: 12px;
	line-height: 1.55;
	border-left: 2px solid var(--accent);
	border-top: 1px solid rgba(0,0,0,0);
	border-bottom: 1px solid rgba(0,0,0,0);
	border-right: 1px solid rgba(0,0,0,0);
	padding: 0.35em 0.65em;
	color: white;
}

.wiki-sidenote.is-highlighted {
	border-left: 2px solid white;
	border-top: 1px solid white;
	border-bottom: 1px solid white;
	border-right: 1px solid white;
	opacity: 1;
}

.wiki-sidenote-num {
	font-weight: 700;
	color: var(--accent);
	margin-right: 0.3em;
	font-size: 12px;
	vertical-align: super;
	line-height: 1;
}

/*handwritten marginnotes */
.wiki-marginnote {
	font-family: "caveat", cursive;
	font-size: 26px;
	color: white;
	font-weight: 600;
	padding: 0.4em 0.65em;
	transform: rotate(-12deg);
	transition: background 0.15s;
 	-webkit-user-select: none;
 	-ms-user-select: none;
  	user-select: none;
}

.wiki-marginnote.is-highlighted {
	background: rgba(120, 90, 15, 0.38);
}

/* Narrow screens: sidenotes column shifts inline below article */
@media (max-width: 900px) {
	.wiki-sidenotes-column {
		position: static;
		height: auto !important;
		width: 100%;
		display: flex;
		flex-direction: column;
		gap: 0.6rem;
		border-top: 1px solid var(--a40);
		margin-top: 1.5rem;
		padding-top: 1rem;
	}
	.wiki-sidenote,
	.wiki-marginnote {
		position: static !important;
		top: auto !important;
	}
}

/* ── 19  Wiki Figures & Images ─────────────────────────── */

.article-image { max-width: 100%; height: auto; display: block; }
.article-figure { display: block; margin: 1.25rem 0; }

.wiki-figure {
	display: block;
	margin: 0.35rem 0 1rem 0;
	max-width: 100%;
	clear: none;
}

.wiki-figure .article-image { display: block; max-width: 100%; height: auto; }
.wiki-figure-inner { display: block; }

.wiki-figure--thumb .wiki-figure-inner,
.wiki-figure--frame .wiki-figure-inner {
	border: 1px solid var(--a40);
	padding: 10px 10px 5px 10px;
	width: max-content;
	max-width: 100%;
}

.wiki-figure--right { float: right; clear: right; margin: 0.35rem 0 1rem 1.5rem; }
.wiki-figure--left { float: left; clear: left; margin: 0.35rem 1.5rem 1rem 0; }
.wiki-figure--center { float: none; clear: both; width: fit-content; margin: 1rem auto; }
.wiki-figure--none { float: none; clear: none; margin: 0.35rem 0; }
.wiki-figure--block { display: block; margin: 1.25rem 0; }
.wiki-figure--border .article-image { border: 1px solid var(--a40); }

.wiki-figure figcaption {
	display: block;
	font-size: 0.78rem;
	font-weight: 400;
	color: white;
	opacity: 0.85;
	text-align: center;
	padding: 0.28rem 0.4rem 0.35rem;
	line-height: 1.4;
}

@media (max-width: 700px) {
	.wiki-figure--right,
	.wiki-figure--left {
		float: none;
		clear: both;
		margin: 1rem auto;
	}

	.wiki-figure--thumb .wiki-figure-inner,
	.wiki-figure--frame .wiki-figure-inner {
		width: 100%;
		background: none;
		padding: 0;
		border: none;
	}

	.wiki-figure .article-image {
		width: auto !important;
		height: auto !important;
		max-width: 60%;
		display: block;
		margin: 0 auto;
	}

	.wiki-figure {
		margin: 0.75rem auto;
		text-align: center;
	}

	.wiki-figure--border .article-image { border: none; }
}

/* ── 20  Gallery Lightbox ──────────────────────────────── */

.gallery-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.88);
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.gallery-lightbox-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	max-width: 100vw;
}

.gallery-lightbox.is-open { display: flex; }

.gallery-lightbox-img {
	max-width: min(82vw, 900px);
	max-height: 78vh;
	object-fit: contain;
	display: block;
	box-shadow: 0 4px 40px rgba(0, 0, 0, 0.7);
	min-width: 0;
}

.gallery-lightbox-caption {
	margin-top: 0.75rem;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.8);
	text-align: center;
	max-width: min(92vw, 900px);
	font-style: italic;
	min-height: 1.2em;
}

.gallery-lightbox-counter {
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.45);
	margin-top: 0.35rem;
	letter-spacing: 0.05em;
}

.gallery-lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	background: none;
	border: none;
	color: rgba(255, 255, 255,1);
	font-size: 3rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	transition: color 0.15s ease;
}

.gallery-lightbox-close:hover { color: white; }

.gallery-lightbox-prev,
.gallery-lightbox-next {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.7);
	font-size: 2.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.5rem;
	transition: color 0.15s ease;
	flex-shrink: 0;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
	color: white;
}

.gallery-lightbox.is-single .gallery-lightbox-prev,
.gallery-lightbox.is-single .gallery-lightbox-next { display: none; }

.wiki-figure--gallery .article-image { cursor: pointer; }

.gallery-lightbox-thumbs {
	display: flex;
	gap: 0.4rem;
	margin-top: 0.75rem;
	max-width: min(92vw, 900px);
	overflow-x: auto;
	padding-bottom: 0.25rem;
}

.gallery-lightbox-thumb {
	width: 52px;
	height: 40px;
	object-fit: cover;
	opacity: 0.5;
	cursor: pointer;
	border: 2px solid transparent;
	flex-shrink: 0;
	transition: opacity 0.15s ease;
}

.gallery-lightbox-thumb:hover { opacity: 0.8; }

.gallery-lightbox-thumb.is-active {
	opacity: 1;
	border-color: rgba(241, 213, 133, 0.8);
}

/* ── 21  Wiki Links ────────────────────────────────────── */

.wiki-link {
	color: inherit;
	text-decoration: none;
	padding: 1px 1px;

	border-radius: 3px;
	transition: filter 0.15s ease;
	display: inline;
	line-height: inherit;
	vertical-align: baseline;
	font-weight: inherit;
}

.wiki-link-icon {
	width: 13px;
	height: 13px;
	vertical-align: -1px;
	margin-right: 2px;
	display: inline-block;
}

.wiki-link:hover {
	filter: brightness(1.3);
	text-decoration: underline;
}

.wiki-link--dead {
	color: #cc3333;
	padding: 1px 1px;
	border-radius: 3px;
	background-color: rgba(204, 51, 51, 0.08);
	font-weight: 400;
}

.wiki-link--dead:hover { filter: brightness(1.3); }

.wiki-link--corruption {
	display: inline-block;
	animation: corruption-link-glitch 4s infinite;
}

.wiki-link--corruption:hover {
	text-shadow: -1px 0 #ff0040, 1px 0 #00ffcc;
	filter: brightness(1.4);
}

/* ── 22  Link Preview ──────────────────────────────────── */

.link-preview {
	position: fixed;
	z-index: 900;
	width: 220px;
	background: var(--glass);
	border: 1px solid var(--a40);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	font-size: 0.82rem;
	line-height: 1.5;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 6px;
	gap: 6px;
}

.link-preview.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.link-preview--corruption {
	animation: corruption-link-glitch 2s infinite;
	border-color: rgba(0, 0, 0, 0.4);
	background-color: rgba(0, 0, 0, 0.4);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 8px rgba(0, 0, 0, 0.15);
}

.link-preview-image {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
	flex-shrink: 0;
}

.link-preview-body { padding: 0; }
.link-preview-title { display: none; }

.link-preview-text {
	opacity: 0.82;
	font-weight: 400;
	display: -webkit-box;
	-webkit-line-clamp: 8;
	line-clamp: 8;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── 23  Backlinks ─────────────────────────────────────── */

.wiki-backlinks {
	width: var(--content-w);
	margin: 1.5rem auto 0.5rem;
	text-align: left;
}

.wiki-backlinks-heading {
	font-size: 1.15em;
	font-weight: 600;
	margin: 0 0 0.5em;
	padding-bottom: 0.2em;
	border-bottom: 1px solid var(--a25);
}

.wiki-backlinks-list { list-style: disc; margin: 0 0 0 1.2em; padding: 0; }
.wiki-backlinks-list li { margin: 0.25em 0; font-size: 0.92rem; }
.wiki-backlinks-link { color: white; text-decoration: none; font-weight: 400; }
.wiki-backlinks-link:hover { text-decoration: underline; }

/* ── 24  MC Showcase & Cards ───────────────────────────── */

.mc-showcase {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0;
	margin: 0 auto 1.8rem;
	max-width: 100%;
	padding: 1.5rem 2rem;
}

@keyframes border-select {
	0%   { box-shadow: inset 0 7px 0 0 #fff, inset 5px 0 0 0 #fff, inset 0 -2px 0 0 #fff, inset 5px 0 0 0 #fff; outline-width: 4px; outline-offset: 0px; }
	25%  { box-shadow: inset 0 3px 0 0 #fff, inset -7px 0 0 0 #fff, inset 0 -5px 0 0 #fff, inset 2px 0 0 0 #fff; outline-width: 7px; outline-offset: 0px; }
	50%  { box-shadow: inset 0 5px 0 0 #fff, inset 6px 0 0 0 #fff, inset 0 -7px 0 0 #fff, inset 4px 0 0 0 #fff; outline-width: 5px; outline-offset: 0px; }
	75%  { box-shadow: inset 0 2px 0 0 #fff, inset -5px 0 0 0 #fff, inset 0 -3px 0 0 #fff, inset 7px 0 0 0 #fff; outline-width: 3px; outline-offset: 0px; }
	100% { box-shadow: inset 0 7px 0 0 #fff, inset -3px 0 0 0 #fff, inset 0 -2px 0 0 #fff, inset 5px 0 0 0 #fff; outline-width: 7px; outline-offset: 0px; }
}


.mc-card {
	position: relative;
	flex: 0 0 calc(25% - 6px);
	min-width: 0;
	height: 250px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	overflow: hidden;
	transform: skewX(-10deg);
	border: 2px solid var(--accent);
	text-decoration: none;
	color: #fff;
	margin: 0 3px;
	transition: all 0.25s cubic-bezier(0.8,0.5,0.2,1.4)
}

.mc-card.mc-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	transition: background 0.3s;
	z-index: 1;
	pointer-events: none;
}


.mc-card:hover {
	transform: skewX(-10deg) scale(1.15) rotate(-2deg);
	z-index: 10;
	border-color: #fff;
	outline: 4px solid #fff;
	animation: border-select 0.25s steps(4) infinite;	
	text-shadow: 25px rgba(255, 255, 255, 1);
}

.mc-card:hover::before {
	background: rgba(0, 0, 0, 0);
}

.mc-card:hover::after {
	opacity: 1;
}

.mc-card:hover .mc-card-name { color: var(--accent); }

.mc-showcase--small { justify-content: flex-start; }
.mc-showcase--small .mc-card {
	flex: 0 0 calc(100% / 8 - 6px);
	min-width: 0;
}

.mc-card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	transform: skewX(10deg) scale(1.55);
	pointer-events: none;
}

.mc-card-name {
	position: relative;
	z-index: 2;
	width: 100%;
	text-align: center;
	padding: 0.5rem 0.25rem;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	transform: skewX(6deg);
}
.mc-card--empty:hover::before { background: rgba(0, 0, 0, 0.55); }

@media (max-width: 700px) {
	.mc-showcase { flex-wrap: wrap; gap: 6px; padding: 0.5rem 1rem; }
	.mc-card { flex: 0 0 calc(25% - 6px); height: 180px; margin: 0; }
}

@media (max-width: 480px) {
	.mc-card { flex: 0 0 calc(25% - 6px); height: 140px; }
	.mc-card-name { font-size: 0.68rem; }
}

/* ── 25  AOTD ──────────────────────────────────────────── */

.aotd-wrapper {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
	margin: 0 auto 1.5rem;
	width: 100%;
	height: 200px;
}

.aotd-random-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.9rem 0.75rem;
	border: 1px solid var(--a35);
	background: var(--a06);
	color: white;
	text-decoration: none;
	font-size: 0.75rem;
	text-align: center;
	line-height: 1.3;
	min-width: 72px;
	flex-shrink: 0;
	overflow: hidden;
	transition: background 0.15s, border-color 0.15s;
}

.aotd-random-btn:hover {
	background: rgba(var(--accent-rgb), 0.14);
	border-color: rgba(var(--accent-rgb), 0.62);
}

.aotd-random-icon { font-size: 1.6rem; line-height: 1; }

.aotd-recent-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1rem;
	border: 1px solid var(--a35);
	background: var(--a06);
	color: white;
	text-decoration: none;
	min-width: 140px;
	flex-shrink: 0;
	overflow: hidden;
	transition: background 0.15s, border-color 0.15s;
}

.aotd-recent-btn:hover {
	background: rgba(var(--accent-rgb), 0.14);
	border-color: rgba(var(--accent-rgb), 0.62);
}

.aotd-recent-label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.55;
	margin-bottom: 0.5rem;
}

.aotd-recent-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.82rem;
	line-height: 1.6;
	font-weight: 400;
}

.aotd-recent-list li {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aotd {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 0;
	text-align: left;
	padding: 0;
	border: 1px solid var(--a35);
	color: #ffffff;
	text-decoration: none;
	background: var(--a06);
	flex: 1;
	min-width: 0;
	overflow: hidden;
	transition: background 0.15s, border-color 0.15s;
}

.aotd:hover {
	background: rgba(var(--accent-rgb), 0.13);
	border-color: rgba(var(--accent-rgb), 0.62);
}

.aotd-image {
	display: block;
	width: 200px;
	height: 200px;
	object-fit: contain;
	object-position: center;
	margin: .6rem .25rem .6rem .6rem;
	align-self: center;
	flex-shrink: 0;
}

.aotd-body {
	padding: 0.85rem 1rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex: 1;
	min-width: 0;
}

.aotd-label {
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.55;
}

.aotd-title {
	display: block;
	font-size: 1.25rem;
	font-weight: 700;
	margin-bottom: 0.4rem;
}

.aotd-desc {
	margin: 0;
	opacity: 0.78;
	font-weight: 400;
	font-size: 0.9rem;
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 700px) {
	.aotd-wrapper { flex-direction: column; height: auto; }
	.aotd-random-btn {
		flex-direction: row;
		justify-content: center;
		min-width: unset;
		padding: 0.6rem 1rem;
	}
	.aotd-recent-btn { min-width: unset; }
}

/* ── 26  Recent Changes ────────────────────────────────── */

.recent-changes-list { list-style: none; margin: 1rem 0 0; padding: 0; }

.recent-changes-item {
	display: flex;
	align-items: baseline;
	gap: 0.8rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
}

.recent-changes-date {
	flex-shrink: 0;
	font-size: 0.82rem;
	opacity: 0.5;
	font-variant-numeric: tabular-nums;
	min-width: 8.5em;
}

.recent-changes-link { color: white; text-decoration: none; font-weight: 400; }
.recent-changes-link:hover { text-decoration: underline; }

.recent-changes-time {
	opacity: 0.55;
	font-size: 0.85em;
	font-weight: 400;
}

/* ── 27  Article Count Ticker ──────────────────────────── */

.article-count-ticker {
	display: inline-block;
	font-size: 0.92rem;
	opacity: 0.65;
	font-weight: 400;
	margin-bottom: 0.75rem;
}

/* ── 28  Database Grid & Tiles ─────────────────────────── */

.database-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	grid-auto-rows: 70px;
	gap: 4px;
	max-width: 820px;
	margin: 0 auto;
}

.db-tile {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: #fff;
	overflow: hidden;
	text-align: center;
	background-size: cover;
	background-position: center;
	background-color: rgba(var(--accent-rgb), 0.12);
	border: 2px solid var(--accent);
	transition: all 0.25s cubic-bezier(0.8,0.5,0.2,1.4)
}

.db-tile::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	transition: background 0.3s;
	z-index: 1;
	pointer-events: none;
}

.db-tile:hover {
	transform: scale(1.06) rotate(-1deg);
	z-index: 10;
	border-color: #fff;
	outline: 4px solid #fff;
	animation: border-select 0.25s steps(4) infinite;
}

.db-tile:hover::before {
	background: rgba(0, 0, 0, 0);
}

.db-tile:hover .db-tile-label { color: var(--accent); }

.db-tile-label {
	position: relative;
	z-index: 1;
	padding: 0.7rem 0.9rem;
	font-size: 24px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

@media (max-width: 700px) {
	.database-grid { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 65px; }
	.db-tile { grid-column: span 3; grid-row: span 2; }
	.db-tile.db-tile--hero { grid-column: span 6; grid-row: span 2; }
}

@media (max-width: 480px) {
	.database-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 60px; }
	.db-tile { grid-column: span 1; grid-row: span 2; }
	.db-tile.db-tile--hero { grid-column: span 2; grid-row: span 2; }
	.db-tile-label { font-size: 0.88rem; padding: 0.45rem 0.55rem; }
}

/* ── 29  Timeline ──────────────────────────────────────── */

/* Tab bar / toggle buttons (shared component) */
.tab-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.tab-btn {
	appearance: none;
	padding: 0.4rem 0.9rem;
	font-size: 0.85rem;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
	white-space: nowrap;
}

.tab-btn:hover {
	background: rgba(var(--accent-rgb), 0.12);
	color: rgba(255, 255, 255, 0.85);
	border-color: var(--a35);
}

.tab-btn.active {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	font-weight: 600;
}

.tab-group-sep {
	width: 1px;
	align-self: stretch;
	background: rgba(255, 255, 255, 0.18);
	margin: 0 0.25rem;
	list-style: none;
}

.tab-row-break {
	flex-basis: 100%;
	height: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tl-panel { display: none; }
.tl-panel.active { display: block; }

.tl-period { margin: 0; }

.tl-period-title {
	font-size: 1.4rem;
	font-weight: 700;
	margin: 0 0 1.25rem;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid var(--a35);
}

.tl-entries {
	position: relative;
	padding-left: 2.5rem;
	margin-left: 0.5rem;
}

.tl-entries::before {
	content: '';
	position: absolute;
	left: 7px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--a35);
}

.tl-year-group {
	position: relative;
	padding: 0 0 1.75rem;
}

.tl-year-group:last-child { padding-bottom: 0.5rem; }

.tl-year-group::before {
	content: '';
	position: absolute;
	left: -2.5rem;
	top: 0.35rem;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--accent);
	border: 2px solid var(--surface);
	box-shadow: 0 0 0 2px var(--a40);
	z-index: 1;
}

.tl-year-label {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 0.35rem;
	color: rgba(255, 255, 255, 0.9);
}

.tl-event-list { list-style: none; margin: 0; padding: 0; }

.tl-event-list li {
	margin: 0.2rem 0;
	font-weight: 400;
	opacity: 0.85;
	line-height: 1.55;
	font-size: 0.95rem;
}

.tl-event-list a { color: inherit; text-decoration: none; }
.tl-event-list a:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent);
}

@media (max-width: 700px) {
	.tl-entries { padding-left: 2rem; }
	.tl-year-group::before { left: -2rem; }
	.tab-btn { font-size: 0.78rem; padding: 0.35rem 0.65rem; }
}

/* ── 30  Map ───────────────────────────────────────────── */

.map-container-wrap {
	position: relative;
	width: 100%;
	height: 600px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.12);
}

#flat-map, #globe-map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

#globe-map { display: none; background: #0a051a; }

/* Leaflet dark overrides */
.leaflet-container { background: #1a0a14 !important; }

.leaflet-popup-content-wrapper {
	background: rgb(62, 30, 30) !important;
	color: white !important;
	border: 1px solid rgba(255, 255, 255, 0.15) !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
	border-radius: 6px !important;
}

.leaflet-popup-tip { background: rgb(62, 30, 30) !important; }
.leaflet-popup-content { margin: 0.7rem 0.9rem !important; }
.leaflet-popup-content h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.leaflet-popup-content p { margin: 0; opacity: 0.7; font-size: 0.85rem; font-weight: 400; }
.leaflet-popup-close-button { color: rgba(255, 255, 255, 0.5) !important; }
.leaflet-popup-close-button:hover { color: white !important; }

.map-type-badge {
	display: inline-block;
	margin-left: 0.4rem;
	font-size: 0.7rem;
	font-weight: 500;
	opacity: 0.55;
	vertical-align: middle;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

@media (max-width: 700px) {
	.map-container-wrap { height: 420px; }
}

/* ── 31  Stories ────────────────────────────────────────── */

/* Story reader */
.story {
	max-width: 680px;
	margin: 2rem auto 3rem;
	padding: 0 1.5rem;
	text-align: left;
	
}

.story .page-title {
	font-size: 1.8rem;
	margin-bottom: 0.25rem;
}

.story-meta {
	opacity: 0.55;
	font-size: 0.82rem;
	margin-bottom: 2.5rem;
	font-style: italic;
	letter-spacing: 0.02em;
}

.story-body {
	font-family: 'Goudy Bookletter 1911', serif;
	font-size: 1.08rem;
	line-height: 2;
	font-weight: 300;
	color: rgba(255, 255, 255, 0.92);
}

.story-body p {
	margin: 0 0 1.5rem;
	text-indent: 1.5rem;
}

.story-body p:first-of-type { text-indent: 0; }

.story-body p:first-of-type::first-letter {
	font-family: "WadsworthIndustrial", serif;
	font-size: 3.5em;
	float: left;
	line-height: 0.85;
	margin: 0.05em 0.1em 0 0;
	font-weight: 400;
	color: var(--accent);
}

/* Drop cap after section breaks too */
.story-body hr + p { text-indent: 0; }
.story-body hr + p::first-letter {
	font-family: "anglicanText", serif;
	font-size: 3.5em;
	float: left;
	line-height: 0.85;
	margin: 0.05em 0.1em 0 0;
	font-weight: 400;
	color: var(--accent);
}

/* Chapter / section headings */
.story-body h2 {
	font-family: var(--font-display);
	font-size: 1.4rem;
	font-weight: 500;
	text-align: center;
	margin: 3rem 0 1.5rem;
	letter-spacing: 0.03em;
	opacity: 0.9;
}

.story-body h3 {
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 500;
	margin: 2.5rem 0 1rem;
	letter-spacing: 0.02em;
	opacity: 0.85;
}

.story-body h4 {
	font-size: 1rem;
	font-weight: 600;
	font-style: italic;
	margin: 2rem 0 0.8rem;
	opacity: 0.8;
}

/* Paragraph after heading: no indent, optional drop cap on h2 */
.story-body h2 + p,
.story-body h3 + p,
.story-body h4 + p { text-indent: 0; }

.story-body h2 + p::first-letter {
	font-family: "anglicanText", serif;
	font-size: 3.5em;
	float: left;
	line-height: 0.85;
	margin: 0.05em 0.1em 0 0;
	font-weight: 400;
	color: var(--accent);
}

.story-body hr {
	border: none;
	text-align: center;
	margin: 3rem 0;
	opacity: 0.4;
}

.story-body hr::before {
	content: '⁕  ⁕  ⁕';
	letter-spacing: 0.5em;
	font-size: 0.9rem;
}

.story-body blockquote {
	margin: 1.8rem 0 1.8rem 1.5rem;
	padding: 0.8rem 1.2rem;
	border-left: 3px solid var(--a50);
	background: var(--a06);
	font-style: italic;
}

.story-body em { font-style: italic; }
.story-body strong { font-weight: 600; }

/* Story prev / next navigation */
.story-nav {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	margin: 3rem 0 1rem;
	gap: 1rem;

	padding-top: 1.5rem;
}

.story-nav-link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
	color: inherit;
	padding: 0.6rem 0.8rem;

	transition: border-color 0.2s, background 0.2s;
	max-width: 48%;
	min-width: 0;
}



.story-nav-link--next {
	margin-left: auto;
	text-align: right;
	flex-direction: row-reverse;
}

.story-nav-arrow { font-size: 1.4rem; opacity: 0.6; flex-shrink: 0; }
.story-nav-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.5; }

.story-nav-title {
	font-size: 0.88rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Story listing cards */
.stories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
	gap: 1.2rem;
	margin: 1.5rem 0 2rem;
}

.story-card {
	position: relative;
	display: block;
	text-decoration: none;
	color: #fff;
	border: 2px solid var(--a25);
	overflow: hidden;
	aspect-ratio: 2 / 3;
	transition: all 0.5s cubic-bezier(0.8,0.5,0.2,1.4);

}

.story-card:hover {
	border-color: rgba(255, 255, 255, 0.6);
	z-index: 2;
}

/* Cover image — rotates, zooms, blurs on hover */
.story-card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	transition: all 0.5s cubic-bezier(0.8,0.5,0.2,1.4);
	transform-origin: 50% 50%;
}

.story-card-img--empty {
	position: absolute;
	inset: 0;
	background: rgba(var(--accent-rgb), 0.12);
}

.story-card:hover .story-card-img {
    transform: scale(1.7) rotate(20deg);
    filter: blur(3px)
}

/* Resting state: gradient + title at bottom */
.story-card-overlay {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
	padding: 2.5rem 0.65rem 0.6rem;
	z-index: 2;
	transition: opacity 0.2s;
	pointer-events: none;
}

.story-card:hover .story-card-overlay {
	opacity: 0;
}

.story-card-name {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Circular synopsis — expands from bottom-right on hover */
.story-card-body {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-end;
	padding: 1rem;
	/* clip to a small circle at bottom-right */
	clip-path: circle(0% at 100% 100%);
	transition: all 0.7s ease-in-out;
	pointer-events: none;
}

.story-card:hover .story-card-body {
	clip-path: circle(150% at 100% 100%);
	pointer-events: auto;
}

/* Dark fill behind the text — also circle-clipped via parent */
.story-card-body::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(10, 2, 4, 0.75);
	z-index: -1;
}

.story-card-body-inner {
	text-align: right;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 1s ease 0.1s, transform 1.25s ease 0.1s;
	margin-bottom: 1.5rem;
}

.story-card:hover .story-card-body-inner {
	opacity: 1;
	transform: translateY(0);
}

.story-card-title {
	font-size: 0.9rem;
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	color: var(--accent);
	line-height: 1.15;
	margin-bottom: 0.4rem;
}

.story-card-excerpt {
	font-size: 0.7rem;
	line-height: 1.6;
	opacity: 0.88;
	flex: 1;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 8;
	line-clamp: 8;
	-webkit-box-orient: vertical;
}

.story-card-meta {
	font-size: 0.62rem;
	opacity: 0.45;
	font-style: italic;
	margin-top: 0.4rem;
}

.stories-filters {
	margin-bottom: 1.5rem;
}

.stories-filter-toggle {
	cursor: pointer;
	margin-bottom: 0.75rem;
	display: inline-block;
	list-style: none;
}

.stories-filter-toggle::-webkit-details-marker { display: none; }

.stories-filters[open] .stories-filter-toggle {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.stories-filter-content {
	background: rgba(var(--accent-rgb), 0.1);
	padding: 1rem;
	margin-top: 0.5rem;
	overflow: hidden;
}

.stories-filter-group {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.stories-filter-group:last-child { margin-bottom: 0; }

.stories-filter-group .tab-bar {
	margin: 0;
}

.stories-filter-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.5;
	white-space: nowrap;
	min-width: 5.5rem;
}

@media (max-width: 700px) {
	.story { padding: 0 1rem; }
	.story-body { font-size: 1rem; line-height: 1.85; }
	.story-nav-link { max-width: 50%; padding: 0.5rem 0.6rem; }
	.stories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
	.stories-grid { grid-template-columns: 1fr; }
}

/* ── 32  Page Effect: Ruin ─────────────────────────────── */

html.page-ruin body { position: relative; }

html.page-ruin body::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	clip-path: polygon(
		0% 0%, 2% 1%, 5% 0%, 8% 1.5%, 12% 0%, 15% 2%, 18% 0.5%, 22% 1%,
		26% 0%, 30% 1.8%, 35% 0%, 40% 1%, 45% 0.5%, 50% 2%, 55% 0%,
		60% 1.5%, 65% 0%, 70% 2%, 75% 0.5%, 80% 1.5%, 85% 0%, 90% 2%,
		95% 0%, 98% 1%, 100% 0%,
		100% 98%, 98% 100%, 95% 98.5%, 92% 100%, 88% 98%, 85% 100%,
		80% 98.5%, 75% 100%, 70% 98%, 65% 100%, 60% 98.5%, 55% 100%,
		50% 98%, 45% 100%, 40% 98.5%, 35% 100%, 30% 98%, 25% 100%,
		20% 98.5%, 15% 100%, 10% 98%, 5% 100%, 2% 98.5%, 0% 100%
	);
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.18) 0%,
		transparent 6%,
		transparent 94%,
		rgba(0, 0, 0, 0.18) 100%
	);
}

html.page-ruin body::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(ellipse at 15% 8%, rgba(0, 0, 0, 0.12) 0%, transparent 60%),
		radial-gradient(ellipse at 85% 92%, rgba(0, 0, 0, 0.10) 0%, transparent 55%),
		radial-gradient(ellipse at 50% 50%, rgba(80, 60, 30, 0.04) 0%, transparent 70%);
}

/* ── 33  Page Effect: Corruption ───────────────────────── */

html.page-corruption body {
	position: relative;
	animation: corruption-flicker 3s infinite;
	background-color: rgb(10, 10, 12);
	border-color: rgba(255, 255, 255, 0.15);
	--accent: rgb(255, 255, 255);
	--accent-rgb: 255, 255, 255;
}

html.page-corruption body::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 256px 256px;
	animation: corruption-static 0.4s steps(6) infinite;
	mix-blend-mode: overlay;
}

html.page-corruption body::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 3;
	background: repeating-linear-gradient(
		0deg,
		transparent,
		transparent 2px,
		rgba(0, 0, 0, 0.03) 2px,
		rgba(0, 0, 0, 0.03) 4px
	);
	animation: corruption-tear 5s infinite;
}

html.page-corruption .page-title {
	animation: corruption-link 4s infinite;
	display: block;
}

html.page-corruption .page-title:hover {
	animation-play-state: paused;
	text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
	color: #fff;
}

html.page-corruption {
	background-color: rgb(5, 5, 7);
	background-image: none;
}

html.page-corruption .infobox-title { background: rgb(10, 10, 12); }
html.page-corruption .infobox-title-inner { color: rgb(255, 255, 255); }

html.page-corruption .infobox-title::before,
html.page-corruption .infobox-title::after {
	background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5), transparent);
}

html.page-corruption .infobox th.infobox-divider {
	color: rgba(255, 255, 255, 0.85);
}

html.page-corruption .infobox th.infobox-divider::before,
html.page-corruption .infobox th.infobox-divider::after,
html.page-corruption .infobox-office::before,
html.page-corruption .infobox-office::after {
	background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
}

html.page-corruption .infobox-office-value { color: #ffffff; }

html.page-corruption .infobox-native-name,
html.page-corruption .infobox-romanised-name {
	background: rgb(10, 10, 12);
	color: rgba(255, 255, 255, 0.8);
}

html.page-corruption {
	scrollbar-color: white;
}

html.page-corruption::-webkit-scrollbar-track { background: rgb(5, 5, 7); }
html.page-corruption::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); }
html.page-corruption::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }

html.page-corruption .site-footer-location {
	background: rgb(10, 10, 12);
	border-color: rgba(255, 255, 255, 0.15);
}

html.page-corruption .infobox { background: rgb(10, 10, 12); }
html.page-corruption .infobox-image-placeholder { background: rgb(10, 10, 12); }

html.page-corruption .wiki-figure--thumb .wiki-figure-inner,
html.page-corruption .wiki-figure--frame .wiki-figure-inner {
	background: rgb(10, 10, 12);
	border-color: rgba(255, 255, 255, 0.15);
}

html.page-corruption .toc { border-color: rgba(255, 255, 255, 0.6); }
html.page-corruption .infobox { border-color: rgba(255, 255, 255, 0.6); }
html.page-corruption .site-search-input { border-color: rgba(255, 255, 255, 0.6); }
html.page-corruption .site-search-input:focus { border-color: #fff; }

html.page-corruption .site-nav-link:hover,
html.page-corruption .sub-nav-link:hover {
	border-bottom-color: rgba(255, 255, 255, 0.8);
	color: #fff;
}

/* ── 34  Page Watermark ────────────────────────────────── */

.page-watermark {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	background-repeat: no-repeat;
	background-size: 400px;
	background-position: bottom right;
	opacity: 0.03;
}

/* ── 35  Lore Grid (no-skew card variant) ──────────────── */

/* Shared no-skew card — used by religion & locations */
.lore-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin: 0 0 1.5rem;
}

.lore-card {
	position: relative;
	width: 140px;
	height: 210px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 2px solid var(--accent);
	text-decoration: none;
	color: #fff;
	background: rgba(var(--accent-rgb), 0.08);
	transition: all 0.25s cubic-bezier(0.8, 0.5, 0.2, 1.4);
}

.lore-card--wide {
	width: calc(4 * 142px + 3 * 9px); /* spans 4 standard cards */
	height: 210px;
	flex-shrink: 0;
}

.lore-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	transition: background 0.3s;
	z-index: 1;
	pointer-events: none;
}

.lore-card:hover {
	transform: scale(1.12) rotate(-1.5deg);
	z-index: 10;
	border-color: #fff;
	outline: 4px solid #fff;
	animation: border-select 0.25s steps(4) infinite;
}

.lore-card:hover::before {
	background: rgba(0, 0, 0, 0);
}

.lore-card:hover .lore-card-name { color: var(--accent); }

.lore-card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	pointer-events: none;
}

.lore-card-name {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 0.45rem 0.5rem;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
	transition: color 0.2s;
}

.lore-card--empty {
	opacity: 0.25;
	border-style: dashed;
	cursor: default;
	pointer-events: none;
}

/* Selphism constellation grid — 8-column explicit placement */
.lore-grid--selphism {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	grid-auto-rows: 110px;
	gap: 6px;
}

.lore-grid--selphism .lore-card,
.lore-grid--selphism .lore-card--wide,
.lore-grid--selphism .lore-card--leader,
.lore-grid--selphism .lore-card--sigil {
	width: auto;
	height: auto;
	min-height: unset;
	flex-shrink: unset;
}

.lore-grid--selphism .lore-card--leader {
	border-width: 3px;
	border-color: var(--gold-bright);
	background: rgba(241, 213, 133, 0.08);
	letter-spacing: 0.12em;
}

.lore-grid--selphism .lore-card--sigil {
	border-width: 3px;
	border-style: double;
	border-color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

/* Religion tab panels */
.rel-panel { display: none; }
.rel-panel.active { display: block; }

/* ── 36  Relics Grid (tall sword cards) ────────────────── */

.relics-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin: 0 0 1.5rem;
}

.relics-card {
	position: relative;
	width: 100px;
	height: 360px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 2px solid var(--accent);
	text-decoration: none;
	color: #fff;
	background: rgba(var(--accent-rgb), 0.08);
	transition: all 0.25s cubic-bezier(0.8, 0.5, 0.2, 1.4);
}

.relics-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	transition: background 0.3s;
	z-index: 1;
	pointer-events: none;
}

.relics-card:hover {
	transform: scale(1.08) rotate(-1deg);
	z-index: 10;
	border-color: #fff;
	outline: 4px solid #fff;
	animation: border-select 0.25s steps(4) infinite;
}

.relics-card:hover::before {
	background: rgba(0, 0, 0, 0);
}

.relics-card:hover .relics-card-name { color: var(--accent); }

.relics-card-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	pointer-events: none;
}

.relics-card-name {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 0.4rem 0.3rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
	transition: color 0.2s;
}

/* ── 37  Locations Panel Grid (comic-panel layout) ─────── */

.locations-panel-grid {
	display: grid;
	grid-template-columns: 0.65fr 1fr 1fr;
	grid-template-rows: 280px 120px 130px;
	gap: 6px;
	margin: 1.5rem 0;
}

.locations-panel {
	position: relative;
	overflow: hidden;
	border: 2px solid var(--accent);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: #fff;
	background: rgba(var(--accent-rgb), 0.08);
	transition: all 0.25s cubic-bezier(0.8, 0.5, 0.2, 1.4);
}

.locations-panel::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	transition: background 0.3s;
	z-index: 1;
	pointer-events: none;
}

.locations-panel:hover {
	transform: scale(1.025) rotate(-0.5deg);
	z-index: 10;
	border-color: #fff;
	outline: 4px solid #fff;
	animation: border-select 0.25s steps(4) infinite;
}

.locations-panel:hover::before {
	background: rgba(0, 0, 0, 0);
}

.locations-panel:hover .locations-panel-name { color: var(--accent); }

.locations-panel--main      { grid-column: 1; grid-row: 1 / 3; }
.locations-panel--focal-a   { grid-column: 2; grid-row: 1; }
.locations-panel--focal-b   { grid-column: 3; grid-row: 1; }
.locations-panel--side-bot  { grid-column: 2 / 4; grid-row: 2; }
.locations-panel--full      { grid-column: 1 / 4; grid-row: 3; }

.locations-panel--empty {
	opacity: 0.25;
	border-style: dashed;
	cursor: default;
	pointer-events: none;
}

.locations-panel-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}

.locations-panel-name {
	position: relative;
	z-index: 2;
	padding: 0.6rem 0.85rem;
	font-size: 0.88rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
	transition: color 0.2s;
}

/* ── 38  Shards Grid (masonry flip-reveal) ─────────────── */

.shards-grid {
	margin: 1.5rem 0;
	columns: 5;
	column-gap: 12px;
}

.shard-card {
	position: relative;
	border: 2px solid var(--shard-color, var(--accent));
	overflow: hidden;
	cursor: pointer;
	background: color-mix(in srgb, var(--shard-color, var(--accent)) 14%, transparent);
	transition: border-color 0.2s;
	box-sizing: border-box;
	padding: 0;
	break-inside: avoid;
	margin-bottom: 12px;
}

.shard-card:hover:not(.is-open) {
	border-color: rgba(255, 255, 255, 0.5);
}

.shard-card:hover:not(.is-open) .shard-card-title { color: var(--accent); }

.shard-card.is-open {
	border-color: rgba(255, 255, 255, 0.4);
}

.shard-card-front {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.3s, filter 0.3s;
}

.shard-card.is-open .shard-card-front {
	filter: blur(4px);
	opacity: 0.25;
}

.shard-card-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.shard-card-thumb--empty { display: none; }

.shard-card-title {
	position: relative;
	z-index: 2;
	padding: 0.6rem 0.75rem 0.7rem;
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-align: center;
	text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
	transition: color 0.2s;
}

.shard-card-back {
	position: absolute;
	inset: 0;
	background: rgba(10, 2, 4, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
	text-align: center;
}

.shard-card.is-open .shard-card-back {
	opacity: 1;
	pointer-events: auto;
}

.shard-card-desc {
	font-size: 0.85rem;
	font-weight: 400;
	line-height: 1.65;
	opacity: 0.9;
	margin: 0;
	text-align: center;
}

@media (max-width: 1200px) {
	.shards-grid { columns: 4; }
}

@media (max-width: 992px) {
	.shards-grid { columns: 3; }
}

@media (max-width: 700px) {
	.shards-grid { columns: 2; column-gap: 8px; }
	.lore-card { width: 110px; height: 165px; }
	.relics-card { width: 76px; height: 270px; }
	.locations-panel-grid {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 200px 200px 120px 120px;
	}
	.locations-panel--main {
		grid-column: 1 / 3;
		grid-row: 1;
	}
	.locations-panel--focal-a { grid-column: 1; grid-row: 2; }
	.locations-panel--focal-b { grid-column: 2; grid-row: 2; }
	.locations-panel--side-bot { grid-column: 1 / 3; grid-row: 3; }
	.locations-panel--full { grid-column: 1 / 3; grid-row: 4; }
}

@media (max-width: 480px) {
	.shards-grid { columns: 1; }
	.shard-card { min-height: 120px; }
}

/* ── 39  Relationship Web ──────────────────────────────── */

.rel-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	margin-bottom: 1rem;
	font-size: 0.82rem;
	opacity: 0.7;
}

.rel-legend-item {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.rel-legend-line {
	display: inline-block;
	width: 24px;
	height: 2px;
	border-radius: 1px;
}

.rel-factions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.rel-faction-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--faction-clr, var(--accent));
	border-radius: 2px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--faction-clr, var(--accent));
	background: color-mix(in srgb, var(--faction-clr, var(--accent)) 10%, transparent);
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.rel-faction-badge:hover {
	background: color-mix(in srgb, var(--faction-clr, var(--accent)) 25%, transparent);
	color: #fff;
}

.rel-faction-count {
	font-size: 0.7rem;
	opacity: 0.6;
}

.rel-canvas {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 1px solid var(--a25);
	border-radius: 3px;
	background: var(--glass);
	overflow: hidden;
}

.rel-zoom-layer {
	position: absolute;
	inset: 0;
	transform-origin: 0 0;
	will-change: transform;
}

.rel-lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: visible;
	z-index: 0;
}

.rel-lines line {
	transition: opacity 0.25s;
}

.rel-highlight .rel-lines line.rel-dim {
	opacity: 0.08;
}

.rel-node {
	position: absolute;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	cursor: grab;
	transition: opacity 0.25s, filter 0.25s;
	z-index: 1;
	user-select: none;
	touch-action: none;
	text-decoration: none;
	color: inherit;
}

.rel-node.rel-dragging {
	cursor: grabbing;
	z-index: 10;
	transition: none;
}

.rel-highlight .rel-node.rel-dim {
	opacity: 0.15;
	filter: grayscale(1);
}

.rel-node-ring {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 2px solid var(--node-clr, var(--accent));
	background: color-mix(in srgb, var(--node-clr, var(--accent)) 20%, #0c0606);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.rel-node:hover .rel-node-ring {
	border-color: #fff;
	box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.rel-node-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.rel-node-initial {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--node-clr, var(--accent));
	opacity: 0.7;
}

.rel-node-name {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
	white-space: nowrap;
	transition: opacity 0.2s;
}

.rel-names-hidden .rel-node-name {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 992px) {
	.rel-canvas { aspect-ratio: 4 / 3; }
	.rel-node-ring { width: 44px; height: 44px; }
	.rel-node-name { font-size: 0.65rem; }
}

@media (max-width: 600px) {
	.rel-canvas { aspect-ratio: 3 / 4; }
	.rel-node-ring { width: 36px; height: 36px; }
	.rel-node-name { font-size: 0.6rem; }
	.rel-legend { font-size: 0.72rem; }
	.rel-faction-badge { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
}

/* ═══════════════════════════════════════════════════
   Orphaned / Dead / Wanted lists
═══════════════════════════════════════════════════ */
.orphaned-pages-list,
.wanted-pages-list {
list-style: none;
padding: 0;
margin: 0;
}
.orphaned-pages-list li,
.wanted-pages-list li {
display: flex;
align-items: baseline;
gap: 0.75rem;
padding: 0.35rem 0;
border-bottom: 1px solid #222;
}
.orphaned-pages-list a,
.wanted-pages-list a { color: #c8a060; text-decoration: none; }
.orphaned-pages-list a:hover,
.wanted-pages-list a:hover { text-decoration: underline; }

.wanted-pages-name { flex: 1; color: #e0e0e0; }
.wanted-pages-count { font-size: 0.8rem; opacity: 0.6; white-space: nowrap; }

.dead-links-list {
list-style: none;
padding: 0;
margin: 0;
}
.dead-links-item {
padding: 0.75rem 0;
border-bottom: 1px solid #222;
}
.dead-links-target {
font-family: monospace;
color: #c0504d;
display: block;
margin-bottom: 0.25rem;
}
.dead-links-count {
font-size: 0.8rem;
opacity: 0.6;
margin-left: 0.5rem;
}
.dead-links-sources {
list-style: disc;
margin: 0.25rem 0 0 1.5rem;
padding: 0;
}
.dead-links-sources a { color: #c8a060; text-decoration: none; font-size: 0.9rem; }
.dead-links-sources a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   Shortest / Longest Articles
═══════════════════════════════════════════════════ */
.shortest-articles-list,
.longest-articles-list {
list-style: none;
padding: 0;
margin: 0;
counter-reset: article-rank;
}
.shortest-articles-list li,
.longest-articles-list li {
display: flex;
align-items: baseline;
gap: 0.75rem;
padding: 0.35rem 0;
border-bottom: 1px solid #222;
counter-increment: article-rank;
}
.shortest-articles-list li::before,
.longest-articles-list li::before {
content: counter(article-rank) '.';
min-width: 2rem;
color: #888;
font-size: 0.85rem;
}
.shortest-articles-list a,
.longest-articles-list a {
flex: 1;
color: #c8a060;
text-decoration: none;
}
.shortest-articles-list a:hover,
.longest-articles-list a:hover { text-decoration: underline; }
.article-word-count {
font-size: 0.8rem;
opacity: 0.6;
white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   Category Tree
═══════════════════════════════════════════════════ */
.category-tree { margin-top: 1rem; }

.category-tree-item {
margin-bottom: 0.5rem;
border: 1px solid #2a2a2a;
border-radius: 4px;
overflow: hidden;
}

.category-tree-summary {
padding: 0.5rem 0.75rem;
background: #1a1a1a;
cursor: pointer;
list-style: none;
display: flex;
align-items: center;
gap: 0.5rem;
user-select: none;
}
.category-tree-summary::-webkit-details-marker { display: none; }
.category-tree-summary::before {
content: '▶';
font-size: 0.7rem;
color: #880a13;
transition: transform 0.15s;
}
details[open] .category-tree-summary::before { transform: rotate(90deg); }
.category-tree-summary a { color: #c8a060; text-decoration: none; font-weight: 600; }
.category-tree-summary a:hover { text-decoration: underline; }
.category-tree-count { font-size: 0.8rem; opacity: 0.55; }

.category-tree-members {
list-style: none;
margin: 0;
padding: 0.5rem 1rem 0.75rem 2rem;
background: #111;
}
.category-tree-members li { padding: 0.2rem 0; }
.category-tree-members a { color: #c8a060; text-decoration: none; font-size: 0.9rem; }
.category-tree-members a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   Hatnotes
═══════════════════════════════════════════════════ */
.wiki-hatnote {
font-size: 0.88rem;
color: #aaa;
border-bottom: 1px solid #2a2a2a;
padding: 0.3rem 0.6rem;
margin-bottom: 0.75rem;
}
.wiki-hatnote a { color: #c8a060; text-decoration: none; }
.wiki-hatnote a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   Gallery markup
═══════════════════════════════════════════════════ */
.wiki-gallery {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 0.75rem;
margin: 1rem 0;
}
.wiki-gallery-item {
margin: 0;
background: #1a1a1a;
border: 1px solid #333;
border-radius: 4px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.wiki-gallery-item img {
width: 100%;
aspect-ratio: 4/3;
object-fit: cover;
cursor: pointer;
display: block;
}
.wiki-gallery-item figcaption {
padding: 0.35rem 0.5rem;
font-size: 0.8rem;
color: #aaa;
text-align: center;
}

/* ═══════════════════════════════════════════════════
   Spoiler
═══════════════════════════════════════════════════ */
.wiki-spoiler {
background: #333;
color: transparent;
cursor: pointer;
border-radius: 3px;
padding: 0.1em 0.3em;
user-select: none;
transition: background 0.2s, color 0.2s;
}
.wiki-spoiler:hover { background: #444; }
.wiki-spoiler.is-revealed {
background: transparent;
color: inherit;
cursor: default;
}

/* ═══════════════════════════════════════════════════
   Epigraph
═══════════════════════════════════════════════════ */
.wiki-epigraph {
font-style: italic;
font-size: 1.05rem;
color: #ccc;
border-left: 3px solid #880a13;
margin: 1.25rem 0 1.25rem 1rem;
padding: 0.5rem 1rem;
background: #151515;
}
.wiki-epigraph p { margin: 0 0 0.35rem; }
.wiki-epigraph footer {
text-align: right;
font-size: 0.85rem;
color: #888;
font-style: normal;
}

/* ═══════════════════════════════════════════════════
   Stub banner
═══════════════════════════════════════════════════ */
.wiki-stub-banner {
background: #1a1510;
border-left: 4px solid #880a13;
padding: 0.6rem 1rem;
margin: 0.75rem 0;
font-size: 0.9rem;
color: #ccc;
border-radius: 0 4px 4px 0;
}

/* ═══════════════════════════════════════════════════
   Glossary
═══════════════════════════════════════════════════ */
.wiki-glossary-entry { display: none; }

.glossary-list {
margin: 0 0 1.5rem;
}
.glossary-term {
font-weight: 700;
color: #e0e0e0;
margin-top: 0.75rem;
}
.glossary-def {
margin: 0.15rem 0 0 1rem;
color: #bbb;
}
.glossary-source { color: #888; margin-left: 0.5rem; }
.glossary-source a { color: #c8a060; text-decoration: none; }
.glossary-source a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   See Also
═══════════════════════════════════════════════════ */
.see-also-section {
margin: 1.5rem 0;
padding: 0.75rem 1rem;
background: #111;
border: 1px solid #2a2a2a;
border-radius: 4px;
}
.see-also-section .wiki-backlinks-heading {
font-size: 1rem;
margin: 0 0 0.5rem;
color: #999;
letter-spacing: 0.05em;
text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   Sortable tables
═══════════════════════════════════════════════════ */
table[data-sortable] th {
cursor: pointer;
user-select: none;
position: relative;
padding-right: 1.5em;
}
table[data-sortable] th::after {
content: '⇅';
position: absolute;
right: 0.4em;
opacity: 0.35;
font-size: 0.8em;
}
table[data-sortable] th[data-sort-dir="asc"]::after {
content: '↑';
opacity: 0.85;
}
table[data-sortable] th[data-sort-dir="desc"]::after {
content: '↓';
opacity: 0.85;
}

/* ═══════════════════════════════════════════════════
   Map
═══════════════════════════════════════════════════ */
.map-container {
width: 100%;
min-height: 500px;
background: #0a0a14;
border-radius: 6px;
overflow: hidden;
position: relative;
}
.map-toggle {
position: absolute;
top: 1rem;
right: 1rem;
z-index: 1000;
background: rgba(26,26,26,0.9);
color: #e0e0e0;
border: 1px solid #444;
padding: 0.4rem 0.8rem;
cursor: pointer;
border-radius: 4px;
font-size: 0.85rem;
}
.map-toggle:hover { background: #880a13; border-color: #880a13; }
