/**
 * Junction Dance FAQ
 *
 * Inherits the theme's palette where available and falls back to the brand
 * colours, so it looks right in the Junction Dance theme and acceptable in any
 * other dark theme.
 */

.jd-faq {
	--jd-faq-accent: var(--wp--preset--color--primary-bright, #3E63D6);
	--jd-faq-line: var(--wp--preset--color--line, #23232C);
	--jd-faq-muted: var(--wp--preset--color--muted, #9A9AA4);
	--jd-faq-surface: var(--wp--preset--color--surface-2, #15151C);
	--jd-faq-display: var(--wp--preset--font-family--display, inherit);

	margin-block: 2rem;
}

/* ------------------------------------------------------------- section nav */

.jd-faq__nav {
	margin-bottom: 2.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--jd-faq-line);
}

.jd-faq__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jd-faq__nav a {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--jd-faq-accent);
}

.jd-faq__nav a:hover,
.jd-faq__nav a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* --------------------------------------------------------------- headings */

.jd-faq__heading {
	font-family: var(--jd-faq-display);
	margin-top: 3rem;
	margin-bottom: 1.25rem;
	scroll-margin-top: 6rem;
}

.jd-faq__heading:first-of-type {
	margin-top: 0;
}

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

.jd-faq__list {
	border-top: 1px solid var(--jd-faq-line);
}

.jd-faq__item {
	border-bottom: 1px solid var(--jd-faq-line);
	scroll-margin-top: 6rem;
}

.jd-faq__q {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1.1rem 0;
	cursor: pointer;
	font-family: var(--jd-faq-display);
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.35;
	list-style: none;
	transition: color 0.2s ease;
}

/* remove the native disclosure triangle */
.jd-faq__q::-webkit-details-marker { display: none; }
.jd-faq__q::marker { content: ""; }

.jd-faq__q:hover {
	color: var(--jd-faq-accent);
}

.jd-faq__q:focus-visible {
	outline: 2px solid var(--jd-faq-accent);
	outline-offset: 3px;
}

/* the +/− indicator */
.jd-faq__q::after {
	content: "";
	flex: none;
	width: 14px;
	height: 14px;
	margin-top: 0.35em;
	background:
		linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
		linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
	color: var(--jd-faq-accent);
	transition: transform 0.25s ease;
}

.jd-faq__item[open] .jd-faq__q::after {
	transform: rotate(135deg);
}

.jd-faq__a {
	padding: 0 0 1.4rem;
	max-width: 62ch;
}

.jd-faq__a p {
	margin: 0 0 0.75rem;
}

.jd-faq__a p:last-child {
	margin-bottom: 0;
}

.jd-faq__cta {
	color: var(--jd-faq-accent);
	font-weight: 500;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 600px) {
	.jd-faq__q {
		font-size: 0.98rem;
		gap: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jd-faq__q,
	.jd-faq__q::after {
		transition: none;
	}
}

/* ------------------------------------------- answers written in the editor */

/*
 * From version 2.0.0 answers come from the block editor, so they can contain
 * lists, links and emphasis as well as paragraphs.
 */

.jd-faq__intro {
	color: var(--jd-faq-muted);
	max-width: 62ch;
	margin: -0.5rem 0 1.5rem;
}

.jd-faq__a > *:first-child {
	margin-top: 0;
}

.jd-faq__a > *:last-child {
	margin-bottom: 0;
}

.jd-faq__a ul,
.jd-faq__a ol {
	margin: 0 0 0.75rem;
	padding-left: 1.25rem;
}

.jd-faq__a li {
	margin-bottom: 0.3rem;
}

.jd-faq__a a {
	color: var(--jd-faq-accent);
	text-underline-offset: 3px;
}

.jd-faq__a h3,
.jd-faq__a h4 {
	font-family: var(--jd-faq-display);
	font-size: 1rem;
	margin: 1.25rem 0 0.5rem;
}

.jd-faq__a img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}
