/*
 * Stone Cliff Digital — FAQ Accordion
 * Reusable accessible accordion foundation. Loaded only on pages that use
 * template-parts/faq-accordion.php.
 */

.faq-accordion {
	display: flex;
	flex-direction: column;
}

.faq-item {
	border-bottom: 1px solid var(--sc-slate-200);
}

.section--dark .faq-item,
.section--dark-deep .faq-item {
	border-bottom-color: var(--sc-ink-4);
}

.faq-item__heading {
	margin: 0;
}

.faq-item__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sc-space-200);
	width: 100%;
	padding-block: var(--sc-space-200);
	text-align: left;
	font-family: var(--sc-font-heading);
	font-size: var(--sc-text-h3);
	font-weight: 700;
	color: inherit;
}

.faq-item__icon {
	position: relative;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.faq-item__icon::before,
.faq-item__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	transform: translate(-50%, -50%);
	transition: transform var(--sc-transition-fast);
}

.faq-item__icon::before {
	width: 16px;
	height: 2px;
}

.faq-item__icon::after {
	width: 2px;
	height: 16px;
}

.faq-item.is-open .faq-item__icon::after {
	transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
}

.faq-item__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--sc-transition-base);
}

.faq-item.is-open .faq-item__panel {
	grid-template-rows: 1fr;
}

.faq-item__panel-inner {
	overflow: hidden;
}

.faq-item__answer {
	padding-bottom: var(--sc-space-200);
	color: var(--sc-text-onlight-mute);
	max-width: var(--sc-measure);
}

.section--dark .faq-item__answer,
.section--dark-deep .faq-item__answer {
	color: var(--sc-text-ondark-mute);
}

@media (prefers-reduced-motion: reduce) {
	.faq-item__panel {
		transition-delay: 0s;
	}
}
