/**
 * BV FAQ — front-end styles.
 *
 * Built to the approved Figma design. Design tokens are exposed as CSS custom
 * properties on the .bv-faq root so they can be overridden from the theme /
 * Oxygen global colours without editing this file. Typography is intentionally
 * inherited from the site (the design uses Helvetica Bold for questions and
 * Poppins for answers; only size/weight are set here).
 */

.bv-faq {
	/* Colours (from the approved design). */
	--bv-faq-panel-bg: #f5f5f5;
	--bv-faq-card-bg: #ffffff;
	--bv-faq-card-border: #ffcad6;
	--bv-faq-accent: #4c3cc8;
	--bv-faq-question: #331110;
	--bv-faq-answer: #444444;
	--bv-faq-rail-text: #331110;
	--bv-faq-rail-divider: rgba(51, 51, 51, 0.2);

	/* Layout. */
	--bv-faq-panel-radius: 24px;
	--bv-faq-card-radius: 12px;
	--bv-faq-panel-pad: 52px;
	--bv-faq-card-gap: 20px;
	--bv-faq-rail-width: 277px;
	--bv-faq-gap: 40px;

	display: grid;
	grid-template-columns: var(--bv-faq-rail-width) 1fr;
	gap: var(--bv-faq-gap);
	align-items: start;
	box-sizing: border-box;
	color: var(--bv-faq-answer);
}

.bv-faq *,
.bv-faq *::before,
.bv-faq *::after {
	box-sizing: border-box;
}

.bv-faq--single {
	grid-template-columns: 1fr;
}

/* ---------------------------------------------------------------------------
 * Category rail
 * ------------------------------------------------------------------------- */

.bv-faq__rail {
	display: flex;
	flex-direction: column;
	gap: 28px;
	padding-left: 16px;
	border-left: 1px solid var(--bv-faq-rail-divider);
	position: sticky;
	top: 24px;
}

.bv-faq__tab {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bv-faq-rail-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: color 0.18s ease;
}

/* Purple active marker, sitting on the rail divider line. */
.bv-faq__tab::before {
	content: "";
	position: absolute;
	left: -17px;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 32px;
	border-radius: 2px;
	background: var(--bv-faq-accent);
	opacity: 0;
	transition: opacity 0.18s ease;
}

.bv-faq__tab:hover {
	color: var(--bv-faq-accent);
}

.bv-faq__tab:focus-visible {
	outline: 2px solid var(--bv-faq-accent);
	outline-offset: 4px;
	border-radius: 4px;
}

.bv-faq__tab.is-active {
	color: var(--bv-faq-accent);
}

.bv-faq__tab.is-active::before {
	opacity: 1;
}

.bv-faq__tab-icon {
	display: inline-flex;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	color: currentColor;
}

.bv-faq__icon {
	display: block;
	width: 100%;
	height: 100%;
}

.bv-faq__tab-label {
	font-size: 20px;
	line-height: 1.44;
}

/* ---------------------------------------------------------------------------
 * Panels + accordion
 * ------------------------------------------------------------------------- */

.bv-faq__panels {
	background: var(--bv-faq-panel-bg);
	border-radius: var(--bv-faq-panel-radius);
	padding: var(--bv-faq-panel-pad);
}

.bv-faq__panel {
	display: flex;
	flex-direction: column;
	gap: var(--bv-faq-card-gap);
}

/* When JS is active, only the chosen panel shows. Without JS every panel is
 * visible so the content stays fully accessible. */
.bv-faq.is-enhanced .bv-faq__panel {
	display: none;
}

.bv-faq.is-enhanced .bv-faq__panel.is-active {
	display: flex;
}

.bv-faq__item {
	background: var(--bv-faq-card-bg);
	border: 1px solid var(--bv-faq-card-border);
	border-radius: var(--bv-faq-card-radius);
	overflow: hidden;
}

.bv-faq__heading {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
}

.bv-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	margin: 0;
	padding: 30px 31px;
	border: 0;
	background: transparent;
	color: var(--bv-faq-question);
	font: inherit;
	font-weight: 700;
	font-size: 24px;
	line-height: 1.2;
	letter-spacing: -0.48px;
	text-align: left;
	cursor: pointer;
}

.bv-faq__question:focus-visible {
	outline: 2px solid var(--bv-faq-accent);
	outline-offset: -3px;
	border-radius: var(--bv-faq-card-radius);
}

.bv-faq__question-text {
	flex: 1 1 auto;
}

/* Plus / minus toggle: the vertical bar collapses to turn + into −. */
.bv-faq__toggle {
	display: inline-flex;
	flex: 0 0 auto;
	color: var(--bv-faq-question);
}

.bv-faq__toggle svg {
	display: block;
}

.bv-faq__toggle-bar {
	transform-box: fill-box;
	transform-origin: center;
	transition: transform 0.25s ease;
}

.bv-faq.is-enhanced .bv-faq__item.is-open .bv-faq__toggle-bar {
	transform: scaleY(0);
}

.bv-faq__answer {
	color: var(--bv-faq-answer);
}

/* Collapsed state only applies once JS has enhanced the component. */
.bv-faq.is-enhanced .bv-faq__answer {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.bv-faq.is-enhanced .bv-faq__answer.is-open {
	max-height: 2000px;
}

.bv-faq__answer-inner {
	padding: 4px 31px 30px;
	font-size: 16px;
	line-height: 1.56;
}

.bv-faq__answer-inner > :first-child {
	margin-top: 0;
}

.bv-faq__answer-inner > :last-child {
	margin-bottom: 0;
}

.bv-faq__answer-inner a {
	color: var(--bv-faq-accent);
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */

/* Tablet / small desktop: stack the rail above the panel; the rail stays a
 * vertical list (with its divider + active marker), matching the design. */
@media (max-width: 900px) {
	.bv-faq {
		--bv-faq-panel-pad: 32px;
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.bv-faq__rail {
		position: static;
	}
}

/* Phone: compact spacing per the approved mobile design. */
@media (max-width: 600px) {
	.bv-faq {
		--bv-faq-panel-pad: 12px;
		--bv-faq-card-gap: 10px;
		gap: 20px;
	}

	.bv-faq__question {
		gap: 12px;
		padding: 12px;
		font-size: 18px;
		line-height: 1.4;
		letter-spacing: -0.36px;
	}

	.bv-faq__answer-inner {
		padding: 0 12px 12px;
		font-size: 14px;
	}

	.bv-faq__toggle svg {
		width: 20px;
		height: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bv-faq__toggle-bar,
	.bv-faq.is-enhanced .bv-faq__answer,
	.bv-faq__tab,
	.bv-faq__tab::before {
		transition: none;
	}
}
