/*
	The wiki's look: the game's, as far as a page can carry it. Cinzel for display and Grenze for
	body are the two faces the HUD uses (assets/fonts, shipped beside this file with their OFL
	licenses); the ground is the dungeon's dark and the accent is torchlight. Rarity colors are
	never written here -- they come out of the dump as the hex of item_view_rarity_color, so the
	page and the equipment window can never disagree about what "rare" looks like.
*/

@font-face {
	font-family: "Cinzel";
	src: url("fonts/Cinzel-Bold.ttf") format("truetype");
	font-weight: 700;
	font-display: swap;
}
@font-face {
	font-family: "Grenze";
	src: url("fonts/Grenze-Bold.ttf") format("truetype");
	font-weight: 700;
	font-display: swap;
}

:root {
	--ink: #e6dfd2;
	--ink-dim: #a49a88;
	--ink-faint: #6f6757;
	--ground: #14120f;
	--panel: #1e1b16;
	--panel-2: #262119;
	--edge: #3a3228;
	--torch: #e8a33d;
	--torch-dim: #8a6224;
	--good: #7fb069;
	--bad: #cc5b4a;
	--radius: 3px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: "Grenze", Georgia, "Times New Roman", serif;
	font-size: 17px;
	line-height: 1.6;
}

a { color: var(--torch); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ layout */

.wrap { display: flex; min-height: 100vh; align-items: flex-start; }

.side {
	position: sticky;
	top: 0;
	flex: 0 0 240px;
	height: 100vh;
	overflow-y: auto;
	padding: 24px 18px 40px;
	background: var(--panel);
	border-right: 1px solid var(--edge);
}

.brand {
	font-family: "Cinzel", Georgia, serif;
	font-size: 22px;
	letter-spacing: 0.06em;
	color: var(--torch);
	display: block;
	margin-bottom: 2px;
}
.brand:hover { text-decoration: none; }
.brand-sub { color: var(--ink-faint); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

.side nav { margin-top: 22px; display: flex; flex-direction: column; gap: 1px; }
.side nav a {
	color: var(--ink-dim);
	padding: 5px 9px;
	border-radius: var(--radius);
	border-left: 2px solid transparent;
}
.side nav a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.side nav a.on { color: var(--torch); border-left-color: var(--torch); background: var(--panel-2); }

.main { flex: 1 1 auto; min-width: 0; padding: 34px 40px 90px; max-width: 1000px; }

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

.search { position: relative; margin-top: 18px; }
.search input {
	width: 100%;
	background: var(--ground);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	color: var(--ink);
	font-family: inherit;
	font-size: 15px;
	padding: 7px 9px;
}
.search input:focus { outline: none; border-color: var(--torch-dim); }
.results {
	position: absolute;
	z-index: 20;
	left: 0;
	right: 0;
	margin-top: 4px;
	background: var(--panel-2);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	max-height: 60vh;
	overflow-y: auto;
}
.results a { display: block; padding: 6px 9px; color: var(--ink); font-size: 15px; }
.results a:hover { background: var(--panel); text-decoration: none; }
.results .where { color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.results:empty { display: none; }

/* ------------------------------------------------------------------- prose */

h1, h2, h3 { font-family: "Cinzel", Georgia, serif; font-weight: 700; line-height: 1.25; }
h1 { font-size: 34px; margin: 0 0 6px; color: var(--torch); letter-spacing: 0.02em; }
h2 {
	font-size: 24px;
	margin: 40px 0 10px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--edge);
	scroll-margin-top: 18px;
}
h3 { font-size: 19px; margin: 26px 0 8px; color: var(--ink); scroll-margin-top: 18px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 3px 0; }
strong { color: #fff; }
code {
	font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
	font-size: 0.86em;
	background: var(--panel-2);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	padding: 1px 5px;
	color: var(--torch);
}
blockquote {
	margin: 0 0 14px;
	padding: 10px 16px;
	border-left: 3px solid var(--torch-dim);
	background: var(--panel);
	color: var(--ink-dim);
}
hr { border: 0; border-top: 1px solid var(--edge); margin: 30px 0; }

.lede { color: var(--ink-dim); font-size: 19px; margin-bottom: 26px; }

/* ------------------------------------------------------------------ tables */

.scroll { overflow-x: auto; margin: 0 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--edge); vertical-align: top; }
th {
	font-family: "Cinzel", Georgia, serif;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink-faint);
	white-space: nowrap;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 18px; }
tbody tr:hover { background: var(--panel); }
td .note { color: var(--ink-dim); font-size: 14px; }

/* --------------------------------------------------------------- stat block */

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 1px;
	background: var(--edge);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	margin: 0 0 20px;
	overflow: hidden;
}
.stat { background: var(--panel); padding: 9px 12px; }
.stat .k { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint); }
.stat .v { font-family: "Cinzel", Georgia, serif; font-size: 20px; color: var(--ink); }
.stat .u { font-size: 13px; color: var(--ink-dim); margin-left: 2px; }

/* -------------------------------------------------------------------- items */

.icon {
	width: 32px;
	height: 32px;
	image-rendering: pixelated;
	vertical-align: middle;
	background: var(--panel-2);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
}
td.icon-cell { width: 34px; padding-right: 10px; }

.card {
	display: inline-block;
	min-width: 260px;
	max-width: 420px;
	background: var(--panel);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	padding: 12px 14px;
	margin: 0 12px 18px 0;
	vertical-align: top;
}
.card .head { display: flex; gap: 10px; align-items: center; }
.card .name { font-family: "Cinzel", Georgia, serif; font-size: 17px; }
.card .sub { color: var(--ink-faint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.card .blurb { color: var(--ink-dim); font-size: 15px; margin-top: 8px; }
.card ul { margin: 8px 0 0; padding-left: 18px; font-size: 15px; }

.tag {
	display: inline-block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--ink-faint);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	padding: 0 6px;
	margin-right: 4px;
}
a.tag:hover { color: var(--torch); border-color: var(--torch-dim); text-decoration: none; }

/* ----------------------------------------------------------------- the beasts */

/* The catalogue on enemies.html: a card per enemy under the place it stands. The picture is a
   frame out of the running game (assets/wiki), so it is dim and low-res on purpose -- it is the
   thing as the game draws it, and the plate behind it is what an enemy with no photograph yet
   falls back to. */

.roster {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
	gap: 10px;
	margin: 0 0 24px;
}

a.beast-card {
	display: flex;
	gap: 12px;
	align-items: center;
	background: var(--panel);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	padding: 10px 12px;
	color: var(--ink);
}
a.beast-card:hover { background: var(--panel-2); border-color: var(--torch-dim); text-decoration: none; }
a.beast-card .who { min-width: 0; }
a.beast-card .name {
	display: block;
	font-family: "Cinzel", Georgia, serif;
	font-size: 17px;
	color: var(--torch);
}
a.beast-card .lede { display: block; color: var(--ink-dim); font-size: 14px; line-height: 1.45; }

.portrait {
	flex: 0 0 auto;
	width: 84px;
	height: 84px;
	object-fit: cover;
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	background: var(--panel-2);
}
.portrait.big { width: 168px; height: 168px; }
/* No picture yet: the plate, so the row still lines up with the ones that have one. */
.portrait.none { display: inline-block; background: repeating-linear-gradient(135deg, var(--panel-2) 0 7px, var(--panel) 7px 14px); }

/* The plate at the top of an enemy's own page. */
.beast { display: flex; gap: 18px; align-items: center; margin: 0 0 26px; }
.beast .sub { color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; }
.beast .places { margin-top: 7px; }

.crumb { font-size: 14px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.yes { color: var(--good); }
.no { color: var(--ink-faint); }

/* ------------------------------------------------------------------- footer */

footer {
	margin-top: 60px;
	padding-top: 16px;
	border-top: 1px solid var(--edge);
	color: var(--ink-faint);
	font-size: 14px;
}
footer code { color: var(--ink-dim); }

/* -------------------------------------------------------------------- small */

@media (max-width: 820px) {
	.wrap { flex-direction: column; }
	.side { position: static; height: auto; flex: none; width: 100%; border-right: 0; border-bottom: 1px solid var(--edge); }
	.side nav { flex-direction: row; flex-wrap: wrap; }
	.main { padding: 22px 18px 60px; }
	h1 { font-size: 27px; }
}
