/* === FAQ-Stilvariante für core/details === */

.wp-block-details.is-style-faq {
	border: none;
	padding: 0;
	margin-block: 0;
}

/* Trennlinie unterhalb jedes Blocks – adaptiv zu currentColor */
.wp-block-details.is-style-faq {
	border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

.wp-block-details.is-style-faq > summary {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 0;
	cursor: pointer;
	font-weight: 500;
	user-select: none;
}

/* Nativen Marker entfernen */
.wp-block-details.is-style-faq > summary::-webkit-details-marker {
	display: none;
}
.wp-block-details.is-style-faq > summary::marker {
	display: none;
	content: '';
}

/* Chevron-Icon rechts – mask-image damit background-color: currentColor greift */
.wp-block-details.is-style-faq > summary::after {
	content: '';
	display: block;
	width: 1em;
	height: 1em;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	-webkit-mask-mode: alpha;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-mode: alpha;
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	transition: transform 0.35s ease;
	opacity: 0.6;
}

/* Chevron dreht sich beim Öffnen */
.wp-block-details.is-style-faq[open] > summary::after {
	transform: rotate(180deg);
}


/* Inhalts-Wrapper für die Slide-Animation (wird per PHP eingefügt) */
.wp-block-details.is-style-faq .gbp-faq-body {
	overflow: hidden;
	margin: 12px 0;
}

.wp-block-details.is-style-faq .gbp-faq-body > *:first-child {
	margin-top: 0;
}

.wp-block-details.is-style-faq .gbp-faq-body > *:last-child {
	margin-bottom: 1.25rem;
}

/* Editor: content blocks are direct children of <details> (no .gbp-faq-body wrapper).
   Mirror the frontend gaps (summary padding 20px + 12px = 32px top, 32px bottom). */
.wp-block-details.is-style-faq > summary + * {
	margin-top: 12px;
}

/* Bottom gap before the divider. When the block is selected the editor inserts
   a .block-list-appender as the last child, so target the last real content
   block in both states and neutralise the appender's own footprint. */
.wp-block-details.is-style-faq > :last-child:not( summary ),
.wp-block-details.is-style-faq > :not( summary ):has( + .block-list-appender ) {
	margin-bottom: 32px;
}

.wp-block-details.is-style-faq > .block-list-appender:last-child {
	margin: 0;
	min-height: 0;
}
