/**
 * FAQ - category nav on the left, accordion on the right.
 *
 * Every category and every answer is in the DOM on first paint; inactive panels
 * are hidden here and answers are collapsed with the `hidden` attribute, so
 * crawlers and AI answer engines see the full text without running any JS.
 *
 * About the `:not(#_)` on every selector: Divi scopes its HTML5 element resets
 * under an ID - `#et-boc .et-l section { display: block }` and friends - which
 * outranks a plain class, so inside the builder every panel was forced visible
 * and the colours, borders and spacing below were all discarded. `:not(#_)`
 * matches everything but counts as an ID, so two of them lift each rule above
 * anything Divi scopes that way without changing what it selects.
 *
 * Colours come from the brand tokens on `.af-faq` below, so a club that needs a
 * different accent can re-point them in one place instead of chasing selectors.
 *
 * To override any of this from Divi's custom CSS, add `!important` or match the
 * specificity with a `#page`-style prefix.
 */

.af-faq:not(#_):not(#_) {
	--faq-brand: #440099;
	--faq-brand-deep: #33007a;
	/* Tints of --faq-brand, used for the resting chevron and the nav hover. */
	--faq-brand-soft: #efe8f9;
	--faq-brand-soft-hover: #ddd0f2;
	--faq-brand-softer: #f7f3fc;
	--faq-ink: #1c1c1c;
	--faq-body: #3f3f46;
	--faq-line: #e4e4e7;
	display: grid;
	grid-template-columns: minmax(180px, 260px) 1fr;
	gap: 0;
	align-items: start;
	margin: 0 0 40px;
	color: var(--faq-ink);
}

/* ---------------------------------------------------------------- category nav */

.af-faq:not(#_):not(#_) .af-faq-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0 24px 0 0;
	border-right: 1px solid var(--faq-line);
}

.af-faq:not(#_):not(#_) .af-faq-nav-item {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	border-radius: 999px;
	padding: 9px 16px;
	margin: 0;
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	text-align: left;
	color: var(--faq-ink);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.af-faq:not(#_):not(#_) .af-faq-nav-item:hover {
	background: var(--faq-brand-softer);
	color: var(--faq-brand);
}

.af-faq:not(#_):not(#_) .af-faq-nav-item.is-active,
.af-faq:not(#_):not(#_) .af-faq-nav-item.is-active:hover {
	background: var(--faq-brand);
	color: #fff;
	font-weight: 500;
}

.af-faq:not(#_):not(#_) .af-faq-nav-item:focus-visible {
	outline: 2px solid var(--faq-brand);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- panels */

.af-faq:not(#_):not(#_) .af-faq-panels {
	padding-left: 40px;
	min-width: 0;
}

.af-faq:not(#_):not(#_) .af-faq-panel {
	display: none;
}

.af-faq:not(#_):not(#_) .af-faq-panel.is-active {
	display: block;
}

.af-faq:not(#_):not(#_) .af-faq-panel-title {
	margin: 0 0 24px;
	padding: 0;
	font-size: 34px;
	line-height: 1.15;
	/* 800 resolves to the Moon black face - see the weight-ladder note in the
	   theme's default.css - which is what the page's other section titles use. */
	font-weight: 800;
	text-transform: uppercase;
	color: var(--faq-brand);
}

/* ---------------------------------------------------------------- items */

.af-faq:not(#_):not(#_) .af-faq-item {
	border-bottom: 1px solid var(--faq-line);
}

.af-faq:not(#_):not(#_) .af-faq-question {
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.af-faq:not(#_):not(#_) .af-faq-toggle {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 22px 0;
	margin: 0;
	font: inherit;
	font-size: 21px;
	line-height: 1.3;
	text-align: left;
	color: var(--faq-brand);
	cursor: pointer;
	transition: color 0.15s ease;
}

.af-faq:not(#_):not(#_) .af-faq-toggle:hover {
	color: var(--faq-brand-deep);
}

.af-faq:not(#_):not(#_) .af-faq-toggle:focus-visible {
	outline: 2px solid var(--faq-brand);
	outline-offset: 2px;
}

.af-faq:not(#_):not(#_) .af-faq-chevron {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--faq-brand-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, background-color 0.15s ease;
}

.af-faq:not(#_):not(#_) .af-faq-chevron svg {
	width: 11px;
	height: 11px;
	fill: var(--faq-brand);
	display: block;
}

.af-faq:not(#_):not(#_) .af-faq-toggle:hover .af-faq-chevron {
	background: var(--faq-brand-soft-hover);
}

.af-faq:not(#_):not(#_) .af-faq-toggle[aria-expanded="true"] .af-faq-chevron {
	transform: rotate(180deg);
	background: var(--faq-brand);
}

.af-faq:not(#_):not(#_) .af-faq-toggle[aria-expanded="true"] .af-faq-chevron svg {
	fill: #fff;
}

.af-faq:not(#_):not(#_) .af-faq-answer {
	overflow: hidden;
}

/*
 * `[hidden]` is only a user-agent rule, so any author `display` from the active
 * theme or page builder would beat it and expand every answer at once.
 */
.af-faq:not(#_):not(#_) .af-faq-answer[hidden] {
	display: none;
}

/*
 * The theme widens every Divi row to `calc(100% - 25px)` (theme
 * assets/css/divi.css), so on a wide screen an answer was setting ~1600px lines.
 * The question rows and their rules still span the full column - only the prose
 * is capped, at roughly 70 characters.
 */
.af-faq:not(#_):not(#_) .af-faq-answer-inner {
	padding: 0 0 24px;
	max-width: 68ch;
	font-size: 16px;
	line-height: 1.6;
	color: var(--faq-body);
}

.af-faq:not(#_):not(#_) .af-faq-answer-inner > *:first-child {
	margin-top: 0;
}

.af-faq:not(#_):not(#_) .af-faq-answer-inner > *:last-child {
	margin-bottom: 0;
}

.af-faq:not(#_):not(#_) .af-faq-answer-inner a {
	color: var(--faq-brand);
	/* Divi strips link underlines with `a { text-decoration: none !important }`.
	   An answer's links have to stay recognisable as links, so match it. */
	text-decoration: underline !important;
}

/* Animated open/close, only once JS has taken over. */
.af-faq.is-enhanced:not(#_):not(#_) .af-faq-answer {
	transition: height 0.25s ease;
}

/* ---------------------------------------------------------------- mobile */

/*
 * 980px is Divi's tablet breakpoint and the one the rest of the theme turns on.
 * The previous 782px left every tablet between the two showing a 180px nav
 * squeezed against the panel.
 */
@media (max-width: 980px) {
	.af-faq:not(#_):not(#_) {
		grid-template-columns: 1fr;
	}

	.af-faq:not(#_):not(#_) .af-faq-nav {
		flex-direction: row;
		flex-wrap: nowrap;
		gap: 8px;
		padding: 0 0 16px;
		margin: 0 0 20px;
		border-right: 0;
		border-bottom: 1px solid var(--faq-line);
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.af-faq:not(#_):not(#_) .af-faq-nav::-webkit-scrollbar {
		display: none;
	}

	.af-faq:not(#_):not(#_) .af-faq-nav-item {
		flex: 0 0 auto;
		white-space: nowrap;
		background: var(--faq-brand-softer);
	}

	.af-faq:not(#_):not(#_) .af-faq-nav-item.is-active {
		background: var(--faq-brand);
		color: #fff;
	}

	.af-faq:not(#_):not(#_) .af-faq-panels {
		padding-left: 0;
	}

	.af-faq:not(#_):not(#_) .af-faq-panel-title {
		font-size: 26px;
		margin-bottom: 16px;
	}

	.af-faq:not(#_):not(#_) .af-faq-toggle {
		font-size: 18px;
		gap: 16px;
		padding: 18px 0;
	}
}
