.softextheme-faq {
	margin-top: 3rem;
}

.softextheme-faq__item {
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}

.softextheme-faq__item:first-child {
	border-top: 1px solid var(--wp--preset--color--accent-6);
}

.softextheme-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 0.25rem;
	cursor: pointer;
	font-weight: 600;
	font-size: 1.05rem;
	list-style: none;
	transition: color 0.15s ease;
}

.softextheme-faq__question::-webkit-details-marker {
	display: none;
}

.softextheme-faq__question:hover {
	color: var( --sx-brand-text );
}

.softextheme-faq__icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	position: relative;
}

.softextheme-faq__icon::before,
.softextheme-faq__icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	transform: translate( -50%, -50% );
}

.softextheme-faq__icon::before {
	width: 12px;
	height: 2px;
}

.softextheme-faq__icon::after {
	width: 2px;
	height: 12px;
	transition: opacity 0.15s ease;
}

.softextheme-faq__item[open] .softextheme-faq__icon::after {
	opacity: 0;
}

.softextheme-faq__item[open] .softextheme-faq__question {
	color: var( --sx-brand-text );
}

.softextheme-faq__answer {
	padding: 0 0.25rem 1.5rem;
	color: color-mix( in srgb, currentColor 70%, transparent );
}

.softextheme-faq__answer :first-child {
	margin-top: 0;
}

.softextheme-faq__answer :last-child {
	margin-bottom: 0;
}

/*
 * Opening a question used to be instantaneous — the answer simply existed, and
 * the questions under it jumped down the page.
 *
 * A <details> element cannot be folded the way the rest of the site folds:
 * the browser owns the show and hide, and until recently there was nothing in
 * CSS to get between them. ::details-content is that handle, and
 * interpolate-size is what lets a height animate to "auto" — the content's real
 * height — instead of to a number guessed in advance.
 *
 * Wrapped in @supports because the pair is recent. Where it is missing the
 * answer appears at once, which is exactly what it did before, so nothing is
 * lost by not having it.
 */
@supports ( interpolate-size: allow-keywords ) {
	.softextheme-faq {
		interpolate-size: allow-keywords;
	}

	/*
	 * Not on items the product page's script has taken over. It slides the
	 * answer itself, and with this running as well the panel moved twice on
	 * every click — it grew, then collapsed. One animation per accordion.
	 */
	.softextheme-faq__item:not( .is-js-slide )::details-content {
		block-size: 0;
		overflow: hidden;
		transition:
			block-size var( --sx-transition-base ) var( --sx-ease ),
			content-visibility var( --sx-transition-base ) var( --sx-ease ) allow-discrete;
	}

	.softextheme-faq__item:not( .is-js-slide )[open]::details-content {
		block-size: auto;
	}
}

/* The plus turns into a minus rather than just losing its upright stroke. */
.softextheme-faq__icon::after {
	transition:
		opacity var( --sx-transition-fast ) var( --sx-ease ),
		transform var( --sx-transition-fast ) var( --sx-ease );
}

.softextheme-faq__item[open] .softextheme-faq__icon::after {
	transform: translate( -50%, -50% ) rotate( 90deg );
}
