/*
 * FAQ section, [sf_faq]. Matches the look of the older Oxygen toggles on /faqs/ (.toggle-container), but
 * uses its own classes: the old ones carry a click script and a max-height rule that would fight <details>.
 */

.sf-faq__item {
	background-color: #fff;
	border-radius: 10px;
	box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.05);
	margin-bottom: 8px;
	interpolate-size: allow-keywords;
}

.sf-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	column-gap: 24px;
	padding: 21px 24px;
	cursor: pointer;
	list-style: none;
}

.sf-faq__q::-webkit-details-marker {
	display: none;
}

.sf-faq__q:focus-visible {
	outline: 2px solid var(--clr-dark-green);
	outline-offset: 2px;
	border-radius: 10px;
}

.sf-faq__title {
	flex-grow: 1;
	margin: 0;
}

/* The round plus that turns into a minus. */
.sf-faq__icon {
	position: relative;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-color: var(--clr-dark-green);
	transition: background-color 0.3s ease;
}

.sf-faq__icon::before,
.sf-faq__icon::after {
	content: '';
	position: absolute;
	top: calc(50% - 1px);
	left: calc(50% - 5px);
	width: 10px;
	height: 2px;
	border-radius: 100px;
	background-color: #fff;
}

.sf-faq__icon::before {
	transform: rotate(90deg);
	transition: transform 0.3s ease;
}

.sf-faq__q:hover .sf-faq__icon,
.sf-faq__item[open] .sf-faq__icon {
	background-color: var(--clr-red);
}

.sf-faq__item[open] .sf-faq__icon::before {
	transform: rotate(0deg);
}

.sf-faq__body {
	padding: 30px 24px;
}

/* Opening animation, where the browser supports it. Elsewhere the answer simply appears. */
.sf-faq__item::details-content {
	block-size: 0;
	overflow: hidden;
	transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}

.sf-faq__item[open]::details-content {
	block-size: auto;
}

/* Same as the old toggles on phones. */
@media (max-width: 480px) {
	.sf-faq__q,
	.sf-faq__body {
		padding: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sf-faq__item::details-content,
	.sf-faq__icon,
	.sf-faq__icon::before {
		transition: none;
	}
}
