/* AP FAQ Tabs
 * Change the look from these variables: colours, sizes, spacing.
 * Fonts are inherited from the theme (set them in Betheme > Theme Options > Fonts).
 *
 * The clickable parts are plain <div>s (not <button> / <h3>) on purpose, so the
 * theme's global button and heading styles can never leak into this block.
 */
.ap-faq {
	--ap-accent: #2962ff;        /* active tab */
	--ap-accent-text: #ffffff;
	--ap-tabs-bg: #f5f5f5;       /* left column background */
	--ap-text: #161616;          /* questions, active text */
	--ap-muted: #6f6f6f;         /* tab labels, answers */
	--ap-line: #e2e2e2;          /* dividers */
	--ap-tabs-height: 515px;     /* left list scrolls beyond this */

	display: grid;
	/* Figma proportions: 326px tabs / 134px gap / 795px content at 1255px wide */
	grid-template-columns: minmax(0, 326fr) minmax(0, 795fr);
	align-items: start;
	column-gap: clamp(32px, 10.7%, 134px);
	row-gap: 20px;
	width: 100%;
	margin: 0;
	padding: 0;
	color: var(--ap-text);
	text-align: left;
	letter-spacing: normal;
	text-transform: none;
	box-sizing: border-box;
}

/* The layout responds to the width of the space the block sits in,
   not the screen, so it also behaves inside narrow builder columns. */
.ap-faq-wrap {
	container-type: inline-size;
	width: 100%;
	margin: 0;
	padding: 0;
}

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

.ap-faq [hidden] {
	display: none !important;
}

/* ---------- Left: category tabs ---------- */

.ap-faq .ap-faq-tabs {
	margin: 0;
	padding: 0;
	background: var(--ap-tabs-bg);
	max-height: var(--ap-tabs-height);
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d0d0d0 transparent;
}

.ap-faq .ap-faq-tabs::-webkit-scrollbar {
	width: 6px;
	height: 0;
}

.ap-faq .ap-faq-tabs::-webkit-scrollbar-thumb {
	background: #d0d0d0;
}

.ap-faq .ap-faq-tab {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0 24px;
	font-size: 15px;
	line-height: 1.4;
	font-weight: 400;
	color: var(--ap-muted);
	background: transparent;
	border: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.ap-faq .ap-faq-tab-label {
	display: block;
	padding: 18px 0;
	border-bottom: 1px solid var(--ap-line);
}

.ap-faq .ap-faq-tab:last-child .ap-faq-tab-label {
	border-bottom-color: transparent;
}

.ap-faq .ap-faq-tab:hover {
	color: var(--ap-text);
}

.ap-faq .ap-faq-tab.ap-is-active,
.ap-faq .ap-faq-tab.ap-is-active:hover {
	background: var(--ap-accent);
	color: var(--ap-accent-text);
	font-weight: 500;
}

.ap-faq .ap-faq-tab.ap-is-active .ap-faq-tab-label {
	padding: 22px 0;
	border-bottom-color: transparent;
}

.ap-faq .ap-faq-tab:focus {
	outline: none;
}

.ap-faq .ap-faq-tab:focus-visible {
	outline: 2px solid var(--ap-accent);
	outline-offset: -2px;
}

.ap-faq .ap-faq-tab.ap-is-active:focus-visible {
	outline-color: var(--ap-text);
}

/* ---------- Right: search ---------- */

.ap-faq .ap-faq-main {
	min-width: 0;
}

.ap-faq .ap-faq-searchbar {
	background: #f4f4f4;
	padding: 12px 16px;
	margin: 0 0 12px;
}

.ap-faq .ap-faq-search-wrap {
	position: relative;
	display: block;
	margin: 0;
	padding: 0;
}

.ap-faq .ap-faq-search-icon {
	position: absolute;
	left: 20px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin: 0;
	transform: translateY(-50%);
	color: var(--ap-text);
	pointer-events: none;
	z-index: 1;
}

/* The one real form field. Themes style inputs aggressively (Betheme included),
   so the important properties are locked. */
.ap-faq input.ap-faq-search,
.ap-faq input.ap-faq-search:hover,
.ap-faq input.ap-faq-search:focus {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 0 !important;
	height: 40px !important;
	margin: 0 !important;
	padding: 0 16px 0 48px !important;
	font-family: inherit;
	font-size: 13px !important;
	line-height: 38px !important;
	font-weight: 400;
	color: var(--ap-text) !important;
	background: #ffffff !important;
	border: 1px solid #e6e6e6 !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.ap-faq input.ap-faq-search:focus {
	border-color: var(--ap-accent) !important;
}

.ap-faq input.ap-faq-search::placeholder {
	color: #8a8a8a;
	opacity: 1;
}

/* ---------- Right: accordion ---------- */

.ap-faq .ap-faq-item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--ap-line);
}

.ap-faq .ap-faq-heading {
	margin: 0;
	padding: 0;
}

.ap-faq .ap-faq-q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	margin: 0;
	padding: 22px 30px 22px 0;
	font-size: 15px;
	line-height: 1.45;
	font-weight: 500;
	color: var(--ap-text);
	background: transparent;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.ap-faq .ap-faq-q:focus {
	outline: none;
}

.ap-faq .ap-faq-q:focus-visible {
	outline: 2px solid var(--ap-accent);
	outline-offset: 2px;
}

/* plus / minus icon */
.ap-faq .ap-faq-icon {
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

.ap-faq .ap-faq-icon::before,
.ap-faq .ap-faq-icon::after {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 100%;
	height: 1px;
	background: var(--ap-text);
}

.ap-faq .ap-faq-icon::after {
	transform: rotate(90deg);
}

.ap-faq .ap-faq-item.ap-is-open .ap-faq-icon::after {
	transform: rotate(0deg);
	opacity: 0;
}

/* answer: animates open without needing a fixed height */
.ap-faq .ap-faq-a {
	display: grid;
	grid-template-rows: 0fr;
	margin: 0;
	padding: 0;
}

.ap-faq .ap-faq-item.ap-is-open .ap-faq-a {
	grid-template-rows: 1fr;
}

.ap-faq .ap-faq-a-inner {
	min-height: 0;
	overflow: hidden;
	visibility: hidden;
	max-width: 690px;
	font-size: 14px;
	line-height: 1.85;
	font-weight: 400;
	color: var(--ap-muted);
}

.ap-faq .ap-faq-item.ap-is-open .ap-faq-a-inner {
	visibility: visible;
}

.ap-faq .ap-faq-a-inner > * {
	margin-top: 0;
	margin-bottom: 12px;
}

.ap-faq .ap-faq-a-inner > :last-child {
	margin-bottom: 24px;
}

.ap-faq .ap-faq-a-inner p {
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.ap-faq .ap-faq-a-inner a {
	color: var(--ap-accent);
	text-decoration: underline;
}

.ap-faq .ap-faq-empty {
	margin: 0;
	padding: 24px 0;
	font-size: 14px;
	color: var(--ap-muted);
}

/* ---------- Medium space (tablet / narrower column) ---------- */

@container (max-width: 900px) {
	.ap-faq {
		grid-template-columns: 240px minmax(0, 1fr);
		column-gap: 32px;
	}
}

/* ---------- Small space (phone / narrow column): tabs become a scroll strip ---------- */

@container (max-width: 680px) {
	.ap-faq {
		grid-template-columns: minmax(0, 1fr);
	}

	.ap-faq .ap-faq-tabs {
		display: flex;
		max-height: none;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
	}

	.ap-faq .ap-faq-tab {
		flex: 0 0 auto;
		width: auto;
		padding: 0 18px;
		white-space: nowrap;
	}

	.ap-faq .ap-faq-tab-label,
	.ap-faq .ap-faq-tab.ap-is-active .ap-faq-tab-label {
		padding: 14px 0;
		border-bottom: 0;
	}

	.ap-faq .ap-faq-q {
		padding: 18px 4px 18px 0;
		gap: 16px;
	}
}

/* Same rules by screen width, only for old browsers without container queries */
@supports not (container-type: inline-size) {
	@media (max-width: 1024px) {
		.ap-faq {
			grid-template-columns: 240px minmax(0, 1fr);
			column-gap: 32px;
		}
	}

	@media (max-width: 767px) {
		.ap-faq {
			grid-template-columns: minmax(0, 1fr);
		}

		.ap-faq .ap-faq-tabs {
			display: flex;
			max-height: none;
			overflow-x: auto;
			overflow-y: hidden;
			-webkit-overflow-scrolling: touch;
		}

		.ap-faq .ap-faq-tab {
			flex: 0 0 auto;
			width: auto;
			padding: 0 18px;
			white-space: nowrap;
		}

		.ap-faq .ap-faq-tab-label,
		.ap-faq .ap-faq-tab.ap-is-active .ap-faq-tab-label {
			padding: 14px 0;
			border-bottom: 0;
		}

		.ap-faq .ap-faq-q {
			padding: 18px 4px 18px 0;
			gap: 16px;
		}
	}
}

/* ---------- Animations ----------
 * Switched on by the script the first time a visitor points at or touches the
 * block, so nothing ever animates by itself while the page is loading.
 */

@media (prefers-reduced-motion: no-preference) {
	.ap-faq.ap-faq-anim .ap-faq-tab {
		transition: color 0.2s ease, background-color 0.2s ease;
	}

	.ap-faq.ap-faq-anim .ap-faq-icon::before,
	.ap-faq.ap-faq-anim .ap-faq-icon::after {
		transition: transform 0.25s ease, opacity 0.25s ease;
	}

	.ap-faq.ap-faq-anim .ap-faq-a {
		transition: grid-template-rows 0.3s ease;
	}

	.ap-faq.ap-faq-anim .ap-faq-a-inner {
		transition: visibility 0s linear 0.3s;
	}

	.ap-faq.ap-faq-anim .ap-faq-item.ap-is-open .ap-faq-a-inner {
		transition-delay: 0s;
	}
}
