/**
 * FAQs page (page-templates/faq.php). Tokens only, from main.css.
 * Gary's brief, 16 Nov 2026: "improve look and feel of faq page please.
 * needs some layout work" — replaces the old single narrow column of 23
 * flat accordions with a two-column layout: sticky topic nav + help card
 * on the left, grouped accordion cards on the right.
 */

/* ---------- Hero: title, intro, search, quick-topic chips ---------- */
.bb-faqhero {
	max-width: 760px;
	margin: 0 auto var(--bb-section);
	text-align: center;
}
.bb-faqhero__title {
	margin: 0 0 10px;
	font-family: var( --bb-font-display );
	font-size: clamp( 1.75rem, 1.4rem + 1.6vw, 2.75rem );
	color: var( --bb-ink );
}
.bb-faqhero__intro {
	margin: 0 0 22px;
	color: var( --bb-body );
	font-size: 1.0625rem;
	line-height: 1.5;
}
.bb-faqhero__search {
	position: relative;
	max-width: 520px;
	margin: 0 auto 18px;
}
.bb-faqhero__searchicon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var( --bb-muted );
	display: flex;
	pointer-events: none;
	z-index: 1;
}
/* Beats main.css's own `input[type="search"]` base rule, which has higher
   specificity (element+attribute) than a single class would on its own -
   the same issue the category drawer search had. */
.bb-faqhero__search input[type="search"].bb-faqhero__input {
	width: 100%;
	height: 52px;
	padding-left: 46px;
	border-radius: var( --bb-r-pill );
	font-size: 1rem;
}
.bb-faqhero__chipwrap {
	position: relative;
}
.bb-faqhero__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	padding: 2px;
}
.bb-faq__chip {
	flex: 0 0 auto;
}
.bb-faq__chip svg { flex: 0 0 auto; }
.bb-faq__chip.is-active { background: var( --bb-ink ); border-color: var( --bb-ink ); color: #fff; }

/* Mobile: a horizontal scroller instead of wrapping. Only overflow-x is set
   (overflow-x:auto + overflow-y:visible don't combine - the visible axis
   just computes to auto too and still clips), so focus rings/shadows get
   room via padding-block on the scroller itself instead. The wrap (which
   never scrolls) carries static edge-fade cues, hidden once JS detects
   there's nothing left to scroll to on that side (assets/js/faq.js). */
@media ( max-width: 599px ) {
	.bb-faqhero__chips {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-block: 10px;
		padding-inline: 2px;
	}
	.bb-faqhero__chips::-webkit-scrollbar { display: none; }
	.bb-faqhero__chipwrap::before,
	.bb-faqhero__chipwrap::after {
		content: "";
		position: absolute;
		top: 0;
		bottom: 0;
		width: 28px;
		pointer-events: none;
		opacity: 1;
		transition: opacity .2s var( --bb-ease, ease );
		z-index: 1;
	}
	.bb-faqhero__chipwrap::before { left: 0; background: linear-gradient( to right, var( --bb-ground ), transparent ); opacity: 0; }
	.bb-faqhero__chipwrap::after { right: 0; background: linear-gradient( to left, var( --bb-ground ), transparent ); }
	.bb-faqhero__chipwrap.is-at-start::before { opacity: 0; }
	.bb-faqhero__chipwrap.is-at-end::after { opacity: 0; }
}

.bb-faqhero__empty {
	margin: 18px auto 0;
	max-width: 460px;
	color: var( --bb-muted );
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}
.bb-faqhero__empty .bb-link { color: var( --bb-ink ); }

/* ---------- Two-column layout ---------- */
.bb-faq__layout {
	display: grid;
	grid-template-columns: 300px minmax( 0, 1fr );
	gap: clamp( 24px, 3vw, 48px );
	align-items: start;
}

/* Left column: topic nav + help card, both sticky as a stack. */
.bb-faq__aside {
	position: sticky;
	top: 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-height: calc( 100vh - 32px );
}
.bb-faq__nav {
	padding: 16px 18px;
	border: 1px solid var( --bb-border );
	border-radius: var( --bb-r-tile );
	background: var( --bb-surface );
}
.bb-faq__navlabel {
	margin: 0 0 10px;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var( --bb-muted );
}
.bb-faq__nav ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.bb-faq__nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 40px;
	padding: 4px 8px;
	border-radius: var( --bb-r-small );
	color: var( --bb-ink-2 );
	text-decoration: none;
	font-size: .875rem;
	font-weight: 600;
}
.bb-faq__nav a svg { flex: 0 0 auto; color: var( --bb-muted ); }
.bb-faq__nav a span:first-of-type { flex: 1; }
.bb-faq__navcount {
	flex: 0 0 auto;
	min-width: 22px;
	text-align: center;
	padding: 1px 6px;
	border-radius: var( --bb-r-pill );
	background: var( --bb-ground );
	color: var( --bb-muted );
	font-size: .75rem;
	font-weight: 700;
}
.bb-faq__nav a:hover { background: var( --bb-ground ); }
.bb-faq__nav a.is-active { background: var( --bb-ink ); color: #fff; }
.bb-faq__nav a.is-active svg { color: var( --bb-yellow ); }
.bb-faq__nav a.is-active .bb-faq__navcount { background: rgba(255,255,255,.18); color: #fff; }

.bb-faq__help { padding: 20px; }
.bb-faq__help h2 { margin: 0 0 4px; font-size: 1.1875rem; }
.bb-faq__helpsub { margin: 0 0 14px; color: var( --bb-muted ); font-size: .875rem; }
.bb-faq__helplist { display: grid; gap: 2px; margin: 0 0 14px; padding: 0; list-style: none; }
.bb-faq__helplink {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: var( --bb-touch );
	padding: 4px 6px;
	border: 0;
	background: none;
	border-radius: var( --bb-r-small );
	color: var( --bb-ink );
	text-decoration: none;
	font-size: .9375rem;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}
.bb-faq__helplink svg { flex: 0 0 auto; color: var( --bb-muted ); }
.bb-faq__helplink:hover { background: var( --bb-ground ); }
.bb-faq__hours {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding-top: 12px;
	border-top: 1px solid var( --bb-border );
	color: var( --bb-muted );
	font-size: .8125rem;
}

/* ---------- Right column: topic groups + cards ---------- */
.bb-faq__topics { display: flex; flex-direction: column; gap: clamp( 32px, 4vw, 48px ); }
.bb-faq__group:target { scroll-margin-top: 90px; }

.bb-faq__groupheader {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
}
.bb-faq__groupicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 auto;
	border-radius: var( --bb-r-small );
	background: var( --bb-soft-yellow );
	color: var( --bb-ink );
}
.bb-faq__groupheader h2 {
	margin: 0;
	font-family: var( --bb-font-display );
	font-size: 1.3125rem;
	flex: 1;
}
.bb-faq__groupcount {
	flex: 0 0 auto;
	color: var( --bb-muted );
	font-size: .8125rem;
	font-weight: 600;
}

.bb-faq__cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 720px;
}
.bb-faq__card {
	border: 1px solid var( --bb-border );
	border-radius: var( --bb-r-card );
	background: var( --bb-surface );
	padding: 2px 18px;
	scroll-margin-top: 90px;
}
.bb-faq__card[open] { border-color: var( --bb-border-2 ); box-shadow: var( --bb-shadow ); }
.bb-faq__q {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding: 14px 0;
	cursor: pointer;
	list-style: none;
	font-weight: 700;
	color: var( --bb-ink );
}
.bb-faq__q::-webkit-details-marker { display: none; }
.bb-faq__q::marker { content: ""; }
.bb-faq__qtext { flex: 1; line-height: 1.4; }
.bb-faq__qtext mark,
.bb-faq__a mark {
	background: var( --bb-soft-yellow );
	color: var( --bb-ink );
	border-radius: 3px;
	padding: 0 1px;
}
.bb-faq__chevron {
	flex: 0 0 auto;
	display: flex;
	color: var( --bb-muted );
	transition: transform .25s var( --bb-ease, ease );
}
.bb-faq__card[open] .bb-faq__chevron { transform: rotate(180deg); color: var( --bb-ink ); }

.bb-faq__a {
	max-width: 62ch;
	padding: 0 0 18px;
	color: var( --bb-body );
	font-size: .9375rem;
	line-height: 1.6;
	overflow: hidden;
}
.bb-faq__a p { margin: 0 0 .75em; }
.bb-faq__a p:last-child { margin-bottom: 0; }
.bb-faq__a .bb-paybadges { margin-top: 10px; }
.bb-faq__a ul, .bb-faq__a ol { margin: 0 0 .75em; padding-left: 1.25em; }
.bb-faq__a li { margin-bottom: .35em; }

/* Smooth open/close height transition (assets/js/faq.js toggles .is-animating
   and sets an explicit height between the two paint frames). */
.bb-faq__card.is-animating .bb-faq__a {
	transition: height .28s var( --bb-ease, ease );
}
@media (prefers-reduced-motion: reduce) {
	.bb-faq__card.is-animating .bb-faq__a,
	.bb-faq__chevron { transition: none; }
}

/* Yellow missing/damaged-item note, kept as a styled callout inside the
   "Orders & changes" topic (parsed from the real content, not invented). */
.bb-faq__callout {
	display: flex;
	gap: 10px;
	margin-top: 14px;
	padding: 14px 16px;
	background: var( --bb-pale-yellow );
	border: 1px solid var( --bb-soft-yellow );
	border-radius: var( --bb-r-small );
	max-width: 720px;
}
.bb-faq__calloutIcon { flex: 0 0 auto; color: var( --bb-ink ); }
.bb-faq__calloutbody { font-size: .875rem; line-height: 1.55; color: var( --bb-ink-2 ); }
.bb-faq__calloutbody p { margin: 0 0 .5em; }
.bb-faq__calloutbody p:last-child { margin-bottom: 0; }

/* Newsletter slot (bbt_newsletter 'button' variant). */
.bb-faq__newsletter { margin-top: var( --bb-section ); display: flex; justify-content: center; }

/* ---------- Responsive ---------- */
@media ( max-width: 1023px ) {
	.bb-faq__layout { grid-template-columns: 1fr; }
	.bb-faq__aside {
		position: static;
		max-height: none;
		order: 2;
	}
	.bb-faq__topics { order: 1; }
	/* The topic nav duplicates the hero's chip row on mobile; the help
	   card is what's worth keeping at the end. */
	.bb-faq__nav { display: none; }
}

@media ( max-width: 599px ) {
	.bb-faqhero__chips { justify-content: flex-start; }
	.bb-faq__groupheader h2 { font-size: 1.125rem; }
	.bb-faq__card { padding: 2px 14px; }
	.bb-faq__a { padding-bottom: 16px; }
}
