/* ==========================================================================
   Bin Bay — FAQ Page styles
   Loaded ONLY on the FAQ page template (see enqueue snippet in
   functions-enqueue-snippet.php). Uses the theme's own CSS variables
   (--brand, --brand-dark, --brand-soft, --gold, --ink, --ink-muted,
   --border, --background) defined in assets/css/style.css, so colors stay
   in sync automatically if the theme palette ever changes.
   ========================================================================== */

.faq-section { background: var(--background); }

/* Empty state (no FAQs added yet) */
.faq-empty {
	max-width: 640px;
	margin: 0 auto;
	text-align: center;
	padding: 3rem 1.5rem;
	color: var(--ink-muted);
}
.faq-empty-link {
	color: var(--brand-dark);
	font-weight: 600;
	text-decoration: underline;
}

/* Tabs */
.faq-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--border);
	padding-bottom: 0.5rem;
}
.faq-tab-btn {
	appearance: none;
	border: 1px solid var(--border);
	background: #fff;
	color: var(--ink-muted);
	font-family: var(--font-sans, inherit);
	font-size: 0.875rem;
	font-weight: 600;
	padding: 0.65rem 1.25rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.faq-tab-btn:hover {
	border-color: var(--brand);
	color: var(--brand-dark);
}
.faq-tab-btn.is-active {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}
.faq-tab-btn:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

/* Panels
   .is-active toggles display (still needed since opacity alone won't
   remove it from layout/tab order). .is-visible drives the actual fade,
   toggled a frame after .is-active so the transition has something to
   animate from (see faq.js). */
.faq-panel {
	display: none;
	opacity: 0;
	transition: opacity 0.7s ease;
}
.faq-panel.is-active { display: block; }
.faq-panel.is-visible {
	opacity: 1;
}
.faq-panel-intro {
	color: var(--ink-muted);
	margin-bottom: 1.5rem;
	max-width: 60ch;
}

@media (prefers-reduced-motion: reduce) {
	.faq-panel { transition: none; }
}

/* Accordion */
.faq-accordion {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-width: 880px;
}
.faq-item {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 1rem;
	overflow: hidden;
}
.faq-question-wrap { margin: 0; }
.faq-question {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	text-align: left;
	appearance: none;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 1.1rem 1.35rem;
	font-family: var(--font-sans, inherit);
	font-size: 0.975rem;
	font-weight: 600;
	color: var(--ink);
}
.faq-question:hover { color: var(--brand-dark); }
.faq-question:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: -2px;
}
.faq-chevron {
	flex-shrink: 0;
	color: var(--ink-muted);
	transition: transform .2s ease, color .2s ease;
}
.faq-question[aria-expanded="true"] .faq-chevron {
	transform: rotate(180deg);
	color: var(--brand);
}
.faq-item:has(.faq-question[aria-expanded="true"]) {
	border-color: var(--brand);
}

/* Collapsed by default; opens via .is-open (toggled by faq.js).
   Uses the CSS grid-template-rows trick so it animates smoothly to/from
   "auto" height without any JS height-measuring.
   IMPORTANT: minmax(0, 0fr) / minmax(0, 1fr) — NOT bare 0fr / 1fr.
   A bare 0fr track still has an implicit "auto" minimum, so on narrow
   (mobile) widths — where wrapped answer text is intrinsically taller —
   the row silently grows to fit that content instead of collapsing to
   true zero, letting a sliver of the answer peek out even while closed.
   Wrapping in minmax(0, ...) forces a real zero-height minimum so the
   row (and therefore overflow: hidden below) actually clips it. */
.faq-answer {
	display: grid;
	grid-template-rows: minmax(0, 0fr);
	overflow: hidden;
	border-top: 1px solid transparent;
	transition: grid-template-rows 0.3s ease, border-color 0.3s ease;
}
.faq-answer.is-open {
	grid-template-rows: minmax(0, 1fr);
	border-top-color: var(--border);
}
.faq-answer-inner {
	overflow: hidden;
	min-height: 0;
	padding: 0 1.35rem;
	color: var(--ink-muted);
	line-height: 1.7;
	font-size: 0.95rem;
	transition: padding 0.3s ease;
}
.faq-answer.is-open .faq-answer-inner {
	padding: 1rem 1.35rem 1.35rem;
}

@media (prefers-reduced-motion: reduce) {
	.faq-answer,
	.faq-answer-inner {
		transition: none;
	}
}
.faq-answer-inner p:not(:last-child) { margin-bottom: 0.75rem; }
.faq-answer-inner ul {
	margin: 0.5rem 0 0.75rem 1.25rem;
	list-style: disc;
}
.faq-answer-inner li { margin-bottom: 0.35rem; }

/* CTA band spacing tweak (keeps it visually tied to the FAQ list above it) */
.faq-cta { border-top: 1px solid rgba(255,255,255,0.08); }

/* Mobile */
@media (max-width: 640px) {
	.faq-tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 0.75rem;
	}
	.faq-tab-btn { flex-shrink: 0; }
	.faq-question { font-size: 0.9rem; padding: 1rem; }
	.faq-answer-inner { padding: 0 1rem; }
	.faq-answer.is-open .faq-answer-inner { padding: 0.85rem 1rem 1.1rem; }
}