.accordion {
	clear: both;
	margin-bottom: $spacing-4xl;
}

.accordion__item {
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	break-inside: avoid;
	box-sizing: border-box;
	border-bottom: 1px solid transparent;
	border-image: linear-gradient(90deg,
		rgba($grey--borders, 1) 80%,
		rgba($grey--borders, 0) 100%,
	) 1; // NB: the '1' here is not a typo, it is critical for border-slice!

	&[open] {
		> .accordion__title {
			background: linear-gradient(to right,
				rgba($grey--borders, 0.35) 50%,
				rgba($grey--borders, 0) 100%
			);

			> .accordion__toggle:before {
				content: '–';
				//transform: rotate(90deg);
			}
		}
	}

	&:hover {
		> .accordion__title {
			color: $primary;
		}
	}
}

.accordion__title {
	display: flex;
	align-content: center;
	margin: 0;
	padding: $spacing-lg $spacing-sm;
	@include line-height('headings');
	list-style: none;
	cursor: pointer;

	&:focus {
		outline: 0.2rem solid rgba($primary, 1);

		&:not(:focus-visible) {
			outline: none !important;
		}
	}

	&::-webkit-details-marker {
		display: none;
	}

	@media (min-width: 40em) {
		padding: $spacing-lg $spacing-lg;
	}
}

.accordion__toggle {
	display: block;
	padding-left: 1.85em;
	font-weight: bold;

	&::before {
		display: inline-block;
		float: left;
		content: '+';
		width: 1.2em;
		height: 1.2em;
		line-height: 1;
		padding: 0;
		font-weight: normal;
		margin-left: -1.85em;
		background: $secondary;
		color: black;
		//background: center center / contain no-repeat url('#{$assets-directory}/img/rarr-primary-short.svg');
		transition: transform 100ms ease-in-out;
		text-align: center;
		vertical-align: middle;
		box-sizing: border-box;
		border-radius: 100%;
	}
}

.accordion__content {
	padding: $spacing-sm;

	@media (min-width: 40em) {
		padding: $spacing-lg $spacing-lg;
	}

	> :first-child {
		margin-top: 0;
	}

	> :last-child {
		margin-bottom: 0;
	}
}
