/*
 * Accordion icons for Bricks nested accordion items inside query-loop wrappers.
 *
 * An icon element ticked "Is Accordion (Nestable) Icon" either swaps (Show: Collapsed / Expanded)
 * or transforms when its item opens. Bricks' own rules only match items that are direct children
 * of the accordion (`.brxe-accordion-nested > .brx-open > ...`), so an FAQ answer list built from
 * a repeater loop inside a post loop never swaps or turns its icon. These rules apply the same
 * native settings at any depth. They match direct children too, with the same result.
 */
.brxe-accordion-nested .brx-open > .accordion-title-wrapper .brx-icon-collapsed {
	display: none;
}

/* Not turned: style.css rotates every icon in an open nested accordion item 45 degrees. */
.brxe-accordion-nested .brx-open > .accordion-title-wrapper .brx-icon-expanded {
	display: block;
	transform: none;
}

.brxe-accordion-nested .brx-open > .accordion-title-wrapper .brx-icon-transform {
	transform: var(--brx-icon-transform);
}

/*
 * Swapped icons turn a quarter into place as they appear (a plus becoming a minus reads as one
 * motion). The expanded icon only ever appears on open; the collapsed one animates only in an
 * item the visitor has closed (accordion-anchors.js marks it), not on page load.
 */
.brxe-accordion-nested .brx-open > .accordion-title-wrapper .brx-icon-expanded,
.brxe-accordion-nested .vf-accordion-closed > .accordion-title-wrapper .brx-icon-collapsed {
	animation: vf-accordion-icon-in 0.25s ease-out;
}

@keyframes vf-accordion-icon-in {
	from {
		opacity: 0.4;
		transform: rotate(-90deg);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brxe-accordion-nested .brx-open > .accordion-title-wrapper .brx-icon-expanded,
	.brxe-accordion-nested .vf-accordion-closed > .accordion-title-wrapper .brx-icon-collapsed {
		animation: none;
	}
}
