/**
 * FAQ accordion — pattern: faq-accordion
 */

.wp-site-blocks .bnb-faq,
.editor-styles-wrapper .bnb-faq {
	width: 100%;
	max-width: var(--wp--style--global--content-size, 1280px);
	margin-left: auto;
	margin-right: auto;
	margin-top: 0;
	margin-bottom: 0;
	padding-top: var(--wp--preset--spacing--60, 1.5rem);
	padding-bottom: var(--wp--preset--spacing--60, 1.5rem);
	box-sizing: border-box;
}

/* Wide viewports: align with unconstrained content; below 1200px use horizontal inset. */
@media (min-width: 1200px) {
	.wp-site-blocks .bnb-faq,
	.editor-styles-wrapper .bnb-faq {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}

@media (max-width: 1199px) {
	.wp-site-blocks .bnb-faq,
	.editor-styles-wrapper .bnb-faq {
		padding-left: 20px;
		padding-right: 20px;
	}
}

.wp-site-blocks .bnb-faq__list,
.editor-styles-wrapper .bnb-faq__list {
	display: grid;
	gap: 0.75rem;
	margin: 0 0 25px !important;
}

/*
 * Block editor: dashed placeholder replaces only the FAQ item list.
 * The “More FAQ” buttons block (.wp-block-buttons) stays visible for editing.
 */
.editor-styles-wrapper .bnb-faq__list {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	min-height: clamp(10rem, 20vw, 14rem);
	border: 1px dashed rgba(26, 26, 26, 0.2);
	border-radius: 1rem;
	background: rgba(26, 26, 26, 0.03);
	padding: 1rem;
	box-sizing: border-box;
	gap: 0;
	margin: 0 0 25px !important;
}

.editor-styles-wrapper .bnb-faq__list > * {
	display: none !important;
}

.editor-styles-wrapper .bnb-faq__list::before {
	content: "FAQ accordion preview is shown on frontend.";
	font-size: 0.95rem;
	color: rgba(26, 26, 26, 0.75);
	text-align: center;
	padding: 0 1rem;
	max-width: 100%;
}

/* Closed: accent; open: accent-secondary */
.wp-site-blocks .bnb-faq__item,
.editor-styles-wrapper .bnb-faq__item {
	--bnb-faq-index-col: 2.75rem;
	--bnb-faq-index-gap: 0.75rem;
	--bnb-faq-motion-duration: 380ms;
	--bnb-faq-panel-margin-top: 20px;

	border: 0;
	border-radius: 2rem;
	background-color: var(--wp--preset--color--accent, #ecc4c0);
	padding: 20px 20px 20px 70px;
	overflow: hidden;
	box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
	.wp-site-blocks .bnb-faq__item,
	.editor-styles-wrapper .bnb-faq__item {
		transition: background-color var(--bnb-faq-motion-duration, 380ms) ease;
	}
}

@media (max-width: 779px) {
	.wp-site-blocks .bnb-faq__item,
	.editor-styles-wrapper .bnb-faq__item {
		padding-left: 40px;
	}
}

.wp-site-blocks .bnb-faq__item[open],
.editor-styles-wrapper .bnb-faq__item[open] {
	background-color: var(--wp--preset--color--accent-secondary, #edeef6);
}

/* Parallel close+open: row stays visually "closed" while [open] is still true for height animation. */
.wp-site-blocks .bnb-faq__item[open].bnb-faq__item--animating-closed,
.editor-styles-wrapper .bnb-faq__item[open].bnb-faq__item--animating-closed {
	background-color: var(--wp--preset--color--accent, #ecc4c0);
}

.wp-site-blocks .bnb-faq__item[open].bnb-faq__item--animating-closed > summary::after,
.editor-styles-wrapper .bnb-faq__item[open].bnb-faq__item--animating-closed > summary::after {
	background: var(--bnb-faq-chevron-closed, none) center / contain no-repeat;
	transform: translateY(-50%);
}

body.bnb-faq-chevron-rotate-open .bnb-faq__item[open].bnb-faq__item--animating-closed > summary::after {
	transform: translateY(-50%);
}

.wp-site-blocks .bnb-faq__item > summary,
.editor-styles-wrapper .bnb-faq__item > summary,
.wp-site-blocks .bnb-faq__summary,
.editor-styles-wrapper .bnb-faq__summary {
	list-style: none;
	cursor: pointer;
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var(--bnb-faq-index-gap);
	padding: 0 2.25rem 0 0;
	margin: 0;
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #464646 !important;
	line-height: 1.4;
}

.wp-site-blocks .bnb-faq__index,
.editor-styles-wrapper .bnb-faq__index {
	flex: 0 0 var(--bnb-faq-index-col);
	min-width: 0;
	text-align: left;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

.wp-site-blocks .bnb-faq__question,
.editor-styles-wrapper .bnb-faq__question {
	flex: 1 1 auto;
	min-width: 0;
	text-align: left;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

.wp-site-blocks .bnb-faq__item > summary::-webkit-details-marker,
.editor-styles-wrapper .bnb-faq__item > summary::-webkit-details-marker {
	display: none;
}

.wp-site-blocks .bnb-faq__item > summary::after,
.editor-styles-wrapper .bnb-faq__item > summary::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: 12px;
	height: 12px;
	background: var(--bnb-faq-chevron-closed, none) center / contain no-repeat;
	transform: translateY(-50%);
	transition: transform 0.2s ease, opacity 0.2s ease, background var(--bnb-faq-motion-duration, 380ms) ease;
	opacity: 0.9;
}

/* Open graphic (theme assets or SVG fallback). */
.wp-site-blocks .bnb-faq__item[open] > summary::after,
.editor-styles-wrapper .bnb-faq__item[open] > summary::after {
	background: var(--bnb-faq-chevron-open) center / contain no-repeat;
	transform: translateY(-50%);
}

/* When closed/open URLs match (default theme SVGs), rotate the same asset for open. */
body.bnb-faq-chevron-rotate-open .bnb-faq__item[open] > summary::after {
	transform: translateY(-50%) rotate(90deg);
}

.wp-site-blocks .bnb-faq__item .wp-block-details__content,
.editor-styles-wrapper .bnb-faq__item .wp-block-details__content,
.wp-site-blocks .bnb-faq__panel,
.editor-styles-wrapper .bnb-faq__panel {
	margin-top: var(--bnb-faq-panel-margin-top, 20px);
	margin-bottom: 0;
	margin-left: 0;
	margin-right: 0;
	padding: 0;
	padding-left: calc(var(--bnb-faq-index-col) + var(--bnb-faq-index-gap));
	box-sizing: border-box;
}

/* Animated body (frontend JS sets max-height); avoids clipping inner focus rings when not animating. */
.wp-site-blocks .bnb-faq__panel {
	overflow: hidden;
}

.wp-site-blocks .bnb-faq__answer,
.editor-styles-wrapper .bnb-faq__answer {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: #464646 !important;
	line-height: 1.5 !important;
}

.wp-site-blocks .bnb-faq__answer > *:first-child,
.editor-styles-wrapper .bnb-faq__answer > *:first-child {
	margin-top: 0 !important;
}

.wp-site-blocks .bnb-faq__answer > *:last-child,
.editor-styles-wrapper .bnb-faq__answer > *:last-child {
	margin-bottom: 0 !important;
}

.wp-site-blocks .bnb-faq__cta .wp-block-button__link,
.editor-styles-wrapper .bnb-faq__cta .wp-block-button__link {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 160px !important;
	height: 54px !important;
	padding: 0 !important;
	margin: 0 !important;
	background-color: #000 !important;
	color: var(--wp--preset--color--accent, #ecc4c0) !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	border: none !important;
	border-radius: 9999px;
	box-shadow: none !important;
	outline: 3px solid var(--wp--preset--color--accent, #ecc4c0);
	outline-offset: 0;
}

.wp-site-blocks .bnb-faq__cta .wp-block-button__link:hover,
.editor-styles-wrapper .bnb-faq__cta .wp-block-button__link:hover,
.wp-site-blocks .bnb-faq__cta .wp-block-button__link:focus,
.editor-styles-wrapper .bnb-faq__cta .wp-block-button__link:focus,
.wp-site-blocks .bnb-faq__cta .wp-block-button__link:active,
.editor-styles-wrapper .bnb-faq__cta .wp-block-button__link:active,
.wp-site-blocks .bnb-faq__cta .wp-block-button__link:visited,
.editor-styles-wrapper .bnb-faq__cta .wp-block-button__link:visited {
	background-color: #000 !important;
	color: var(--wp--preset--color--accent, #ecc4c0) !important;
	text-decoration: none !important;
}
