/* ---------------------------------------------------------------------------
   Wiki pages. Loaded only by /wiki/*, never by the landing page, so nothing
   here can affect index.html. Every color is taken from styles.css so the
   section reads as part of the site and not as a bolted-on doc portal.
--------------------------------------------------------------------------- */

:root {
	--wiki-bg: #03070f;
	--wiki-surface: rgba(255, 255, 255, 0.022);
	--wiki-surface-hover: rgba(255, 255, 255, 0.045);
	--wiki-border: rgba(255, 255, 255, 0.06);
	--wiki-border-accent: rgba(64, 196, 255, 0.28);
	--wiki-text: #cdd7e4;
	--wiki-heading: #f4f7fb;
	--wiki-muted: #97a8bd;
	--wiki-accent: #40c4ff;
	--wiki-accent-soft: #4dd0e1;
	--wiki-header-h: 70px;
}

/* the landing body carries a full-bleed hero photo and a 100vh height, neither
   of which works for a long scrolling document */
body.wiki-page {
	height: auto;
	min-height: 100vh;
	/* short pages (the wiki home on a tall screen) would leave the footer floating
	   mid-viewport, so the content column takes the leftover height */
	display: flex;
	flex-direction: column;
	background-color: var(--wiki-bg) !important;
	background-image:
		radial-gradient(ellipse at 12% 0%, #0d1527 0%, transparent 55%),
		radial-gradient(ellipse at 88% 60%, rgba(138, 116, 255, 0.1), transparent 50%);
	background-attachment: fixed;
	color: var(--wiki-text);
}

/* anchors land below the fixed header instead of under it */
html {
	scroll-padding-top: calc(var(--wiki-header-h) + 16px);
}

/* ---------------------------------------------------------- header */
/* The bar itself is the landing's own .header.shrink, so nothing is redefined
   here beyond what the missing hero used to provide. */
.wiki-page .header .container { max-width: 1850px; padding: 0 5%; height: 100%; }
/* the landing draws the active-link underline 15px below the link, which on a
   70px header lands on the header edge — color alone marks the section here */
.wiki-page .navbar-nav .nav-link.active::before { display: none; }

/* styles.css targets button.discord_button and button.primary by element, and
   these two are anchors because they navigate. Same paint, no styles.css edit. */
.wiki-page a.discord_button {
	background-color: #5865f2;
	border: #5865f2 1px solid;
	padding: 3px 12px 1px 7px;
	display: flex;
	align-items: center;
	color: #fff;
}
.wiki-page a.discord_button:hover { background-color: #4955d4; border-color: #4955d4; }
.wiki-page a.primary {
	border: #3eb2e0 1px solid;
	background-color: #3eb2e0;
	color: #1a1a1a;
	font-size: 14px;
	font-weight: 600;
	border-radius: 4px;
	padding: 6px 16px;
	white-space: nowrap;
}
.wiki-page a.primary:hover { border-color: #21b2f5; background-color: #37a4cf; color: #1a1a1a; }

/* language selector without Bootstrap's JS dropdown */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; cursor: pointer; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover,
.lang-menu[open] > summary { color: var(--wiki-accent); }
.lang-menu .lang-list {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	min-width: 150px;
	padding: 6px;
	background: rgba(6, 15, 24, 0.98);
	border: 1px solid var(--wiki-border);
	border-radius: 4px;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
	z-index: 1060;
}
.lang-menu .lang-list a {
	display: block;
	padding: 8px 12px;
	color: var(--wiki-text);
	text-decoration: none;
	border-radius: 3px;
	font-size: 15px;
	font-weight: 300;
}
.lang-menu .lang-list a:hover { background: var(--wiki-surface-hover); color: var(--wiki-accent); }
.lang-menu .lang-list a[aria-current="true"] { color: var(--wiki-accent); }

/* ---------------------------------------------------------- layout */
.wiki-shell {
	max-width: 1600px;
	margin: 0 auto;
	padding: calc(var(--wiki-header-h) + 28px) 3% 80px;
	display: grid;
	grid-template-columns: 292px minmax(0, 1fr) 232px;
	gap: 42px;
	align-items: start;
}

.wiki-sidebar,
.wiki-toc {
	position: sticky;
	top: calc(var(--wiki-header-h) + 24px);
	max-height: calc(100vh - var(--wiki-header-h) - 48px);
	overflow-y: auto;
	overscroll-behavior: contain;
}
/* thin scrollbars so the sticky columns do not shout */
.wiki-sidebar::-webkit-scrollbar,
.wiki-toc::-webkit-scrollbar { width: 6px; }
.wiki-sidebar::-webkit-scrollbar-thumb,
.wiki-toc::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }

/* ---------------------------------------------------------- sidebar */
.wiki-sidebar-title {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wiki-muted);
	padding-bottom: 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--wiki-border);
}

.wiki-group {
	background: var(--wiki-surface);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 4px;
	margin-bottom: 6px;
	transition: border-color 0.3s ease, background 0.3s ease;
}
.wiki-group:hover { border-color: rgba(64, 196, 255, 0.16); }
.wiki-group[open] { background: rgba(255, 255, 255, 0.035); }

.wiki-group > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	color: #e6edf6;
	font-size: 15px;
	font-weight: 400;
	user-select: none;
}
.wiki-group > summary::-webkit-details-marker { display: none; }
.wiki-group > summary:hover { color: var(--wiki-accent); }
.wiki-group > summary img {
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	opacity: 0.92;
}
.wiki-group > summary .chev {
	margin-left: auto;
	font-size: 13px;
	color: var(--wiki-muted);
	transition: transform 0.25s ease;
}
.wiki-group[open] > summary .chev { transform: rotate(180deg); }

.wiki-group ul {
	list-style: none;
	margin: 0;
	padding: 2px 0 10px;
}
.wiki-group ul a {
	display: block;
	padding: 8px 14px 8px 48px;
	color: var(--wiki-text);
	font-size: 14px;
	font-weight: 300;
	text-decoration: none;
	border-left: 2px solid transparent;
}
.wiki-group ul a:hover {
	color: var(--wiki-accent);
	background: rgba(255, 255, 255, 0.03);
}
.wiki-group ul a.is-active {
	color: var(--wiki-accent);
	border-left-color: var(--wiki-accent);
	background: rgba(64, 196, 255, 0.07);
}

/* mobile drawer trigger, hidden on desktop */
.wiki-nav-toggle { display: none; }

/* ---------------------------------------------------------- article */
.wiki-main { min-width: 0; }

.wiki-breadcrumb {
	font-size: 13px;
	font-weight: 300;
	color: var(--wiki-muted);
	margin-bottom: 18px;
}
.wiki-breadcrumb a { color: var(--wiki-muted); text-decoration: none; }
.wiki-breadcrumb a:hover { color: var(--wiki-accent); }
.wiki-breadcrumb span { margin: 0 8px; opacity: 0.5; }

.wiki-content {
	max-width: 860px;
	font-size: 16px;
	font-weight: 300;
	line-height: 1.75;
	color: var(--wiki-text);
}

.wiki-content h1 {
	font-size: 40px;
	font-weight: 500;
	line-height: 1.15;
	color: var(--wiki-heading);
	margin: 0 0 8px;
}
/* the same thin gradient rule the landing uses under section titles */
.wiki-content h1::after {
	content: "";
	display: block;
	width: 96px;
	height: 1px;
	margin: 20px 0 0;
	background: linear-gradient(to right,
		rgba(64, 196, 255, 0.9) 0%,
		rgba(64, 196, 255, 0) 100%);
}
.wiki-content h2 {
	font-size: 25px;
	font-weight: 400;
	color: var(--wiki-heading);
	margin: 52px 0 16px;
	padding-left: 14px;
	border-left: 2px solid #2e8ab8;
	scroll-margin-top: calc(var(--wiki-header-h) + 24px);
}
.wiki-content h3 {
	font-size: 19px;
	font-weight: 400;
	color: #dfe7f1;
	margin: 34px 0 12px;
}
.wiki-content p { margin: 0 0 16px; color: var(--wiki-text); font-weight: 300; }
.wiki-content strong { color: #e8eff8; font-weight: 500; }
.wiki-content a { color: var(--wiki-accent); text-decoration: none; border-bottom: 1px solid rgba(64, 196, 255, 0.3); }
.wiki-content a:hover { color: var(--wiki-accent-soft); border-bottom-color: var(--wiki-accent-soft); }

.wiki-content ul,
.wiki-content ol { margin: 0 0 18px; padding-left: 22px; }
.wiki-content li { margin-bottom: 7px; font-weight: 300; }
.wiki-content ul li::marker { color: rgba(64, 196, 255, 0.65); }
.wiki-content ol li::marker { color: var(--wiki-muted); }

.wiki-content img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 22px 0;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 4px;
	filter: drop-shadow(0 0 13px #000000);
}

.wiki-content hr {
	border: 0;
	height: 1px;
	margin: 40px 0;
	background: linear-gradient(to right, var(--wiki-border), transparent);
}

.wiki-content code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.88em;
	padding: 2px 6px;
	border-radius: 3px;
	background: rgba(64, 196, 255, 0.09);
	color: #9fdcff;
}

/* callouts: every blockquote in the wiki markdown is a "remember" style note */
.wiki-content blockquote {
	margin: 26px 0;
	padding: 16px 20px;
	background: rgba(64, 196, 255, 0.055);
	border: 1px solid rgba(64, 196, 255, 0.16);
	border-left: 3px solid var(--wiki-accent);
	border-radius: 4px;
}
.wiki-content blockquote p { margin-bottom: 10px; }
.wiki-content blockquote p:last-child { margin-bottom: 0; }
.wiki-content blockquote p:first-child strong { color: var(--wiki-accent); }

/* tables scroll inside their own box instead of stretching the page */
.wiki-table-scroll {
	overflow-x: auto;
	margin: 22px 0;
	border: 1px solid var(--wiki-border);
	border-radius: 4px;
}
.wiki-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14.5px;
	min-width: 520px;
}
.wiki-content thead th {
	background: #0a1220;
	color: #dbe6f2;
	font-weight: 500;
	text-align: left;
	padding: 12px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	white-space: nowrap;
}
.wiki-content tbody td {
	padding: 12px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	vertical-align: top;
	font-weight: 300;
}
.wiki-content tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.018); }
.wiki-content tbody tr:hover { background: rgba(64, 196, 255, 0.04); }
.wiki-content tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- toc */
.wiki-toc-title {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wiki-muted);
	margin-bottom: 14px;
}
.wiki-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--wiki-border); }
.wiki-toc a {
	display: block;
	padding: 7px 0 7px 16px;
	margin-left: -1px;
	border-left: 1px solid transparent;
	color: var(--wiki-muted);
	font-size: 13.5px;
	font-weight: 300;
	line-height: 1.4;
	text-decoration: none;
}
.wiki-toc a:hover { color: var(--wiki-accent); border-left-color: var(--wiki-border-accent); }

/* ---------------------------------------------------------- wiki home */
.wiki-home {
	max-width: 1180px;
	margin: 0 auto;
	padding: calc(var(--wiki-header-h) + 56px) 3% 80px;
}
.wiki-home-head { text-align: center; margin-bottom: 52px; }
.wiki-home-head h1 {
	font-size: 42px;
	font-weight: 500;
	color: var(--wiki-heading);
	margin: 0 0 16px;
}
/* the same thin gradient rule the landing draws under its section titles */
.wiki-home-head h1::after {
	content: "";
	display: block;
	width: 96px;
	height: 1px;
	margin: 20px auto 0;
	background: linear-gradient(to right,
		rgba(64, 196, 255, 0) 0%,
		rgba(64, 196, 255, 0.9) 50%,
		rgba(64, 196, 255, 0) 100%);
}
.wiki-home-head p {
	max-width: 620px;
	margin: 22px auto 0;
	font-size: 16px;
	font-weight: 300;
	line-height: 1.6;
	color: var(--wiki-muted);
}

.wiki-home-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}
/* one card per category, all identical: the whole card is the link and it opens
   the first article of that category */
.wiki-home-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px 22px;
	background: var(--wiki-surface);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 4px;
	color: var(--wiki-heading);
	text-decoration: none;
	transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.wiki-home-card:hover {
	background: var(--wiki-surface-hover);
	border-color: rgba(64, 196, 255, 0.28);
	transform: translateY(-2px);
	color: var(--wiki-accent);
}
.wiki-home-card img { flex: 0 0 30px; opacity: 0.92; }
.wiki-home-card-name {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
}
.wiki-home-card .bi-chevron-right {
	margin-left: auto;
	font-size: 13px;
	color: var(--wiki-muted);
	transition: color 0.3s ease, transform 0.3s ease;
}
.wiki-home-card:hover .bi-chevron-right { color: var(--wiki-accent); transform: translateX(3px); }

@media (max-width: 767.98px) {
	.wiki-home { padding-top: calc(var(--wiki-header-h) + 32px); }
	.wiki-home-head h1 { font-size: 30px; }
}

/* ---------------------------------------------------------- footer */
/* width: 100% is required, not decorative: `margin: 0 auto` on a flex item cancels
   the cross-axis stretch, and both containers would shrink to their content */
.wiki-page .wiki-shell,
.wiki-page .wiki-home { flex: 1 0 auto; width: 100%; }
.wiki-page footer {
	flex-shrink: 0;
	background-color: #020a13;
	border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1399.98px) {
	.wiki-shell { grid-template-columns: 268px minmax(0, 1fr) 210px; gap: 34px; }
}

/* the table of contents is the first thing to go */
@media (max-width: 1199.98px) {
	.wiki-shell { grid-template-columns: 262px minmax(0, 1fr); gap: 30px; }
	.wiki-toc { display: none; }
}

/* single column: the article leads, the index becomes a drawer */
@media (max-width: 991.98px) {
	.wiki-shell {
		grid-template-columns: minmax(0, 1fr);
		padding-top: calc(var(--wiki-header-h) + 18px);
		gap: 0;
	}
	.wiki-nav-toggle {
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		margin-bottom: 18px;
		padding: 12px 16px;
		background: var(--wiki-surface);
		border: 1px solid rgba(255, 255, 255, 0.06);
		border-radius: 4px;
		color: #e6edf6;
		font-size: 15px;
		font-weight: 300;
		cursor: pointer;
	}
	.wiki-nav-toggle .chev { margin-left: auto; color: var(--wiki-muted); font-size: 13px; transition: transform 0.25s ease; }
	.wiki-nav-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
	.wiki-sidebar {
		position: static;
		max-height: none;
		overflow: visible;
		display: none;
		margin-bottom: 26px;
	}
	.wiki-sidebar.open { display: block; }
	.wiki-sidebar-title { display: none; }
	.wiki-content { font-size: 15.5px; }
	.wiki-content h1 { font-size: 30px; }
	.wiki-content h2 { font-size: 21px; margin-top: 40px; }
	.wiki-page a.primary { display: none; }
}

@media (max-width: 575.98px) {
	.wiki-shell { padding-left: 5%; padding-right: 5%; }
}
