/**
 * FAQ: `grid gap-12 lg:grid-cols-12`, the topics in 3 columns, the groups
 * in 9 `space-y-12`.
 *
 * The topics: `flex flex-wrap gap-2`, each a pill `rounded-full border
 * px-3 py-1.5 text-sm` muted; from 1024px a column `sticky top-28
 * border-l`, each topic `border-l-2 px-4 py-2`, its rule dark red on hover.
 *
 * A group: its heading `text-2xl font-bold tracking-tight`, under it `mt-4`
 * the accordion, `divide-y rounded-lg border bg-card px-5`. A question is
 * `py-4 font-medium` with the chevron turning on open; its answer `pb-4
 * text-base leading-relaxed` muted, paragraphs and lists `mt-3`, list items
 * `space-y-1`, bullets `pl-5`.
 */

.sba-c-faq .sba-c-faq-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 48px;
}

.sba-c-faq .sba-c-faq-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sba-c-faq .sba-c-faq-nav li {
	margin: 0;
}

.sba-c-faq .sba-c-faq-nav a {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--sba-border);
	border-radius: 9999px;
	color: var(--sba-slate);
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
	transition: color var(--sba-duration-hover) ease, border-color var(--sba-duration-hover) ease;
}

.sba-c-faq .sba-c-faq-nav a:hover {
	border-color: hsl(var(--sba-red-hsl) / 0.4);
	color: var(--sba-red-dark);
}

.sba-c-faq .sba-c-faq-groups {
	display: grid;
	gap: 48px;
}

.sba-c-faq .sba-c-faq-group {
	scroll-margin-top: 112px;
}

.sba-c-faq .sba-c-faq-group-title {
	margin: 0;
	color: var(--sba-charcoal);
	font-family: var(--sba-font-sans);
	font-size: 24px;
	font-weight: var(--sba-heading-weight);
	letter-spacing: var(--sba-heading-tracking);
	line-height: 32px;
}

.sba-c-faq .sba-c-faq-list {
	margin-top: 16px;
	padding: 0 20px;
	border: 1px solid var(--sba-border);
	border-radius: var(--sba-radius);
	background-color: var(--sba-surface);
}

.sba-c-faq .sba-c-faq-item {
	/* A question with a fixed anchor clears the sticky header, as the
	   groups do. */
	scroll-margin-top: 112px;
}

.sba-c-faq .sba-c-faq-item + .sba-c-faq-item {
	border-top: 1px solid var(--sba-border);
}

.sba-c-faq .sba-c-faq-item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	color: var(--sba-charcoal);
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
	list-style: none;
	cursor: pointer;
	transition: color var(--sba-duration-hover) ease;
}

.sba-c-faq .sba-c-faq-item summary::-webkit-details-marker {
	display: none;
}

.sba-c-faq .sba-c-faq-item summary:hover {
	color: var(--sba-red-dark);
}

.sba-c-faq .sba-c-faq-item summary:focus-visible {
	outline: 2px solid var(--sba-ring);
	outline-offset: 2px;
}

.sba-c-faq .sba-c-faq-item summary .sba-i {
	flex: 0 0 auto;
	font-size: 16px;
	transition: transform 0.2s ease;
}

.sba-c-faq .sba-c-faq-item[open] summary .sba-i {
	transform: rotate(180deg);
}

.sba-c-faq .sba-c-faq-answer {
	padding-bottom: 16px;
	color: var(--sba-slate);
	font-size: 16px;
	line-height: 1.625;
}

.sba-c-faq .sba-c-faq-answer > *,
.sba-c-faq .sba-c-faq-answer li {
	margin: 0;
}

.sba-c-faq .sba-c-faq-answer :is(p, li) {
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.sba-c-faq .sba-c-faq-answer > * + * {
	margin-top: 12px;
}

.sba-c-faq .sba-c-faq-answer ul {
	padding-left: 20px;
	list-style: disc;
}

.sba-c-faq .sba-c-faq-answer li + li {
	margin-top: 4px;
}

/* Opening and closing slide where the browser animates to auto. */
@supports selector(::details-content) {
	.sba-c-faq .sba-c-faq-item {
		interpolate-size: allow-keywords;
	}

	.sba-c-faq .sba-c-faq-item::details-content {
		block-size: 0;
		overflow: hidden;
		transition: block-size 0.2s ease-out, content-visibility 0.2s ease-out allow-discrete;
	}

	.sba-c-faq .sba-c-faq-item[open]::details-content {
		block-size: auto;
	}
}

@media (min-width: 1024px) {
	.sba-c-faq .sba-c-faq-layout {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.sba-c-faq .sba-c-faq-nav {
		grid-column: span 3;
	}

	.sba-c-faq .sba-c-faq-groups {
		grid-column: span 9;
	}

	.sba-c-faq .sba-c-faq-layout > .sba-c-faq-groups:only-child {
		grid-column: 1 / -1;
	}

	.sba-c-faq .sba-c-faq-nav ul {
		position: sticky;
		top: 112px;
		flex-direction: column;
		gap: 0;
		border-left: 1px solid var(--sba-border);
	}

	.sba-c-faq .sba-c-faq-nav a {
		margin-left: -1px;
		padding: 8px 16px;
		border: 0;
		border-left: 2px solid transparent;
		border-radius: 0;
	}

	.sba-c-faq .sba-c-faq-nav a:hover {
		border-left-color: var(--sba-red-dark);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sba-c-faq .sba-c-faq-item::details-content,
	.sba-c-faq .sba-c-faq-item summary .sba-i {
		transition: none;
	}
}
