/**
 * Accordion.
 *
 * GenerateBlocks Pro ships the mechanics — a class on the item, a max-height
 * on the panel, one script listening for clicks — and nothing else. This is
 * the house look that goes over it: a plain list of questions divided by
 * hairlines, the answer sliding out underneath.
 *
 * Written against the block's own class names rather than a wrapper of ours,
 * so an accordion built later in the editor arrives dressed.
 */

.gb-accordion {
	max-width: 760px;
	margin: 0 auto;
}

.gb-accordion__item {
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
}

.gb-accordion__item:first-child {
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
}

/* A button, so the keyboard and the screen reader get it for free. */
.gb-accordion__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: 16px 2px;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: color 150ms ease;
}

.gb-accordion__toggle:hover,
.gb-accordion__toggle:focus,
.gb-accordion__toggle.gb-block-is-current {
	background: none;
	color: #356396;
}

.gb-accordion__toggle-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	color: #52669a;
}

.gb-accordion__toggle-icon svg {
	display: block;
}

/*
 * The panel is clipped while closed, so its spacing has to sit on the text
 * inside it — padding here would be cut off mid-animation.
 */
.gb-accordion__content > *:first-child {
	margin-top: 0;
}

.gb-accordion__content > *:last-child {
	margin-bottom: 18px;
}

@media ( max-width: 600px ) {

	.gb-accordion__toggle {
		padding: 14px 2px;
		font-size: 16px;
	}
}
