/* Layout: Accordion */

/*
 * One left edge for the whole card: kicker, heading, intro and the list line
 * up. The list used to be inset and centred below the heading, which read as
 * a second, narrower column. Heading and intro keep the spacing base.css
 * gives every section.
 */
/*
 * Styleguide «FAQ-Liste»: a 3.6px anthracite line under every question, none
 * above the first; the plus is drawn in the same line weight.
 */
.accordion__item {
	border-bottom: var(--line) solid var(--color-text);
}

.accordion__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	padding: var(--space-s) 0;
	font-weight: 700;
	font-size: var(--text-lg);
	line-height: var(--leading-snug);
	cursor: pointer;
	list-style: none;
}

/* The FAQ section: questions as large as in the styleguide (Sans Bold ~32px). */
.section--accordion .accordion__summary {
	padding: var(--space-m) 0;
	font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
	line-height: var(--leading-tight);
}

/* A step above the questions, as the band of the CTA banner has it. */
.accordion__card .section__title {
	font-size: var(--text-3xl);
}

.accordion__summary::-webkit-details-marker {
	display: none;
}

.accordion__summary:hover,
.accordion__summary:focus-visible {
	color: var(--color-accent-hover);
}

.accordion__icon {
	position: relative;
	flex: 0 0 auto;
	width: 1.25rem;
	height: 1.25rem;
}

.section--accordion .accordion__icon {
	width: 1.5rem;
	height: 1.5rem;
}

.accordion__icon::before,
.accordion__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: var(--line);
	background: currentcolor;
	transform: translateY(-50%);
	transition: transform var(--transition), opacity var(--transition);
}

.accordion__icon::after {
	transform: translateY(-50%) rotate(90deg);
}

.accordion__item[open] .accordion__icon::after {
	transform: translateY(-50%) rotate(0deg);
	opacity: 0;
}

.accordion__panel {
	padding-bottom: var(--space-s);
	color: var(--color-muted);
}

/* The FAQ's answers read at the questions' colour, at a size that holds beside them. */
.section--accordion .accordion__panel {
	color: var(--color-text);
}

.section--accordion .accordion__answer {
	font-size: var(--text-lg);
}

/* Progressive enhancement: browsers with interpolate-size animate the open/close. */
@supports (interpolate-size: allow-keywords) {
	:root {
		interpolate-size: allow-keywords;
	}

	.accordion__item::details-content {
		block-size: 0;
		overflow: hidden;
		transition: block-size 250ms ease, content-visibility 250ms allow-discrete;
	}

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

.accordion__action {
	margin: var(--space-l) 0 0;
	text-align: center;
}

/*
 * Inside an article (post_accordion). Here rather than in post-article.css
 * because the editor preview loads exactly one layout stylesheet, and this is
 * the one that makes it look like an accordion.
 */
.post-accordion__title {
	margin-bottom: var(--space-s);
	font-size: var(--text-xl);
}
