/**
 * Variant CSS: faq--conversational-bubbles
 *
 * Q/A rendered as a chat conversation: question bubbles hug the right edge in an
 * accent fill, answer bubbles hug the left in a soft surface fill. Bubble tails +
 * staggered max-width give the dialogue a warm, human cadence. All-core blocks
 * (no <details>), fully editable. Text stays --ink (polarity-aware) on the surface
 * bubble; the accent question bubble uses --cta-text-primary so it never goes
 * accent-on-accent (KI-020). Part of the `faq` role.
 */

body.aibt-universal .universal-faq--conversational-bubbles {
	background: var(--background);
	color: var(--ink);
	padding-block: calc(clamp(3rem, 7vw, 5rem) * var(--density, 1));
}

/* Restore WP constrained-layout centering for the centered intro elements (A8/A9). */
body.aibt-universal .universal-faq.universal-faq--conversational-bubbles .has-text-align-center {
	margin-inline: auto !important;
}

/* ── Intro ───────────────────────────────────────────────────────────── */

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__intro {
	margin: 0 auto clamp(1.8rem, 4vw, 2.8rem) auto;
	text-align: center;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__kicker {
	font-family: var(--font-body) !important;
	font-size: var(--text-xs) !important;
	font-weight: 600 !important;
	letter-spacing: var(--tracking-widest) !important;
	text-transform: uppercase !important;
	color: var(--accent) !important;
	margin: 0 auto var(--space-sm) auto !important;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__headline {
	font-family: var(--font-display) !important;
	color: var(--ink) !important;
	margin: 0 auto !important;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__deck {
	font-family: var(--font-body) !important;
	font-size: var(--text-base) !important;
	line-height: var(--leading-relaxed) !important;
	color: var(--ink) !important;
	opacity: 0.72;
	margin: var(--space-sm) auto 0 auto !important;
	max-width: 48ch;
}

/* ── Chat thread ─────────────────────────────────────────────────────── */

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__thread {
	display: flex !important;
	flex-direction: column !important;
	gap: clamp(0.5rem, 1.4vw, 0.8rem) !important;
	max-width: 680px;
	margin-inline: auto;
}

/* Each row owns the alignment of its bubble. */
body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__row {
	display: flex !important;
	width: 100%;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__row--q {
	justify-content: flex-end;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__row--a {
	justify-content: flex-start;
}

/* Add breathing room when the speaker changes (new turn in the dialogue). */
body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__row--q + .universal-faq__row--a,
body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__row--a + .universal-faq__row--q {
	margin-top: clamp(0.4rem, 1vw, 0.7rem);
}

/* ── Bubbles ─────────────────────────────────────────────────────────── */

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__bubble {
	position: relative;
	max-width: 86%;
	margin: 0 !important;
	padding: clamp(0.8rem, 1.8vw, 1.05rem) clamp(1rem, 2.4vw, 1.35rem);
	border-radius: 1.25rem;
	font-family: var(--font-body) !important;
	font-size: var(--text-base) !important;
	line-height: 1.5 !important;
}

/* Question bubble — accent fill, right edge, tail bottom-right. */
body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__bubble--q {
	background: var(--cta-bg-primary, var(--accent)) !important;
	color: var(--cta-text-primary, #fff) !important;
	font-family: var(--font-display) !important;
	font-weight: 500 !important;
	border-bottom-right-radius: 0.35rem;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__bubble--q::after {
	content: "";
	position: absolute;
	right: -0.45rem;
	bottom: 0;
	width: 0.9rem;
	height: 0.9rem;
	background: var(--cta-bg-primary, var(--accent));
	clip-path: polygon(0 0, 0 100%, 100% 100%);
}

/* Answer bubble — soft surface fill, left edge, tail bottom-left. */
body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__bubble--a {
	background: color-mix(in srgb, var(--ink) 6%, var(--background)) !important;
	color: var(--ink) !important;
	border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
	border-bottom-left-radius: 0.35rem;
}

body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__bubble--a::after {
	content: "";
	position: absolute;
	left: -0.45rem;
	bottom: 0;
	width: 0.9rem;
	height: 0.9rem;
	background: color-mix(in srgb, var(--ink) 6%, var(--background));
	border-left: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
	border-bottom: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
	clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 781px) {
	body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__bubble {
		max-width: 92%;
		font-size: var(--text-sm) !important;
	}
}

/* A5: cancel wide tracking on the uppercase kicker on small screens. */
@media (max-width: 640px) {
	body.aibt-universal .universal-faq--conversational-bubbles .universal-faq__kicker {
		letter-spacing: 0 !important;
	}
}
