/**
 * Documentation page styling for Foundation Redesign.
 */

/* Two-column docs layout: sticky category sidebar + content. Shared by the
   /docs/ hub and the standalone single-doc pages. */
.fr-theme .fr-docs {
	display: grid;
	grid-template-columns: 1fr;
	gap: 3rem;
	align-items: start;
}

@media (min-width: 1024px) {
	.fr-theme .fr-docs {
		grid-template-columns: 280px 1fr;
	}
}

/* Hub category sections: space-y-12 is not in the compiled Tailwind
   bundle, so give sections a real before-gap here. */
.fr-theme .fr-docs-hub {
	display: flex;
	flex-direction: column;
	gap: 4rem;
}

.fr-theme .fr-docs__cat-icon,
.fr-theme .fr-docs aside svg {
	display: inline-flex;
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}

.fr-theme .fr-docs__cat-icon svg {
	width: 100%;
	height: 100%;
}

.fr-theme .fr-docs [data-doc-link].is-active {
	border-left-color: var(--primary);
	color: var(--foreground);
	font-weight: 600;
}

.fr-theme .fr-docs [data-doc][hidden] {
	display: none;
}

/* Doc page / hub titles sit under a tight kicker; give them real top air. */
.fr-theme .fr-docs-doc > h2,
.fr-theme .fr-docs-hub__section h2 {
	margin-top: 2rem;
}

/* ── Doc content blocks ───────────────────────────────────────────────────── */

.fr-theme .fr-doc-h {
	margin: 2.25rem 0 0;
	font-family: 'Foundation Display', sans-serif;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--foreground);
}

.fr-theme .fr-docs__card > p {
	margin: 0.875rem 0 0;
	line-height: 1.7;
}

.fr-theme .fr-doc-bullets {
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.fr-theme .fr-doc-bullets li {
	position: relative;
	padding-left: 1.25rem;
	line-height: 1.6;
	color: var(--foreground);
}

.fr-theme .fr-doc-bullets li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 0.55em;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--primary);
}

.fr-theme .fr-doc-steps {
	margin: 0.875rem 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.fr-theme .fr-doc-steps li {
	display: grid;
	grid-template-columns: 2.125rem 1fr;
	gap: 1rem;
	align-items: start;
}

.fr-theme .fr-doc-steps__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.125rem;
	height: 2.125rem;
	border-radius: 0.375rem;
	background: var(--secondary);
	color: var(--primary);
	font-size: 0.75rem;
	font-weight: 700;
}

.fr-theme .fr-doc-steps li > span:last-child {
	padding-top: 0.375rem;
	line-height: 1.6;
}

.fr-theme .fr-doc-code {
	margin: 1.125rem 0 1.5rem;
	padding: 1.25rem;
	border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
	border-radius: 0.5rem;
	background: var(--foreground);
	color: var(--background);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.8125rem;
	line-height: 1.65;
	overflow-x: auto;
	white-space: pre;
}

.fr-theme .fr-doc-code code {
	font: inherit;
	color: inherit;
	background: none;
	padding: 0;
}

.fr-theme .fr-doc-note {
	display: flex;
	gap: 0.75rem;
	margin: 1.125rem 0 0;
	padding: 1.125rem 1.25rem;
	border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
	border-radius: 0.5rem;
	background: color-mix(in srgb, var(--primary) 8%, var(--background));
}

.fr-theme .fr-doc-note__mark {
	flex-shrink: 0;
	color: var(--primary);
	line-height: 1.6;
}

.fr-theme .fr-doc-note p {
	margin: 0;
	line-height: 1.6;
	color: var(--foreground);
}

.fr-theme .fr-doc-qa {
	margin: 1.125rem 0 0;
	display: flex;
	flex-direction: column;
	gap: 1.375rem;
}

.fr-theme .fr-doc-qa__item h4 {
	margin: 0 0 0.375rem;
	font-family: 'Foundation Display', sans-serif;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--foreground);
}

.fr-theme .fr-doc-qa__item p {
	margin: 0;
	color: var(--muted-foreground);
	line-height: 1.6;
}

.fr-theme .fr-doc-image,
.fr-theme .fr-doc-figure {
	margin: 1.375rem 0 0;
}

.fr-theme .fr-doc-image img,
.fr-theme .fr-doc-figure img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--border);
	border-radius: 0.625rem;
	box-shadow: 0 8px 24px color-mix(in srgb, var(--foreground) 6%, transparent);
}

.fr-theme .fr-doc-image figcaption,
.fr-theme .fr-doc-figure figcaption {
	margin-top: 0.75rem;
	padding-left: 0.875rem;
	border-left: 2px solid color-mix(in srgb, var(--primary) 60%, var(--border));
	color: var(--muted-foreground);
	font-size: 0.8125rem;
	font-weight: 400;
	font-style: italic;
	line-height: 1.5;
	letter-spacing: 0;
	text-transform: none;
}

.fr-theme .fr-doc-videos {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin-top: 1.125rem;
}

@media (min-width: 768px) {
	.fr-theme .fr-doc-videos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.fr-theme .fr-doc-video {
	margin: 0;
}

.fr-theme .fr-doc-video__embed {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	border: 1px solid var(--border);
	border-radius: 0.625rem;
	overflow: hidden;
	background: var(--foreground);
	box-shadow: 0 8px 24px color-mix(in srgb, var(--foreground) 6%, transparent);
}

.fr-theme .fr-doc-video__embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.fr-theme .fr-doc-video__caption {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin-top: 0.625rem;
}

.fr-theme .fr-doc-video__title {
	color: var(--foreground);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.45;
}

.fr-theme .fr-doc-video__duration {
	color: var(--muted-foreground);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* First block in a card stays flush with the card padding. */
.fr-theme .fr-doc-h:first-child,
.fr-theme .fr-doc-bullets:first-child,
.fr-theme .fr-doc-steps:first-child,
.fr-theme .fr-doc-code:first-child,
.fr-theme .fr-doc-note:first-child,
.fr-theme .fr-doc-qa:first-child,
.fr-theme .fr-doc-image:first-child,
.fr-theme .fr-doc-figure:first-child,
.fr-theme .fr-doc-videos:first-child,
.fr-theme .fr-docs__card > p:first-child,
.fr-theme .fr-docs__card > .fr-doc-h:first-child,
.fr-theme .fr-docs__card > .fr-doc-bullets:first-child,
.fr-theme .fr-docs__card > .fr-doc-steps:first-child,
.fr-theme .fr-docs__card > .fr-doc-code:first-child,
.fr-theme .fr-docs__card > .fr-doc-note:first-child,
.fr-theme .fr-docs__card > .fr-doc-qa:first-child,
.fr-theme .fr-docs__card > .fr-doc-image:first-child,
.fr-theme .fr-docs__card > .fr-doc-figure:first-child,
.fr-theme .fr-docs__card > .fr-doc-videos:first-child {
	margin-top: 0;
}

/* ── Prev / next pager ────────────────────────────────────────────────────── */

.fr-theme .fr-docs__pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 2.5rem;
}

.fr-theme .fr-docs__pager-link {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1.25rem;
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	background: var(--background);
	text-decoration: none;
	transition: border-color 0.15s ease;
}

.fr-theme .fr-docs__pager-link:hover {
	border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.fr-theme .fr-docs__pager-link--next {
	grid-column: 2;
	text-align: right;
}

.fr-theme .fr-docs__pager-link span {
	color: var(--muted-foreground);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.fr-theme .fr-docs__pager-link strong {
	color: var(--foreground);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
}

@media (max-width: 1023px) {
	.fr-theme .fr-docs__pager {
		grid-template-columns: 1fr;
	}

	.fr-theme .fr-docs__pager-link--next {
		grid-column: 1;
		text-align: left;
	}
}
