/* ===========================================================
   GUIDE PAGE
=============================================================== */
.guide-layout {
	box-sizing: border-box;
	width: 100%;
	max-width: 44rem;
	min-width: 0;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 3rem;
}
.guide-page {
	min-width: 0;
}
@media (min-width: 1025px) {
	.guide-layout {
		display: grid;
		grid-template-columns: 15rem minmax(0, 44rem);
		gap: 3.5rem;
		justify-content: center;
		align-items: start;
		max-width: none;
	}
	.guide-head {
		grid-column: 1 / -1;
		margin-bottom: 0;
	}
}

/* --- SECTIONS --- */
.guide-toc {
	display: none;
}
.guide-toc-item {
	display: block;
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--border-color);
	border-radius: 2px;
	font-family: var(--font-heading);
	font-size: 0.9rem;
	line-height: 1.3;
	color: var(--text-heading);
	text-decoration: none;
	text-shadow: none;
	transition: none;
}
@media (hover: hover) {
	.guide-toc-item:hover { border-color: var(--accent); }
}
.guide-toc-item.is-active {
	background: rgba(var(--accent-rgb), 0.12);
	border-color: var(--accent);
	color: var(--accent);
}
.guide-num {
	color: var(--accent);
}
@media (min-width: 1025px) {
	.guide-toc {
		position: sticky;
		top: calc(var(--nav-h) + 1.5rem);
		display: flex;
		flex-direction: column;
		gap: 0.4rem;
		max-height: calc(100vh - var(--nav-h) - 3rem);
		padding: 0.25rem 0.25rem 0.25rem 0;
		overflow-y: auto;
		scrollbar-width: thin;
		scrollbar-color: var(--border-color) transparent;
	}
}

/* --- HEADER --- */
.guide-head {
	margin-bottom: 1.75rem;
}
.guide-dateline {
	padding-bottom: 0.4rem;
	margin: 0 0 0.9rem;
	border-bottom: 1px solid var(--border-color);
	font-size: 0.85rem;
	font-variant: small-caps;
	letter-spacing: 0.1em;
	color: var(--text-muted);
}
.guide-dateline a {
	color: var(--accent);
	text-decoration: none;
}
.guide-page-title {
	font-family: var(--font-display);
	font-size: 1.9rem;
	line-height: 1.25;
}
.guide-page-subtitle {
	margin: 0.35rem 0 0;
	font-style: italic;
	color: var(--text-accent);
}

/* --- BUTTONS --- */
.guide-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.1rem;
}
.guide-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.4rem 0.9rem;
	font: inherit;
	font-size: 0.85rem;
	color: var(--text-primary);
	background: none;
	border: 1px solid var(--border-color);
	border-radius: 999px;
	text-decoration: none;
	cursor: pointer;
}
.guide-btn svg { width: 1rem; height: 1rem; }
.guide-btn.success { color: var(--success-color); border-color: var(--success-color); }
@media (hover: hover) {
	.guide-btn:hover { color: var(--accent); border-color: var(--accent); }
}

/* --- BODY --- */
.guide-body {
	display: flow-root;
	font-size: 1.1rem;
	line-height: 1.7;
	overflow-wrap: break-word;
}
.guide-body p,
.guide-body li {
	text-align: justify;
	text-justify: inter-word;
	hyphens: auto;
	-webkit-hyphens: auto;
	text-wrap: pretty;
}
.guide-body p { margin: 0 0 1.1em; }
.guide-body a { overflow-wrap: anywhere; }
.guide-body h2 {
	clear: both;
	margin: 2.5rem 0 0.9rem;
	padding-bottom: 0.35em;
	border-bottom: 1px solid var(--border-color);
	font-family: var(--font-display);
	font-size: 1.45rem;
	line-height: 1.25;
	scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.guide-body h3 {
	margin: 1.5em 0 0.4em;
	font-family: var(--font-display);
	font-size: 1.15rem;
	scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.guide-body ul,
.guide-body ol {
	margin: 0 0 1.1em;
	padding-left: 1.4em;
}
.guide-body li { margin-bottom: 0.35em; }
.guide-body blockquote {
	margin: 1em 0;
	padding-left: 1em;
	border-left: 3px solid var(--accent);
	color: var(--text-accent);
}
.guide-body hr {
	height: 0;
	margin: 2em 0;
	border: 0;
	border-top: 3px double var(--border-color);
}
.guide-body mark {
	padding: 0 0.1em;
	background: rgba(var(--accent-rgb), 0.28);
	color: inherit;
}

/* --- CODE --- */
.guide-body code {
	padding: 0.05em 0.3em;
	border: 1px solid var(--border-color);
	border-radius: 2px;
	background: rgba(var(--bg-primary-rgb), 0.6);
	font-family: var(--font-mono);
	font-size: 1em;
	overflow-wrap: anywhere;
	word-break: break-all; /* long URLs fill the line instead of stretching justified spaces */
}
.guide-code {
	position: relative;
	margin: 1.25em 0;
}
.guide-copy {
	position: absolute;
	top: 0.45rem;
	right: 0.45rem;
	padding: 0.2rem 0.55rem;
	border: 1px solid var(--border-color);
	border-radius: 2px;
	background: var(--bg-primary);
	font-family: var(--font-nav);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	color: var(--text-muted);
	cursor: pointer;
}
@media (hover: hover) {
	.guide-copy:hover { color: var(--accent); border-color: var(--accent); }
}
.guide-body pre {
	max-width: 100%;
	margin: 0;
	padding: 0.9em 4.5rem 0.9em 1.1em;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--border-color);
	background: rgba(var(--bg-primary-rgb), 0.6);
	font-family: var(--font-mono);
	font-size: 1em;
	line-height: 1.5;
	text-align: left;
	white-space: pre;
}
.guide-body pre code {
	padding: 0;
	border: 0;
	background: none;
	font-size: inherit;
	overflow-wrap: normal;
}

/* --- PICTURES --- */
.img-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin: 1.125rem 0;
}
.img-block img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border-color);
	border-radius: 2px;
}
.img-caption {
	margin-top: 0.5rem;
	font-size: 0.82em;
	font-style: italic;
	line-height: 1.35;
	text-align: center;
	color: var(--text-muted);
}
.img-caption:empty { display: none; }
.align-left img, .align-right img, .align-center img, .align-full img {
	display: block;
	width: 100%;
	height: auto;
}
.clear-fix { clear: both; display: block; height: 0; }
@media (min-width: 768px) {
	.align-left {
		float: left;
		width: auto;
		max-width: 45%;
		margin: 0.3em 1.5rem 0.25rem 0;
	}
	.align-right {
		float: right;
		width: auto;
		max-width: 45%;
		margin: 0.3em 0 0.25rem 1.5rem;
	}
	.align-center img {
		width: auto;
		max-height: 600px;
	}
}

/* --- TABLES --- */
.table-wrapper { overflow-x: auto; margin: 1.25rem 0; }
.guide-body table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.guide-body th,
.guide-body td { padding: 0.5em; border-bottom: 1px solid var(--border-color); text-align: left; }

/* --- CALLOUTS --- */
.guide-body .callout {
	--callout: 96, 165, 250;
	display: flow-root;
	margin: 1em 0;
	padding: 0.7em 1em;
	background: rgba(var(--callout), 0.09);
	border-left: 3px solid rgb(var(--callout));
	font-size: 0.95em;
}
.guide-body .callout-title {
	font-family: var(--font-nav);
	font-size: 0.72em;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgb(var(--callout));
	margin: 0 0 0.4em;
}
.guide-body .callout p:last-child { margin-bottom: 0; }
.guide-body .callout-tip { --callout: 45, 212, 191; }
.guide-body .callout-warning { --callout: 234, 179, 8; }
.guide-body .callout-danger { --callout: 248, 113, 113; }
.guide-body .callout-question { --callout: 192, 132, 252; }
.guide-body .callout-example { --callout: 148, 163, 184; }
.guide-body .callout-disclaimer { --callout: 63, 155, 90; }
[data-theme="light"] .guide-body .callout-note { --callout: 37, 99, 235; }
[data-theme="light"] .guide-body .callout-tip { --callout: 15, 118, 110; }
[data-theme="light"] .guide-body .callout-warning { --callout: 161, 98, 7; }
[data-theme="light"] .guide-body .callout-danger { --callout: 185, 28, 28; }
[data-theme="light"] .guide-body .callout-question { --callout: 126, 34, 206; }
[data-theme="light"] .guide-body .callout-example { --callout: 71, 85, 105; }
[data-theme="light"] .guide-body .callout-disclaimer { --callout: 46, 125, 50; }

@media (max-width: 1024px) {
	.guide-sec > h2 {
		position: relative;
		margin: 0;
		padding: 0.9rem 1.75rem 0.9rem 0;
		cursor: pointer;
	}
	.guide-sec > h2::after {
		content: "";
		position: absolute;
		top: 50%;
		right: 0.3rem;
		width: 0.45rem;
		height: 0.45rem;
		margin-top: -0.35rem;
		border-right: 1.5px solid var(--text-muted);
		border-bottom: 1.5px solid var(--text-muted);
		transform: rotate(45deg);
	}
	.guide-sec.is-open > h2::after {
		margin-top: -0.1rem;
		transform: rotate(-135deg);
	}
	.guide-sec-body { display: none; }
	.guide-sec.is-open > .guide-sec-body {
		display: flow-root;
		padding: 1rem 0 0.5rem;
	}
}

@media (max-width: 600px) {
	.guide-layout { padding: 1.5rem 1rem 2.5rem; }
	.guide-page-title { font-size: 1.6rem; }
	.guide-body { font-size: 1.02rem; line-height: 1.65; }
	.guide-body h2 { font-size: 1.3rem; }
}
