.niomah-faq {
	--niomah-faq-sticky-top: calc(var(--niomah-header-top, 0px) + var(--niomah-header-height, 5rem));
	background: var(--wp--preset--color--warm-white, #faf8f5);
	color: var(--wp--preset--color--ink, #272522);
	padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem);
}

.niomah-faq .niomah-faq-intro {
	max-width: 55rem;
	margin-inline: auto;
	text-align: center;
}

.niomah-faq-intro h1 {
	font-size: clamp(2.75rem, 6vw, 5.5rem);
	line-height: 1;
	text-wrap: balance;
}

.niomah-faq .niomah-faq-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
	max-width: 72rem;
	margin: clamp(2rem, 5vw, 4.5rem) auto 0;
	gap: clamp(1.25rem, 5vw, 4.5rem);
}

.niomah-faq-layout > .wp-block-column:has(> .niomah-faq-index) {
	position: sticky;
	inset-block-start: var(--niomah-faq-sticky-top);
	align-self: start;
	z-index: 2;
	max-block-size: calc(100dvb - var(--niomah-faq-sticky-top));
	overflow-y: auto;
	background: var(--wp--preset--color--warm-white, #faf8f5);
}

.niomah-faq-index ul {
	list-style: none;
	margin: 0;
	padding-inline: 4px;
}

.niomah-faq-index li {
	border-block-end: 1px solid #ded9d3;
}

.niomah-faq-index a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-inline: .25rem;
}

.niomah-faq-section {
	scroll-margin-block-start: 1rem;
}

.niomah-faq-section + .niomah-faq-section {
	margin-block-start: clamp(2rem, 5vw, 4rem);
}

.niomah-faq-section h2 {
	font-size: clamp(1.9rem, 3.5vw, 3.2rem);
	line-height: 1.1;
}

.niomah-faq-section details {
	border-block-end: 1px solid #ded9d3;
	margin-block: 0;
}

.niomah-faq-section summary {
	box-sizing: border-box;
	min-height: 44px;
	padding-block: .8rem;
	cursor: pointer;
	font-weight: 600;
}

.niomah-faq-section details p {
	max-width: 65ch;
	margin-block: 0 1rem;
}

.niomah-faq :is(a, summary):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (max-width: 600px) {
	.niomah-faq {
		--niomah-faq-index-height: calc(max(44px, 2.75rem) + .5rem + 11px);
	}

	.niomah-faq .niomah-faq-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.niomah-faq-layout > .wp-block-column:has(> .niomah-faq-index) {
		overflow: visible;
	}

	.niomah-faq-index ul {
		display: flex;
		flex-wrap: nowrap;
		gap: 1rem;
		box-sizing: border-box;
		block-size: var(--niomah-faq-index-height);
		overflow-x: auto;
		padding-block: .25rem;
		scrollbar-width: thin;
	}

	.niomah-faq-index li {
		flex: none;
		white-space: nowrap;
	}

	.niomah-faq-section {
		/* The document scroll padding already accounts for the header and admin bar. */
		scroll-margin-block-start: calc(var(--niomah-faq-index-height) + 1rem);
	}
}
