/**
 * BuddyPilot FAQ — block and page styles
 *
 * Covers: section wrapper, accordion items, group headings, answers,
 * permalink link, and all three theme templates (single/archive/category).
 * All colours use --bp-* custom properties from theme.json.
 */

/* ── Section wrapper ──────────────────────────────────────────────────────── */

.bp-faq {
	padding-block: var(--bp-space-3xl, 5rem);
	background: var(--bp-ice, #EFF6FF);
}

/* section-header styles inherited from theme layout.css — no overrides needed */

/* ── Accordion container ──────────────────────────────────────────────────── */

.bp-faq-accordion {
	max-width: 52rem;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* ── Group heading ────────────────────────────────────────────────────────── */

.bp-faq-group-title {
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--bp-accent, #2563eb);
	margin: 1.5rem 0 0.25rem;
}

.bp-faq-group-title:first-child {
	margin-top: 0;
}

.bp-faq-group-title a {
	color: inherit;
	text-decoration: none;
}

.bp-faq-group-title a:hover {
	text-decoration: underline;
}

/* ── Accordion item ───────────────────────────────────────────────────────── */

.bp-faq-item {
	background: var(--bp-bg, #fff);
	border: 1.5px solid var(--bp-border, #e5e7eb);
	border-radius: 0.75rem;
	overflow: hidden;
}

.bp-faq-item[open] {
	border-color: var(--bp-accent, #2563eb);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-accent, #2563eb) 12%, transparent);
}

/* Remove browser default triangle marker */
.bp-faq-item summary::-webkit-details-marker { display: none; }
.bp-faq-item summary::marker { display: none; }

/* ── Question (summary) ───────────────────────────────────────────────────── */

.bp-faq-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 600;
	color: var(--bp-text, #111827);
	line-height: 1.4;
	list-style: none;
	user-select: none;
	min-height: 44px;
}

.bp-faq-question em,
.faq-entry__question em,
.bp-faq-answer em,
.faq-entry__answer em,
.breadcrumbs em {
	font-style: normal;
	color: var(--bp-cobalt, #1944CB);
}

.bp-faq-question:hover {
	background: var(--bp-surface, #f9fafb);
}

.bp-faq-question:focus-visible {
	outline: 2px solid var(--bp-accent, #2563eb);
	outline-offset: -2px;
	border-radius: 0.75rem;
}

/* Chevron icon */
.bp-faq-chevron {
	flex-shrink: 0;
	font-size: 0.8125rem;
	color: var(--bp-text-muted, #6b7280);
	transition: transform 0.25s ease;
}

.bp-faq-item[open] .bp-faq-chevron {
	transform: rotate(180deg);
}

/* ── Answer ───────────────────────────────────────────────────────────────── */

.bp-faq-answer {
	padding: 0 1.25rem 1.25rem;
	font-size: 0.9375rem;
	color: var(--bp-text, #111827);
	line-height: 1.7;
	overflow: hidden; /* needed for height animation */
}

.bp-faq-answer > *:first-child { margin-top: 0; }
.bp-faq-answer > *:last-child  { margin-bottom: 0; }

.bp-faq-answer a {
	color: var(--bp-accent, #2563eb);
}

.bp-faq-answer a:hover {
	text-decoration: none;
}


/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */
/* THEME TEMPLATE STYLES                                                      */
/* ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

/* ── Single FAQ page ──────────────────────────────────────────────────────── */

.single-buddypilot_faq .faq-entry {
	max-width: 52rem;
	margin-inline: auto;
}

.single-buddypilot_faq .faq-entry__question {
	font-size: clamp(1.5rem, 3.5vw, 2rem);
	font-weight: 700;
	color: var(--bp-text, #111827);
	margin-bottom: 1.5rem;
}

.single-buddypilot_faq .faq-entry__answer {
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--bp-text, #111827);
}

.single-buddypilot_faq .faq-entry__answer > *:first-child { margin-top: 0; }

/* Category badge */
.faq-entry__category {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--bp-accent, #2563eb);
	background: color-mix(in srgb, var(--bp-accent, #2563eb) 10%, transparent);
	padding: 0.2rem 0.65rem;
	border-radius: 1rem;
	text-decoration: none;
	margin-bottom: 1rem;
}

.faq-entry__category:hover {
	background: color-mix(in srgb, var(--bp-accent, #2563eb) 18%, transparent);
}

/* Related questions */
.faq-related {
	margin-top: var(--bp-space-xl, 3rem);
	padding-top: var(--bp-space-xl, 3rem);
	border-top: 1.5px solid var(--bp-border, #e5e7eb);
}

.faq-related__title {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--bp-text, #111827);
	margin-bottom: 0.75rem;
}

.faq-related__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.faq-related__list li::before {
	content: '';
}

.faq-related__list a {
	font-size: 0.9375rem;
	color: var(--bp-accent, #2563eb);
	text-decoration: none;
}

.faq-related__list a::before {
	content: '\f105'; /* fa-angle-right */
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 0.75rem;
	margin-right: 0.4rem;
	flex-shrink: 0;
}

.faq-related__list a:hover {
	text-decoration: underline;
}

/* ── FAQ archive (/faq/) ──────────────────────────────────────────────────── */

.faq-archive {
	padding-block: var(--bp-space-3xl, 5rem);
}

.faq-archive__header {
	margin-bottom: var(--bp-space-xl, 3rem);
}

.faq-archive__header h1 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 700;
	color: var(--bp-text, #111827);
}

.faq-archive__group {
	margin-bottom: var(--bp-space-xl, 3rem);
}

.faq-archive__group-title {
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--bp-accent, #2563eb);
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1.5px solid var(--bp-border, #e5e7eb);
}

.faq-archive__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.faq-archive__list a {
	font-size: 0.9375rem;
	color: var(--bp-text, #111827);
	text-decoration: none;
}

.faq-archive__list a::before {
	content: '\f105';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 0.75rem;
	color: var(--bp-accent, #2563eb);
	margin-right: 0.4rem;
	flex-shrink: 0;
}

.faq-archive__list a:hover {
	color: var(--bp-accent, #2563eb);
}

/* ── FAQ category archive ─────────────────────────────────────────────────── */

.faq-category {
	padding-block: var(--bp-space-3xl, 5rem);
}

.faq-category__header {
	margin-bottom: var(--bp-space-xl, 3rem);
}

.faq-category__header h1 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 700;
	color: var(--bp-text, #111827);
	margin-bottom: 0.5rem;
}

.faq-category__description {
	font-size: 1.0625rem;
	color: var(--bp-text-muted, #6b7280);
	max-width: 52ch;
}

.faq-category__list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.faq-category__item {
	padding: 1.25rem;
	background: var(--bp-bg, #fff);
	border: 1.5px solid var(--bp-border, #e5e7eb);
	border-radius: 0.75rem;
	transition: box-shadow 0.2s;
}

.faq-category__item:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,.07);
}

.faq-category__item-title {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 0.4rem;
}

.faq-category__item-title a {
	color: var(--bp-text, #111827);
	text-decoration: none;
}

.faq-category__item-title a:hover {
	color: var(--bp-accent, #2563eb);
}

.faq-category__item-excerpt {
	font-size: 0.9375rem;
	color: var(--bp-text-muted, #6b7280);
	margin: 0;
	line-height: 1.6;
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.bp-faq-chevron {
		transition: none;
	}

	.faq-category__item {
		transition: none;
	}
}
