/* ElevenCode docs / FAQ: a table of contents beside a stack of question cards. Every card has
   a stable anchor and a link icon; the heading offset clears the sticky header. Mobile-first. */

.docs__head {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin-block-end: var(--space-10);
}

.docs__title {
	margin-block: var(--space-2) 0;
}

.docs__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-6);
	align-items: start;
}

.docs__toc {
	padding: var(--space-4) var(--space-5);
	background: var(--surface);
}

.docs__toc-title {
	margin-block-end: var(--space-3);
	color: var(--text-secondary);
	font-size: var(--text-xs);
	font-weight: var(--weight-medium);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.docs__toc-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.docs__toc-link {
	display: inline-flex;
	align-items: center;
	min-block-size: 32px;
	color: var(--text-secondary);
	font-size: var(--text-md);
	text-decoration: none;
}

.docs__toc-link:hover {
	color: var(--text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.docs__list {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.doc {
	padding: clamp(20px, 3vw, 28px);
	scroll-margin-block-start: 88px;
	background: var(--surface);
}

/* The question keeps its line; only the icon is pinned to the far end. */
.doc__title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-3);
	font-size: var(--text-xl);
	font-weight: var(--weight-semibold);
	letter-spacing: -0.02em;
	line-height: 1.3;
}

.doc__anchor {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	inline-size: 32px;
	block-size: 32px;
	border-radius: var(--radius-sm);
	color: var(--text-secondary);
	opacity: 0.55;
	text-decoration: none;
}

.doc__anchor:hover {
	background: var(--surface-hover);
	color: var(--text);
	opacity: 1;
}

.doc__anchor:focus-visible {
	opacity: 1;
}

.doc__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin-block-start: var(--space-3);
	color: var(--text-secondary);
}

.doc__body p {
	max-inline-size: 68ch;
}

.doc__link {
	align-self: flex-start;
	margin-block-start: var(--space-4);
	color: var(--text);
	font-weight: var(--weight-medium);
	text-underline-offset: 3px;
}

@media (min-width: 761px) {
	.doc {
		padding: var(--space-6);
	}
}

@media (min-width: 1001px) {
	.docs__layout {
		grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
		gap: var(--space-8);
	}

	.docs__toc {
		position: sticky;
		inset-block-start: 96px;
	}
}
