/* ── Brandwin FAQ — Public Styles ───────────────────────────────────
   Design intent:
   · Inherit font-family, font-size, color, line-height from Impreza /
     the page cascade — no hard overrides.
   · Provide only structural / spacing / search-box chrome.
   · The search input is styled to resemble Impreza's standard form
     inputs (uses the same CSS custom properties where available).
   ─────────────────────────────────────────────────────────────────── */

.bwfaq-wrapper {
	width: 100%;
}

/* ── Search bar ────────────────────────────────────────────────────── */
.bwfaq-search-wrap {
	position: relative;
	margin-bottom: 1.5em;
}

.bwfaq-search {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: .65em 2.6em .65em 1em;

	/* Impreza exposes --input-border-color, --input-bg, --input-color.
	   Fall back gracefully if the theme doesn't set them. */
	background-color: var( --input-bg, #fff );
	color:            var( --input-color, inherit );
	border: 1px solid var( --input-border-color, #d0d0d0 );
	border-radius:    var( --input-border-radius, 4px );
	font-family: inherit;
	font-size:   1em;
	line-height: 1.4;
	transition: border-color .2s, box-shadow .2s;
	-webkit-appearance: none;
	appearance: none;
}

.bwfaq-search:focus {
	outline: none;
	border-color: var( --color-primary, #1a73e8 );
	box-shadow: 0 0 0 3px rgba( 26, 115, 232, .15 );
}

/* Remove the browser-native ✕ clear button — we keep styling clean */
.bwfaq-search::-webkit-search-cancel-button { display: none; }

.bwfaq-search-icon {
	position: absolute;
	right: .8em;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	display: flex;
	align-items: center;
	color: var( --input-color, #888 );
	opacity: .6;
}

/* ── No results notice ─────────────────────────────────────────────── */
.bwfaq-no-results {
	color: var( --color-body-text, #555 );
	font-style: italic;
	margin: 0 0 1em;
}

/* ── FAQ list ───────────────────────────────────────────────────────── */
.bwfaq-list {
	/* No extra chrome — items are just block elements */
}

/*
 * Spacing uses CSS custom properties set inline on .bwfaq-wrapper by the
 * shortcode renderer.  Each var resolves to Impreza's own --gap-{size}
 * token, so spacing automatically matches whatever the site owner has set
 * in Impreza's Theme Options → Content Spacing.
 *
 * --bwfaq-gap-items     : space between each Q&A pair
 * --bwfaq-gap-q-to-a    : space between question heading and answer
 * --bwfaq-gap-section   : space above a section-break divider
 *
 * Pixel fallbacks are provided for environments without Impreza.
 */
.bwfaq-item {
	margin-bottom: var( --bwfaq-gap-items, var( --gap-m, 30px ) );
}

/* Remove bottom margin from the very last item so there's no trailing gap */
.bwfaq-list > .bwfaq-item:last-child,
.bwfaq-list > *:last-child {
	margin-bottom: 0;
}

/* Question — use the q-to-a gap as bottom margin to push down the answer */
.bwfaq-question {
	margin-bottom: var( --bwfaq-gap-q-to-a, var( --gap-xs, 10px ) ) !important;
	margin-top: 0 !important;
}

/* Answer — no top margin; spacing is handled entirely by the question's bottom margin */
.bwfaq-answer {
	margin-top: 0 !important;
}

/* ── Section breaks ─────────────────────────────────────────────── */
.bwfaq-section-break {
	margin-top: var( --bwfaq-gap-section, var( --gap-l, 40px ) );
	margin-bottom: var( --bwfaq-gap-items, var( --gap-m, 30px ) );
	padding-bottom: .4em;
	border-bottom: 2px solid var( --color-border, #e0e0e0 );
}

/* First section break at the very top of the list needs no top spacing */
.bwfaq-list > .bwfaq-section-break:first-child {
	margin-top: 0;
}

.bwfaq-section-heading {
	margin: 0 !important;
}

/* ── Hidden state (filtered out by JS) ─────────────────────────────── */
.bwfaq-item[hidden],
.bwfaq-item.bwfaq-hidden {
	display: none !important;
}
