/*
	Yompster Docs Styles
	- Modern, responsive, accessible
	- Light/Dark theme via CSS variables
*/

:root {
	--brand-accent: #6b4eff;
	--brand-accent-2: #22c1c3;
	--text: #14171a;
	--text-muted: #5b7083;
	--bg: #ffffff;
	--bg-elevated: #f7f9fa;
	--border: #e6ecf0;
	--code-bg: #f5f7fa;
	--code-text: #0f172a;
	--link: #3b82f6;
	--link-hover: #1d4ed8;
	--focus: #f59e0b;
}

:root.dark {
	--text: #e5e7eb;
	--text-muted: #9ca3af;
	--bg: #0b1220;
	--bg-elevated: #0e1627;
	--border: #1f2937;
	--code-bg: #0a1020;
	--code-text: #e5e7eb;
	--link: #60a5fa;
	--link-hover: #93c5fd;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
}

/* Layout */
.header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: saturate(180%) blur(6px);
	background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.6));
	border-bottom: 1px solid var(--border);
}
:root.dark .header { background: linear-gradient(180deg, rgba(11,18,32,0.75), rgba(11,18,32,0.6)); }

.header-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.5rem 1rem;
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	color: inherit;
	font-weight: 700;
}
.logo .mark {
	width: 28px; height: 28px; border-radius: 6px;
	background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-2));
}

.nav-spacer { flex: 1 1 auto; }

.search input[type="search"] {
	width: 320px;
	max-width: 40vw;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg-elevated);
	color: var(--text);
}

.toggle {
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	color: var(--text);
	border-radius: 8px;
	padding: 0.45rem 0.7rem;
	cursor: pointer;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 2rem;
	padding: 1.25rem;
}

.sidebar {
	position: sticky;
	top: 64px;
	height: calc(100vh - 64px);
	overflow: auto;
	border-right: 1px solid var(--border);
	padding-right: 1rem;
}

.sidebar h3 { font-size: 0.95rem; margin: 1rem 0 0.5rem; color: var(--text-muted); }
.sidebar a {
	display: block;
	padding: 0.375rem 0.25rem;
	color: var(--text);
	text-decoration: none;
	border-radius: 6px;
}
.sidebar a.active, .sidebar a:hover {
	background: var(--bg-elevated);
	color: var(--text);
}

.main {
	min-width: 0;
}

article h1 { font-size: 2rem; margin-top: 0.5rem; }
article h2 { font-size: 1.25rem; margin-top: 2rem; }
article h3 { font-size: 1.05rem; margin-top: 1.25rem; color: var(--text); }

article p, article li { color: var(--text); }

article pre, article code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

article pre {
	background: var(--code-bg);
	color: var(--code-text);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 1rem;
	overflow: auto;
}

article code { background: var(--bg-elevated); padding: 0.1rem 0.3rem; border-radius: 4px; }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: 2rem 1rem; color: var(--text-muted); }

/* Buttons and links */
.button, .btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	text-decoration: none;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	color: var(--text);
}
.button.primary {
	background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-2));
	border: none;
	color: white;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* Utilities */
.lead { color: var(--text-muted); font-size: 1.05rem; }
.kbd { font: inherit; background: var(--bg-elevated); border: 1px solid var(--border); padding: 0.1rem 0.35rem; border-radius: 6px; }

.skip-link {
	position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: static; width: auto; height: auto; padding: 0.5rem; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Responsive */
@media (max-width: 960px) {
	.container { grid-template-columns: 1fr; gap: 1rem; }
	.sidebar { position: static; height: auto; border-right: none; padding-right: 0; }
	.search input[type="search"] { width: 180px; }
}

/* Code block copy button (optional hook) */
.code-block { position: relative; }
.copy-btn {
	position: absolute; right: 0.5rem; top: 0.5rem;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	border-radius: 6px; padding: 0.25rem 0.5rem; cursor: pointer;
}
